加载均匀矩阵1104 GL_Invalid_Operation的Android OpenGLES 2

2019-10-19 05:44发布

我工作的实施纹理渲染在Android 4.3以上版本(OpenGLES 2.0)

我收到以下错误在我的DrawFrame()方法:

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)

可以在问题干从设置EGL14.eglChooseConfig(mEGLDisplay, configsAttribs, 0, configs, 0, configs.length, numConfigs, 0);

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

但是,使用连接到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);

注意RGBA4444的discrepency在EGL反对RGBA8888?

Answer 1:

问题是调用glUseProgram之前加载一个统一的变量中。 如果我把通话包含glGetUniform4fv(后挡),它显然失败,因为它不知道在哪里的制服是因为该程序被加载。



文章来源: Load Uniform Matrix 1104 GL_Invalid_Operation Android OpenGLES 2.0