clamp
clamp

Reputation: 34006

OpenGL/GLSL checking if shader compiled fine on intel cards

i am using this code to check if my glsl shader compiled fine.

    glGetObjectParameterivARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength);

    if (infologLength > 1)
    {
        int charsWritten  = 0;
        char * const infoLog = new char[infologLength];
        glGetInfoLogARB(obj, infologLength, &charsWritten, infoLog);
        tError(infoLog, false);
        delete infoLog;
    }
}

the length of the returned string is empty on nvidia and ATI cards, but on intel cards this one returns the string "no errors."

now what is the best way to find out, if there are really no errors? should i just check for this string? or is there a convention what this function glGetInfoLogARB should return?

Upvotes: 2

Views: 4960

Answers (1)

Danvil
Danvil

Reputation: 22991

Try

bool CompileSuccessful(int obj) {
  int status;
  glGetShaderiv(obj, GL_COMPILE_STATUS, &status);
  return status == GL_TRUE;
}

to check if a shader was compiled successfully and

bool LinkSuccessful(int obj) {
  int status;
  glGetProgramiv(obj, GL_LINK_STATUS, &status);
  return status == GL_TRUE;
}

to check if the whole program was linked successfully.

Upvotes: 9

Related Questions