Login  Register

Re: GL_INVALID_OPERATION after calling ShaderState.glUniform

Posted by Pete on Feb 26, 2016; 3:02pm
URL: https://forum.jogamp.org/GL-INVALID-OPERATION-after-calling-ShaderState-glUniform-tp4036347p4036373.html

Some debug + trace output:

draw texture ( this works ):

glBindTexture(<int> 0xDE1, <int> 0x2)
glUseProgram(<int> 0x4)
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name mvp, location 5, size 4x4, count 1, data
0: [    0.00104    0.00000    0.00000   -1.00000 ]
0: [    0.00000    0.00185    0.00000    1.00000 ]
0: [    0.00000    0.00000   -2.00000   -1.00000 ]
0: [    0.00000    0.00000    0.00000    1.00000 ]
,
])
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name mworld, location 6, size 4x4, count 1, data
0: [    1.92000    0.00000    0.00000    0.00000 ]
0: [    0.00000    1.08000    0.00000 -1080.00000 ]
0: [    0.00000    0.00000    1.00000    0.00000 ]
0: [    0.00000    0.00000    0.00000    1.00000 ]
,
])
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name texture, location 0, size 1x1, count 1, data 0])
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name source, location 4, size 1x4, count 1, data DirectFloatBufferU[pos 0, lim 4, cap 4, remaining 4; array false, direct true, r/w true: 0.0, 0.0, 1.0, 1.0]])
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name blend, location 3, size 1x4, count 1, data DirectFloatBufferU[pos 0, lim 4, cap 4, remaining 4; array false, direct true, r/w true: 1.0, 1.0, 1.0, 1.0]])
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name geomsize, location 2, size 1x2, count 1, data DirectFloatBufferU[pos 0, lim 2, cap 2, remaining 2; array false, direct true, r/w true: 1000.0, 1000.0]])
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name texrotation, location 1, size 1x1, count 1, data DirectFloatBufferU[pos 0, lim 1, cap 1, remaining 1; array false, direct true, r/w true: 0.0]])
glGenBuffers(<int> 0x1, <[I>, <int> 0x0)
glBindBuffer(<int> 0x8892, <int> 0x1)
glBufferData(<int> 0x8892, <long> 48, <java.nio.Buffer> java.nio.DirectFloatBufferU[pos=0 lim=12 cap=12], <int> 0x88E4)
glVertexAttribPointer(<com.jogamp.opengl.GLArrayData> GLArrayDataServer[position, index -1, location 0, isVertexAttribute true, usesGLSL true, usesShaderState false, dataType 0x1406, bufferClazz class java.nio.FloatBuffer, elements 4, components 3, stride 12b 3c, initialElementCount 4, mappedElementCount 0, mappedStorage null, vboEnabled true, vboName 1, vboUsage 0x88e4, vboTarget 0x8892, vboOffset 0, sealed true, bufferEnabled false, bufferWritten true, buffer java.nio.DirectFloatBufferU[pos=0 lim=12 cap=12], alive true])
glBindBuffer(<int> 0x8892, <int> 0x0)
glEnableVertexAttribArray(<int> 0x0)
glDrawArrays(<int> 0x6, <int> 0x0, <int> 0x4)
glDisableVertexAttribArray(<int> 0x0)
glBindTexture(<int> 0xDE1, <int> 0x0)
glUseProgram(<int> 0x0)

Done with the texture, no issues..

glScissor(<int> 0x0, <int> 0x0, <int> 0x780, <int> 0x438)
glScissor(<int> 0x0, <int> 0x0, <int> 0x780, <int> 0x438)
glUseProgram(<int> 0x1)
glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name mvp, location 5, size 4x4, count 1, data
0: [    0.00104    0.00000    0.00000   -1.00000 ]
0: [    0.00000    0.00185    0.00000    1.00000 ]
0: [    0.00000    0.00000   -2.00000   -1.00000 ]
0: [    0.00000    0.00000    0.00000    1.00000 ]
,
])[DEBUG:Renderer] pushFrameBuffer - pFrameBuffer is already assignedjava.lang.RuntimeException: com.jogamp.opengl.GLException: Caught GLException: Thread[main-Display-.x11_:0.0-1-EDT-1,5,main] glGetError() returned the following error codes after a call to glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name mvp, location 5, size 4x4, count 1, data
0: [    0.00104    0.00000    0.00000   -1.00000 ]
0: [    0.00000    0.00185    0.00000    1.00000 ]
0: [    0.00000    0.00000   -2.00000   -1.00000 ]
0: [    0.00000    0.00000    0.00000    1.00000 ]
,
]): GL_INVALID_OPERATION ( 1282 0x502),  on thread main-Display-.x11_:0.0-1-EDT-1

        at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:249)
        at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:163)
        at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:427)
        at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2133)
        at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1024)
        at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1029)
        at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:499)
Caused by: com.jogamp.opengl.GLException: Caught GLException: Thread[main-Display-.x11_:0.0-1-EDT-1,5,main] glGetError() returned the following error codes after a call to glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name mvp, location 5, size 4x4, count 1, data
0: [    0.00104    0.00000    0.00000   -1.00000 ]
0: [    0.00000    0.00185    0.00000    1.00000 ]
0: [    0.00000    0.00000   -2.00000   -1.00000 ]
0: [    0.00000    0.00000    0.00000    1.00000 ]
,
]): GL_INVALID_OPERATION ( 1282 0x502),  on thread main-Display-.x11_:0.0-1-EDT-1
        at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1311)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
        at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
        at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:259)
        at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119)
        at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141)
        at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:3682)
        at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:3616)
        at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1003)
        at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1015)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:150)
        at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:372)
Caused by: com.jogamp.opengl.GLException: Thread[main-Display-.x11_:0.0-1-EDT-1,5,main] glGetError() returned the following error codes after a call to glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name mvp, location 5, size 4x4, count 1, data
0: [    0.00104    0.00000    0.00000   -1.00000 ]
0: [    0.00000    0.00185    0.00000    1.00000 ]
0: [    0.00000    0.00000   -2.00000   -1.00000 ]
0: [    0.00000    0.00000    0.00000    1.00000 ]
,
]): GL_INVALID_OPERATION ( 1282 0x502),
        at com.jogamp.opengl.DebugGLES3.writeGLError(DebugGLES3.java:7703)
        at com.jogamp.opengl.DebugGLES3.glUniform(DebugGLES3.java:6273)
        at com.jogamp.opengl.TraceGLES3.glUniform(TraceGLES3.java:4623)
        at com.jogamp.opengl.util.glsl.ShaderState.uniform(ShaderState.java:955)


And then... yeah :/