# glBindFrameBuffer, glShaderSource, glUniform error

**URL:** <https://forums.imgtec.com/t/glbindframebuffer-glshadersource-gluniform-error/400>\
**Category:** PowerVR Insider\
**Created:** [July 3, 2009, 8:37am UTC](https://forums.imgtec.com/t/glbindframebuffer-glshadersource-gluniform-error/400 "2009-07-03T08:37:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![digi123](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@digi123](https://forums.imgtec.com/u/digi123)\
**Post date:** [July 3, 2009, 8:37am UTC](https://forums.imgtec.com/t/glbindframebuffer-glshadersource-gluniform-error/400/1 "2009-07-03T08:37:07Z")

</div>

Hi,  
  
  
  
  
  
I’m using the OpenGL ES 2.0 SDK and I’ve encountered an issue when using glBindFramebuffer. I do an error check after every OpenGL call using glGetError() and it seems like when I call glBindFrameBuffer, I get a GL\_INVALID\_ENUM error after I call glShaderSource! I also get errors after calling glUniformLocation or glUniform4fv, etc.  
  
  
  
  
  
I’m not sure why this is, it also happens in the OGLES2RenderToTexture demo as well.  
  
  
  
  
  
Any ideas?  
  
  
  
  
  
Thanks.

---

<div class="post-metadata">

**Author:** ![jacekc](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@jacekc](https://forums.imgtec.com/u/jacekc)\
**Post date:** [July 3, 2009, 9:17am UTC](https://forums.imgtec.com/t/glbindframebuffer-glshadersource-gluniform-error/400/2 "2009-07-03T09:17:39Z")

</div>

Hi,

Thank you for reporting that problem. This issue is known and will be fixed in next release of SDK. The problem is with calling glBindFramebuffer that produce GL\_INVALID\_ENUM. The other functions you have mentioned should be fine and the error you have recieved is related to glBindFramebuffer.

---

<div class="post-metadata">

**Author:** ![jbuck](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@jbuck](https://forums.imgtec.com/u/jbuck)\
**Post date:** [August 9, 2011, 4:29am UTC](https://forums.imgtec.com/t/glbindframebuffer-glshadersource-gluniform-error/400/3 "2011-08-09T04:29:50Z")

</div>

I am encountering the same issue. Before a call to glShaderSource, glGetError returns GL\_NO\_ERROR, and after calling glShaderSource, I get GL\_INVALID\_ENUM.  
  
  
  
  
  
Jacek’s post says this was fixed (back in '09), but I have version 2.08.28.0634, which seems to have gotten released earlier this year ('11). I, too, am checking glGetError after every OpenGL ES 2.0 function call, and everything is fine until I call glShaderSource. My code is not finished enough to be showing my graphics yet, so I can’t say if there are really any problems in rendering vs. this just being a “phantom” error.  
  
  
  
  
  
Is it known to still be an issue?

---

<div class="post-metadata">

**Author:** ![jbuck](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@jbuck](https://forums.imgtec.com/u/jbuck)\
**Post date:** [August 16, 2011, 10:11am UTC](https://forums.imgtec.com/t/glbindframebuffer-glshadersource-gluniform-error/400/4 "2011-08-16T10:11:52Z")

</div>

I also encountered a situation where glShaderSource is returning GL\_INVALID\_VALUE. According to:  
  
  
http://www.khronos.org/opengles/sdk/docs/man/xhtml/glShaderSource.xml, that is generated when count is less than 0 (which it’s not, since I have it set to 1) or shader is not generated by OpenGL (also not true since I just retrieved it from glCreateShader right before calling glShaderSource). shader is a non-zero value, and I tested all the glGetShaderiv values for it (info log is zero). They all are reasonable values except for GL\_SHADER\_SOURCE\_LENGTH. My shader is 391 characters, but GL\_SHADER\_SOURCE\_LENGTH returns 701. This is the source (vertex shader):  
  
  
  
  
  
  
  
  
#version 100  
  
  
precision mediump int;  
  
  
precision mediump float;  
  
  
varying vec2 xlv\_TEXCOORD0;  
  
  
varying vec4 xlv\_COLOR;  
  
  
attribute vec4 a\_color0;  
  
  
attribute vec3 a\_vertex;  
  
  
uniform mat4 g\_WorldViewProjection;  
  
  
void main ()  
  
  
{  
  
  
 vec4 tmpvar\_1;  
  
  
 tmpvar\_1.w = 1.0;  
  
  
 tmpvar\_1.xyz = a\_vertex;  
  
  
 gl\_Position = (tmpvar\_1 \* g\_WorldViewProjection);  
  
  
 xlv\_COLOR = a\_color0;  
  
  
 xlv\_TEXCOORD0 = vec2(0.0, 0.0);  
  
  
}  
  
  
  
  
  
  
  
  
Even after getting the GL\_INVALID\_VALUE, if I go ahead and compile it and link it into a program, it does so with no further errors and nothing in the infologs.
