GL_INVALID_OPERATION after calling ShaderState.glUniform
Posted by Pete on Feb 25, 2016; 3:57pm
URL: https://forum.jogamp.org/GL-INVALID-OPERATION-after-calling-ShaderState-glUniform-tp4036347.html
Hello again folks,
Some of my devices aren't drawing with one of my shaders, a simple block colour fill / stroke shader, and I'm mystified why:
Running target profile GL2ES2 in JOGL debugGL mode via command line params & getting this:
Caused by: com.jogamp.opengl.GLException: Thread[Redrawer,5,main] glGetError() returned the following error codes after a call to glUniform(<com.jogamp.opengl.GLUniformData> GLUniformData[name matViewProjection, 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.util.glsl.ShaderState.uniform(ShaderState.java:955)
this is happening whenever it tries to first draw with my colour paint shader but after looking up the GL error I still can't see what's wrong :(
The program should be set, the uniform location looks ok, the data is there..
My other paints - linear & radial gradients & textures - all work fine. Which is odd because they use the same names in their files for the matrices for matViewProjection and matWorld - with the same common paint draw method so everything happens in the same order.
here is the shader code of the colour paint:
VS:
uniform mat4 matViewProjection;
uniform mat4 matWorld;
attribute vec3 position;
void main()
{
gl_Position = matViewProjection * matWorld * vec4( position, 1.0 );
}
PS:
uniform vec4 colour;
uniform vec4 blend;
void main()
{
gl_FragColor = colour * blend;
}
Some data about the device in question:
os.name Linux
os.arch arm
java.vendor Oracle Corporation
java.home /usr/lib/jvm/java-8-oracle/jre
java.vm.name Java HotSpot(TM) Client VM
java.vm.vendor Oracle Corporation
java.runtime.name Java(TM) SE Runtime Environment
Vendor: ARM
Renderer: Mali-T628
Version: OpenGL ES 3.1
GL Profile: GLProfile[GLES3/GLES3.hw]
If its of any consequence - and it may very well be but I wouldn't know why.. - the only difference between the shaders running on my working devices is when loading them:
ShaderCode.defaultShaderCustomization( GL, false, true ) <- on devices where this isn't working and
ShaderCode.defaultShaderCustomization( GL, false, false ) <- on devices where this is working
Again, why would this break only the 1 shader and not all of them?
Any ideas anyone? :S
Pedro