I am using the Qcom MSM8660 MDP with the latest ICS Android version.
I am trying to use couple of textures in a fragment shader. When I try to access any of the values from the texture (with float values), i get the below error,
E/Adreno200-ES20(3166): <__load_uniform_int:258>: GL_INVALID_OPERATION
The shader code is as below,
uniform samplerExternalOES uSurfTex;
uniform sampler2D Tex;varying vec2 vTexCoord;void main(){ vec4 temp1 = texture2D(Tex, vTexCoord);
}
The program creating and setting the texture is as below,
mTexture = GLES20.glGetUniformLocation(handlePgm, "Tex");
this.checkGlError("glGetUniformLocation Tex");
if (mTexture == GLES_NOT_A_HANDLE)
{
throw new RuntimeException(
"Could not get attrib location for Tex");
}
int[] textures = new int[1];
GLES20.glGenTextures(1, textures, 0);
this.checkGlError("glGenTextures");
mTexture1 = textures[0];
this.checkGlError("glGetUniformLocation Tex");
if (mTexture == GLES_NOT_A_HANDLE)
{
throw new RuntimeException(
"Could not get attrib location for Tex");
}
int[] textures = new int[1];
GLES20.glGenTextures(1, textures, 0);
this.checkGlError("glGenTextures");
mTexture1 = textures[0];
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTexture1);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,
GLES20.GL_NEAREST);
GLES20.GL_NEAREST);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,
GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,
GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, 256, 1, 0, GLES20.GL_RGBA, GLES20.GL_FLOAT, crossProcessLUT);
GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
Hello,
i have a similar problem when i try to execute your sample: ShadowMap in Adreno SDK 3.1 on Nexus 4.
I receive from LogCat this following error:
03-01 13:36:39.097: W/Adreno200-ES20(17224): <__load_uniform_float:581>: GL_INVALID_OPERATION
There are some problems with the existing OpenGL ES 3 samples in the SDK because we only recently had a mature GLES3 driver on device that we could test against, so we were only testing them with the emulator. The samples have been fixed now and will be included in the next release of the SDK, which will be in a couple of weeks.
Oki doki Dave, thx for your reply :-)
I will wait the next release, or maybe manually debug your sample (ShadowMap).
I have some clues ... but i need to implement some rendering, like retroproject depth light samples in the eyes screen space and see what happens.
I will keep your posted !
YoYo
Re :)
I found where is the problem for this error: <__load_uniform_int: >: GL_INVALID_OPERATION,
it seems that this procedure: glUniform4f( ... ) don't work (in the ShadowMap sample the code is: glUniform4f( m_hShadowMapPCFAmbientLoc, 0.2f, 0.2f, 0.2f, 0.0f ); )
Anyway it's not the main problem for this sample, i think the depth render texture don't work on my android device (Nexus 4).
The clipmap of depth buffer isn't the same on my XPeria Play (where the ShadowMap sample work),
on the Nexus 4, it looks like a z encoding problem on the depth buffer (not in the same space on this 2 device (XPeria, Nexus)).
Maybe a problem around the initialising of the FBO and attached texture:
Yeaaaaaaaaaahhh i found a solution !!! ^^
According to http://www.khronos.org/registry/gles/extensions/OES/OES_depth_texture.txt
In the ShadowMap sample, you use UNSIGNED_SHORT, and refers to a 16-bit depth value.
It seems on Nexus 4, the default size for a depth buffer is 32-bit so we need to use UNSIGNED_INT instead of UNSIGNED_SHORT and ... Tadammmmm that's work ^^
Hope my posts can help some (desperate) developers !
YoOOooYoOOOOooO