Check OpenGL / GLSL if shader is compiled on Intel cards

I am using this code to check if my shader is glsl compiled.

    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 returns the string "no error".

Now, what's the best way to find out if there are actually no errors? should i just check this line? or is there a convention of what this function should return glGetInfoLogARB?

+2


a source to share


1 answer


Try

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

      

to check if the shader has been compiled 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.

+8


a source







All Articles