I’m trying to compile my shader in OpenGLES 2.0:
/* Try compiling the shader. */
GL_CHECK(glCompileShader(*pShader));
GL_CHECK(glGetShaderiv(*pShader, GL_COMPILE_STATUS, &iStatus));
glGetShaderiv returns iStatus greater than 1 and when I try to get log info I get empty string:
if (iStatus > 1)
{
GLsizei slen = 0;
GLchar* compiler_log = (GLchar*)malloc(iStatus);
glGetShaderInfoLog(*pShader, iStatus, &slen, compiler_log);
cout <<"compiler_log:\n"<<compiler_log<<endl;
free (compiler_log);
}
Shader:
attribute vec4 av4position;
attribute vec3 av3colour;
attribute vec2 av2texture;
uniform mat4 mvp;
varying vec3 vv3colour;
varying vec2 vv2texture;
void main()
{
// Pass the texture coordinate attribute to a varying.
vv2texture = av2texture;
// Pass the color value to a varying.
vv3colour = av3colour;
gl_Position = mvp * av4position;
}
Does anybody has any idea why?
glGetShaderiv didn’t return value greater than 1, it didn’t return anything (variable was not initialized).
The reason it didn’t return anything is that there were no packages installed:
libglapi-mesa
libgl1-mesa-glx
libgl1-mesa-dri
which are not available on Ubuntu 11.04, only on Ubuntu 11.10. So I wasn’t able to find solution for 11.04, I just upgraded to 11.10.