Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL/GLSL checking if shader compiled fine on intel cards

Tags:

intel

opengl

glsl

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?

like image 941
clamp Avatar asked Nov 23 '25 14:11

clamp


1 Answers

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.

like image 53
Danvil Avatar answered Nov 27 '25 23:11

Danvil