#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */
#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */
#define GLSL_USE_PROG 0x80 /**< Log glUseProgram calls */
+#define GLSL_REPORT_ERRORS 0x100 /**< Print compilation errors */
/**
flags |= GLSL_UNIFORMS;
if (strstr(env, "useprog"))
flags |= GLSL_USE_PROG;
+ if (strstr(env, "errors"))
+ flags |= GLSL_REPORT_ERRORS;
}
return flags;
* compilation was successful.
*/
_mesa_glsl_compile_shader(ctx, sh);
+
+ if (sh->CompileStatus == GL_FALSE &&
+ (ctx->Shader.Flags & GLSL_REPORT_ERRORS)) {
+ _mesa_debug(ctx, "Error compiling shader %u:\n%s\n",
+ sh->Name, sh->InfoLog);
+ }
}
_mesa_glsl_link_shader(ctx, shProg);
+ if (shProg->LinkStatus == GL_FALSE &&
+ (ctx->Shader.Flags & GLSL_REPORT_ERRORS)) {
+ _mesa_debug(ctx, "Error linking program %u:\n%s\n",
+ shProg->Name, shProg->InfoLog);
+ }
+
/* debug code */
if (0) {
GLuint i;