Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Validation fails

  1. #1
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Validation fails

    I have a GLSL shader that compiles without errors, but validation fails. When I try to render stuff, nothing gets rendered except for other objects that use other valid shaders. Calling glGetError after glDrawElements gives GL_INVALID_OPERATION.

    How do I solve this?

    I tried a RenderMonkey version, but I had to make a monor modification since texture coord 1 isn't present in the 3DS models.
    It compiles and runs fine in RenderMonkey.

    If I run the shader as written in RM, validation still fails so I don't understand what's bugging it.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Validation fails

    Did you checked it with GLSL validate : http://developer.3dlabs.com/downloads/index.htm

  3. #3
    Intern Contributor
    Join Date
    Sep 2001
    Location
    Marlboro MA
    Posts
    96

    Re: Validation fails

    Originally posted by V-man:

    If I run the shader as written in RM, validation still fails so I don't understand what's bugging it.
    Try glValidateProgramARB( handle ) or glValidateProgram( name ), then check the infolog with glGetInfoLogARB( handle, ... ) or glGetProgramInfoLog( name, ... ) and print the log.

    The most common problem is not setting sampler uniforms correctly so that two or more samplers of different type (example: sampler2D, samplerCube, sampler2DShadow) are pointing to the same texture unit (often 0).

    (RenderMonkey never sets two samplers to the same unit.)

    -mr. bill

  4. #4
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: Validation fails

    Yes, programming error on my part due to fast typing

    2 samples with same texture unit.

    If I call validate after using glUniform, then the info log string may be different than before the call to validate?
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  5. #5
    Intern Contributor
    Join Date
    Sep 2001
    Location
    Marlboro MA
    Posts
    96

    Re: Validation fails

    Originally posted by V-man:
    If I call validate after using glUniform, then the info log string may be different than before the call to validate?
    Of course, you've changed the state by using glUniform (especially if you change a sampler uniform), so validate would pass and the info log string will tell you that.

    -mr. bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •