【发布时间】:2015-05-24 19:18:28
【问题描述】:
你好,对不起我的英语。
我正在 Eclipse Luna Ide 上使用 openGLES2.0 开发 Android 应用程序,而 OpenGL ES 扩展“GL_OES_element_index_uint”在 Android 模拟器中不起作用。它在尝试使用“UNSIGNED_INT”类型调用“glDrawElements”时崩溃并显示接下来的两条错误消息。
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:
【问题讨论】:
-
如果模拟器本身崩溃,这是一个应该在b.android.com 报告的错误。
-
感谢法登。就是这样。它出现一个错误的窗口消息,模拟器崩溃并关闭。我会做那个报告
-
我刚刚查看了“b.android.com”并且已经报告了这个错误(问题 40830)。那里没有可行的解决方案。 :-(