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: Intermittent shader compile error with unhelpful info log

  1. #1
    Junior Member Regular Contributor
    Join Date
    Nov 2004
    Location
    San Diego, CA, USA
    Posts
    114

    Question Intermittent shader compile error with unhelpful info log

    I've been getting occasional errors compiling a vertex shader. It's the same vertex shader that usually works, on the same hardware, so I don't think the GLSL code could really be bad. The info log usually shows this:

    Code :
    Vertex shader failed to compile with the following errors:

    Yes, that's the whole thing. It happens on Windows, with both ATI and NVidia GPUs. I haven't seen it on the Mac, but since I haven't figured out how to reproduce it, I'm not absolutely sure it doesn't happen.

    I know this is pretty vague, but any idea what could cause such an effect? Too many shaders floating around at once? Bad data passed to OpenGL in some completely different part of the code?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    It could be any of the above. If it is not consistent, I would bet on an error else where in your code - possibly a string or array overflow that is corrupting the shader source

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    7
    It could be of outdated graphics driver or outdated shader compiler.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Nov 2004
    Location
    San Diego, CA, USA
    Posts
    114
    Quote Originally Posted by tonyo_au View Post
    possibly a string or array overflow that is corrupting the shader source
    For what it's worth, when the error happens I read the source back with glGetShaderSource and write it to a log file, and it looks OK.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Nov 2004
    Location
    San Diego, CA, USA
    Posts
    114
    I'm still banging my head against this one. I have noticed that if I don't call wglShareLists when I create my contexts, the error goes away. However, I've been trimming out stuff until there is not much that could be shared: No texture objects, display lists, VBOs, PBOs. The only things left that would be shared, as far as I know, would be shader and program objects.

    Here's a rough outline of the comings and goings of shaders and programs, omitting source, compilation, and render steps:

    Code :
    vertexShader = glCreateShader( GL_VERTEX_SHADER );
    program = glCreateProgram();
    glAttachShader( program, vertexShader );
    fragmentShader = glCreateShader( GL_FRAGMENT_SHADER );
    glAttachShader( program, fragmentShader );
    glDeleteShader( fragmentShader );
    glLinkProgram( program );
    glDetachShader( program, fragmentShader );
    glDetachShader( program, vertexShader );
    glDeleteProgram( program );
    glDeleteShader( vertexShader );
    // that OpenGL context gets destroyed, and another gets created
    vertexShader = glCreateShader( GL_VERTEX_SHADER );
    // and the error happens when I try to load and compile this one

    Is that sequence valid?
    Last edited by James W. Walker; 02-28-2014 at 11:54 AM.

Posting Permissions

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