Load Uniform Matrix 1104 GL_Invalid_Operation Android OpenGLES 2.0

﹥>﹥吖頭↗ 提交于 2019-12-11 12:06:26

问题


I am working on implementing rendering to texture on Android 4.3+ (OpenGLES 2.0)

I am getting the following error in my DrawFrame() method:

01-15 13:40:07.545: W/Adreno-ES20(23709): <__load_uniform_matrix:1104>: GL_INVALID_OPERATION
01-15 13:40:07.545: E/com.hpp.STextureRender(23709): glDrawArrays: glError 1282
01-15 13:40:07.545: D/io.hpp.CaptureManager(23709): Error encountered in drawFrame = glDrawArrays: glError 1282
01-15 13:40:07.545: W/System.err(23709): java.lang.RuntimeException: glDrawArrays: glError 1282
01-15 13:40:07.545: W/System.err(23709):    at com.hpp.openGL.STextureRender.checkGlError(STextureRender.java:524)
01-15 13:40:07.545: W/System.err(23709):    at com.hpp.openGL.STextureRender.drawFrame(STextureRender.java:316)
01-15 13:40:07.545: W/System.err(23709):    at com.harmonicprocesses.penelopefree.openGL.MyGLRenderer.drawFrame(MyGLRenderer.java:286)
01-15 13:40:07.545: W/System.err(23709):    at com.harmonicprocesses.penelopefree.camera.CaptureManager.drawFrame(CaptureManager.java:446)
01-15 13:40:07.545: W/System.err(23709):    at com.harmonicprocesses.penelopefree.camera.CaptureManager.access$7(CaptureManager.java:444)
01-15 13:40:07.555: W/System.err(23709):    at com.harmonicprocesses.penelopefree.camera.CaptureManager$6.run(CaptureManager.java:278)
01-15 13:40:07.555: W/System.err(23709):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1463)
01-15 13:40:07.555: W/System.err(23709):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

Could the problem stem from setting up EGL14.eglChooseConfig(mEGLDisplay, configsAttribs, 0, configs, 0, configs.length, numConfigs, 0); with

private int[] version, configsAttribs = {
        EGL14.EGL_RED_SIZE, 8,
        EGL14.EGL_GREEN_SIZE, 8,
        EGL14.EGL_BLUE_SIZE, 8,
        EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT,
        EGL_RECORDABLE_ANDROID, 1,
        EGL14.EGL_NONE

But using the following texture connected to the FBO

    // generate the textures
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, rain.width, rain.height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_SHORT_4_4_4_4, juliaTexBuff);

Notice the discrepency of RGBA4444 as opposed to RGBA8888 in EGL?


回答1:


The problem was during loading a uniform variable before calling glUseProgram. If I put the call after the block that contained glGetUniform4fv() it obviously fails because it doesn't know where the uniform is because the program is loaded.



来源:https://stackoverflow.com/questions/21149605/load-uniform-matrix-1104-gl-invalid-operation-android-opengles-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!