Imagination PowerVR SDK Blog

Compiling Shader fails without error message

pvrvframe

#1


Hello,

i have a simple OpenGLES 2.0 application, which i develop on a PC (ubuntu 10.10 x86, 32bit) installation and want to use on a OMAP3 Board with a sgx530.

Running the application on the PC, with the PVR Emulator?/PVR Shell? works fine, but when I rebuilding the app on the Omap3 platform, and run it there, compiling the shader fails.

Checking GL_COMPILE_SHADER with glGetShaderiv() returns GL_FALSE, but calling glGetShaderInfoLog() returns a empty string.

I checked if the platform supports online shader compiliation with glGetBooleanv(GL_SHADER_COMPILER, ..) and it returns GL_TRUE.

I use the following fragment and vertex shader

const char* defaultFragmentShader = "
    varying lowp vec3 primaryColor;
    void main (void)
    {
        gl_FragColor = vec4(primaryColor, 0.0);
    }";

const char* defaultVertexShader = "
    attribute highp vec4    position;
    attribute lowp vec3    color;
    uniform mediump mat4    matrix;
    varying vec3 primaryColor;
    void main(void)
    {
        primaryColor = color;
        gl_Position = matrix * position;
    }";

Does anyone has a idea what could be wrong?

Thank you!




mapa172011-09-09 10:52:27

#2

Buenas,

my project is really stuck by this bug, does someone maybe has some more general suggestions on where i can search for problems? Some general considerations while changing platform, using OGLES?

Saludos




#3

Are you using a Beagle board?





What version of the drivers are you using?





You can find out using:





cat /proc/pvr/version





or eglQueryString()






#4

Hi,

running cat /proc/pvr/version i get

Version 1.4.14.2616 (release) drivers/staging/omap3-sgx
System Version String: SGX revision 1.2.5

I am working on a IGEPv2 board which is quite simular to the Beagle Board i guess.

After playing around with the code ( basicly adding debug aboutput, and doing more error checking in the shader compile part ) i am able to compile the shader, but linking ( calling glLinkProgram() ) failes, again, without error message.

I simply get no messages when calling glGetProgramiv on GL_COMPILE_STATUS or GL_LINK_STATUS.
Do i have to enable debug output in some way?

Thank you,
Manuel




#5

Hi,

i fixed a bug in the shader, which i was able to find on the development platform, because there i do get error messages if something with the shaders is wrong.

Running the program on the development platform now gives me an error in the PVRVFrame Log, stating
In glShaderSource error: 500 (GL_INVALID_ENUM) : (null)

the actual shaders i use are

Code:


uniform sampler2D s_texture;
uniform lowp int primType;
varying lowp vec4 primaryColor;
varying mediump vec2 v_texCoord;
varying lowp float primTypeForward;

void main (void)
{
    if( primType == 0 ){
        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
    }
   
    if( primType == 1 ){
       gl_FragColor = primaryColor;
        //gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
    }
   
   
    if( primType == 2 ){
        gl_FragColor = texture2D(s_texture, v_texCoord);
    }
}


and

uniform lowp int primType;
uniform mat4 matrix;
uniform lowp vec4    singleColor;

attribute highp vec4    position;
attribute vec2 a_texCoord;

varying lowp vec4 primaryColor;
varying vec2 v_texCoord;

void main(void)   
{
    if( primType == 1 ){
        primaryColor = singleColor;
    }
   
    if( primType == 2 ){
        v_texCoord = a_texCoord;
    }

    gl_Position = position * matrix;

    //newpos = position * matrix;
    //newpos.x = newpos.x * 0.2;
    //newpos.y = newpos.y * 0.2;
    //newpos.z = newpos.z * 0.2;
    //gl_Position = newpos;
}