您好,对不起我的英语。
我正在Eclipse Luna Ide上开发一个带有openGLES2.0的Android应用程序,以及OpenGL ES扩展" GL_OES_element_index_uint"不能在Android模拟器中工作。当试图调用" glDrawElements"它时会崩溃。使用" UNSIGNED_INT"输入并显示接下来的两条错误消息。
E/emuglGLESv2_enc(764): unsupported index buffer type 5125
E/eglCodecCommon(764): **** ERROR unknown type 0x1405 (glSizeof,72)
当我通过调用" glGetString(GL_EXTENSIONS)"来请求OpenGL扩展时它告诉我支持扩展GL_OES_element_index_uint。
我打电话给" glEnable(GL_EXTENSIONS)"在渲染器类中,以激活GL扩展。
我还将下一个指令放在两个着色器(顶点和片段)中,以便在着色器中激活扩展: #extension GL_OES_element_index_uint:启用
并且着色器的编译结果表明不支持此功能,您可以在我在此处发布的日志行中看到。
我不知道我做错了什么或模拟器崩溃是由于与openGLES扩展程序和Android模拟器不兼容
感谢您的帮助。
以下是我的日志摘录。
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bc640 android.hardware.location.network fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bc6d0 android.hardware.location fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bc750 android.software.input_methods fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bc7d8 android.hardware.touchscreen.multitouch.jazzhand fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bc880 android.hardware.touchscreen.multitouch fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bc918 android.hardware.screen.landscape fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bc9a8 android.hardware.screen.portrait fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bca30 android.hardware.sensor.compass fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcab8 android.hardware.faketouch fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcb38 android.hardware.camera fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcbb0 android.hardware.camera.any fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcc30 android.hardware.bluetooth fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bccb0 android.hardware.touchscreen.multitouch.distinct fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcd58 android.software.home_screen fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcdd8 android.hardware.microphone fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bce58 android.hardware.camera.autofocus fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcee8 android.hardware.sensor.accelerometer fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bcf80 android.software.live_wallpaper fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bd008 android.hardware.touchscreen fl=0x0}
05-24 12:59:54.278: I/System.out(2203): AEP: FeatureInfo{b31bd088 android.software.app_widgets fl=0x0}
05-24 12:59:54.298: I/System.out(2203): AEP: FeatureInfo{b31bd108 glEsVers=2.0 fl=0x0}
05-24 12:59:54.308: I/System.out(2203): repetOnResume: 0
05-24 12:59:54.358: D/libEGL(2203): loaded /system/lib/egl /libEGL_emulation.so
05-24 12:59:54.358: D/(2203): HostConnection::get() New Host Connection established 0xb7abdd10, tid 2203
05-24 12:59:54.408: D/libEGL(2203): loaded /system/lib/egl/libGLESv1_CM_emulation.so
05-24 12:59:54.408: D/libEGL(2203): loaded /system/lib/egl/libGLESv2_emulation.so
05-24 12:59:54.448: W/EGL_emulation(2203): eglSurfaceAttrib not implemented
05-24 12:59:54.448: D/OpenGLRenderer(2203): Enabling debug mode 0
05-24 12:59:54.448: D/(2203): HostConnection::get() New Host Connection established 0xb7ac3850, tid 2217
05-24 12:59:54.498: I/System.out(2203): GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_texture_npot GL_OES_rgb8_rgba8
05-24 12:59:54.518: V/ShaderHelper(2203): Results of compiling source:
05-24 12:59:54.518: V/ShaderHelper(2203): uniform mat4 u_Matrix;
05-24 12:59:54.518: V/ShaderHelper(2203): attribute vec4 a_Position;
05-24 12:59:54.518: V/ShaderHelper(2203): attribute vec2 a_TextureCoordinates;
05-24 12:59:54.518: V/ShaderHelper(2203): varying vec2 v_TextureCoordinates;
05-24 12:59:54.518: V/ShaderHelper(2203): void main()
05-24 12:59:54.518: V/ShaderHelper(2203): {
05-24 12:59:54.518: V/ShaderHelper(2203): v_TextureCoordinates = a_TextureCoordinates;
05-24 12:59:54.518: V/ShaderHelper(2203): gl_Position = u_Matrix * a_Position;
05-24 12:59:54.518: V/ShaderHelper(2203): }
05-24 12:59:54.518: V/ShaderHelper(2203): :
05-24 12:59:54.518: V/ShaderHelper(2203): Results of compiling source:
05-24 12:59:54.518: V/ShaderHelper(2203): #ifdef GL_FRAGMENT_PRECISION_HIGH
05-24 12:59:54.518: V/ShaderHelper(2203): precision highp float;
05-24 12:59:54.518: V/ShaderHelper(2203): #else
05-24 12:59:54.518: V/ShaderHelper(2203): precision mediump float;
05-24 12:59:54.518: V/ShaderHelper(2203): #endif
05-24 12:59:54.518: V/ShaderHelper(2203): //precision mediump float;
05-24 12:59:54.518: V/ShaderHelper(2203): uniform sampler2D u_TextureUnit;
05-24 12:59:54.518: V/ShaderHelper(2203): varying vec2 v_TextureCoordinates;
05-24 12:59:54.518: V/ShaderHelper(2203): void main()
05-24 12:59:54.518: V/ShaderHelper(2203): {
05-24 12:59:54.518: V/ShaderHelper(2203): gl_FragColor = texture2D(u_TextureUnit, v_TextureCoordinates);
05-24 12:59:54.518: V/ShaderHelper(2203): }
05-24 12:59:54.518: V/ShaderHelper(2203): :
05-24 12:59:54.558: V/ShaderHelper(2203): Results of linking program:
05-24 12:59:54.558: V/ShaderHelper(2203): Results of validating program: 1
05-24 12:59:54.558: V/ShaderHelper(2203): Log:
05-24 12:59:54.558: V/ShaderHelper(2203): Results of compiling source:
05-24 12:59:54.558: V/ShaderHelper(2203): #version 150
05-24 12:59:54.558: V/ShaderHelper(2203): #extension GL_OES_element_index_uint : enable
05-24 12:59:54.558: V/ShaderHelper(2203): uniform mat4 u_Matrix;
05-24 12:59:54.558: V/ShaderHelper(2203): attribute vec4 a_Position;
05-24 12:59:54.558: V/ShaderHelper(2203): void main()
05-24 12:59:54.558: V/ShaderHelper(2203): {
05-24 12:59:54.558: V/ShaderHelper(2203): gl_Position = u_Matrix * a_Position;
05-24 12:59:54.558: V/ShaderHelper(2203):
05-24 12:59:54.558: V/ShaderHelper(2203): }
05-24 12:59:54.558: V/ShaderHelper(2203): :WARNING: 0:2: '#extension' : 'GL_OES_element_index_uint' is not supported
05-24 12:59:54.558: V/ShaderHelper(2203): Results of compiling source:
05-24 12:59:54.558: V/ShaderHelper(2203): #version 150
05-24 12:59:54.558: V/ShaderHelper(2203): #extension GL_OES_element_index_uint : enable
05-24 12:59:54.558: V/ShaderHelper(2203): #ifdef GL_FRAGMENT_PRECISION_HIGH
05-24 12:59:54.558: V/ShaderHelper(2203): precision highp float;
05-24 12:59:54.558: V/ShaderHelper(2203): #else
05-24 12:59:54.558: V/ShaderHelper(2203): precision mediump float;
05-24 12:59:54.558: V/ShaderHelper(2203): #endif
05-24 12:59:54.558: V/ShaderHelper(2203): //precision mediump float;
05-24 12:59:54.558: V/ShaderHelper(2203): uniform vec4 u_Color;
05-24 12:59:54.558: V/ShaderHelper(2203): void main()
05-24 12:59:54.558: V/ShaderHelper(2203): {
05-24 12:59:54.558: V/ShaderHelper(2203): gl_FragColor = u_Color;
05-24 12:59:54.558: V/ShaderHelper(2203): }
05-24 12:59:54.558: V/ShaderHelper(2203): :WARNING: 0:2: '#extension' : 'GL_OES_element_index_uint' is not supported
05-24 12:59:54.578: V/ShaderHelper(2203): Results of linking program:
05-24 12:59:54.578: V/ShaderHelper(2203): Results of validating program: 1
05-24 12:59:54.578: V/ShaderHelper(2203): Log:
答案 0 :(得分:2)
最后我在真实设备上运行了app runnig。我认为问题在于" GL_OES_element_index_uint"扩展并未在PC的GPU中实现,因此仿真器无法将该扩展转换为HOST GPU。
如果您尝试在主机GPU中使用openGL ES扩展(OES_extensions),仿真器似乎毫无用处,因为PC的GPU无法理解这些扩展。