Imagination PowerVR SDK Blog

glGetError


#1

Hi, I’m getting glGetError() number 0x500 when I call glShaderSource() on first vertex shader my program makes. All the other vertex shaders are fine after this one. I can’t ignore the error as the attach fails on the program object later on.





If I call glShaderSource() on the same source again, I get no error.





eg:


     VertexShader = glCreateShader(GL_VERTEX_SHADER);


     glShaderSource(VertexShader, 1, (const char**)&ps, NULL);


        glGetError(); <<< returns 0x500


     glShaderSource(VertexShader, 1, (const char**)&ps, NULL);


        glGetError(); <<< returns no error.





Anyone know whats going on?





The vertex shader itself can be as simple as void main( void ) {} and the error still occurs.





Thanks.





Steve.


#2

Hi,

thanks for report. Could you please send as narrowed example that will help us to reproduce the problem? if possible please send it to devtech@imgtec.com

Regards,


#3

Have you checked that the error is not caused by an earlier GL call? 0x500 is GL_INVALID_ENUM, which should never happen with glShaderSource.






#4

I’ve found that particular error. It was caused by calling:





               glFramebufferTexture2D(GL_TEXTURE_2D,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,s->Surface,0);





instead of





               glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,s->Surface,0);





This produces less than helpful errors when glShaderSource is called. Ideally this should not happen.





I have some other errors that seem odd too, I’ll take a look at them when I have a moment.





glGetError is called before any routines I’m testing in order to remove any previous errors.





Thanks,





Steve.


#5

Thanks very much for you investigation of that problem. We will look to that



#6

I’m also getting error code 0x502 when calling:





// FBO is my framebuffer object, not the default one.





glBindFramebuffer(GL_FRAMEBUFFER,FBO);     


glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_DEPTH_ATTACHMENT,GL_RENDERBUFFER,0);





glGetError returns 0x502 here.



#7

Thanks again.



#8

Sorry to be a pain, but I appear to be getting problems all over the place:





          GLuint myfb;


          GLuint Surface;





          glGenFramebuffers(1,&myfb);


          glBindFramebuffer(GL_FRAMEBUFFER,myfb);


          glGenRenderbuffers(1,&Surface);


          GL_ERRORCHECK;


          glBindRenderbuffer(GL_RENDERBUFFER,Surface);


          GL_ERRORCHECK;


          glRenderbufferStorage(GL_RENDERBUFFER,GL_STENCIL_INDEX8,width,height);


          GL_ERRORCHECK; << I GET ERROR 0x500 here.





I’ve tried just GL_STENCIL too.





Is there any time scale for getting these issues addressed?





Many thanks,





Steve.


#9

Hi,

The issues you have pointed out will be fixed in next release which is scheduled for August 2010.Â

Many thanks for your feedback,