Forums - Adreno GL_INVALID_OPERATION error

6 posts / 0 new
Last post
Adreno GL_INVALID_OPERATION error
deepak.k
Join Date: 27 Jul 12
Posts: 4
Posted: Fri, 2012-07-27 06:35
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];
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTexture1);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,
 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);
  • Up0
  • Down0
Join Date: 31 Jan 12
Posts: 11
Posted: Fri, 2013-03-01 04:41

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

Do you have an idea about this problem ?
 
Thx in advance ^^
YoYo
  • Up0
  • Down0
Dave Astle
Profile picture
Join Date: 19 Oct 12
Location: San Diego, CA
Posts: 99
Posted: Fri, 2013-03-01 10:03

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.

  • Up0
  • Down0
Join Date: 31 Jan 12
Posts: 11
Posted: Fri, 2013-03-01 16:49

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

  • Up0
  • Down0
Join Date: 31 Jan 12
Posts: 11
Posted: Sat, 2013-03-02 08:35

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:

 

// Create shadow texture
glGenTextures( 1, &m_hShadowMapTexId );
glBindTexture( GL_TEXTURE_2D, m_hShadowMapTexId );
...
glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 
m_nShadowMapFBOTextureWidth, m_nShadowMapFBOTextureHeight, 
0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL );
 
// Create FBO for Depth Shadow Map rendering
glGenFramebuffers( 1, &m_hShadowMapBufId );
glBindFramebuffer( GL_FRAMEBUFFER, m_hShadowMapBufId );
glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_hShadowMapTexId, 0 );
glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_2D, m_hShadowMapTexId );
 
Maybe something wrong with glTexImage2D( ... ),
or the way of the Z are encoding in a depth texture (very hard to debug without profiler and gui debugger).
 
Thanks a lot for your (future) answers ^^
 
YoOooYooooO

 

  • Up0
  • Down0
Join Date: 31 Jan 12
Posts: 11
Posted: Sat, 2013-03-02 08:42

Yeaaaaaaaaaahhh i found a solution !!! ^^

According to http://www.khronos.org/registry/gles/extensions/OES/OES_depth_texture.txt

 

Textures with <format> and <internalFormat> values of DEPTH_COMPONENT
    refer to a texture that contains depth component data.  <type> is used
    to determine the number of bits used to specify depth texel values.  

    A <type> value of UNSIGNED_SHORT refers to a 16-bit depth value.
  
    A <type> value of UNSIGNED_INT refers to a 32-bit depth value.

 

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

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.