Display Warnings

Using glGetInfoLog() Its posible to display the errors and number of warnings.

But How can I read the warnings not just the number of them?

donno if youve gotta a nvidia card but taken from a nvidia pdf

Strict Shader Portability Warnings
NVIDIA provides extensions to GLSL to make the language more productive and
functional. Use the “Strict Shader Portability Warnings” to obtain additional messages in
the info log output of shader and program objects.
These messages are limited right now. Please report portability issues that are not
warned about by the compiler so these additional warnings can be provided.

so hopefully they will improve in future

I know its possible to see the warnings using the cgc compiler, something like this:

cgc -oglsl -profile … fragment or shader program.

But I’lll guess its not posible to return this warning at compile time. Well thanks anyway.

glGetInfoLog() will return both the warnings and the errors, and non-warning information as well. Just read the text returned. It should be noted that the specific text of the info log is driver specific, and may vary based on what vendor, or driver version, you’re using.

ATI drivers spit out text which tells you whether the shaders will run in software or hardware, even when there are no warnings or errors. NVIDIA drivers spit out empty strings if there are no warnings or errors.

  char log[2000];
  GLsizei len = sizeof( log );
  glGetInfoLogARB( shaderHandle_, len, &len, log );
  assert( !glGetError() );
  if( len >= sizeof( log ) ) {
    len = sizeof( log )-1;
  }
  log[len] = 0;
  fprintf( stderr, "info log: %s
", log );

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.