gpt4 book ai didi

尝试使用 gl 扩展 "GL_OES_element_index_uint"时 Android 模拟器崩溃

转载 作者:行者123 更新时间:2023-11-29 00:10:40 24 4
gpt4 key购买 nike

你好,抱歉我的英语不好。

我正在 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 扩展。

而且我还在两个着色器(顶点和 fragment )中放置了下一个指令,以便在着色器中也激活扩展: #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:

最佳答案

我终于在真实设备上运行了该应用程序。我认为问题在于“GL_OES_element_index_uint”扩展未在 PC 的 GPU 中实现,因此模拟器无法将该扩展转换为主机 GPU。

如果您尝试在主机 GPU 中使用 openGL ES 扩展 (OES_extensions),模拟器似乎毫无用处,因为 PC 的 GPU 无法理解这些扩展。

关于尝试使用 gl 扩展 "GL_OES_element_index_uint"时 Android 模拟器崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30427364/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com