if (ctx->Const.VertexID_is_zero_based)
lower_vertex_id(linked);
+#ifdef DEBUG
+ /* Compute the source checksum. */
+ linked->SourceChecksum = 0;
+ for (unsigned i = 0; i < num_shaders; i++) {
+ if (shader_list[i] == NULL)
+ continue;
+ linked->SourceChecksum ^= shader_list[i]->SourceChecksum;
+ }
+#endif
+
return linked;
}
{
gl_shader_stage Stage;
+#ifdef DEBUG
+ unsigned SourceChecksum;
+#endif
+
struct gl_program *Program; /**< Post-compile assembly code */
/**
GLboolean CompileStatus;
bool IsES; /**< True if this shader uses GLSL ES */
- GLuint SourceChecksum; /**< for debug/logging purposes */
+#ifdef DEBUG
+ unsigned SourceChecksum; /**< for debug/logging purposes */
+#endif
const GLchar *Source; /**< Source code string */
GLchar *InfoLog;
printf("Mesa: glUseProgram(%u)\n", shProg->Name);
for (i = 0; i < shProg->NumShaders; i++) {
+#ifdef DEBUG
printf(" %s shader %u, checksum %u\n",
_mesa_shader_stage_to_string(shProg->Shaders[i]->Stage),
shProg->Shaders[i]->Name,
shProg->Shaders[i]->SourceChecksum);
+#else
+ printf(" %s shader %u\n",
+ _mesa_shader_stage_to_string(shProg->Shaders[i]->Stage),
+ shProg->Shaders[i]->Name);
+#endif
}
if (shProg->_LinkedShaders[MESA_SHADER_VERTEX])
printf(" vert prog %u\n",
return;
}
+#ifdef DEBUG
fprintf(f, "/* Shader %u source, checksum %u */\n", shader->Name, shader->SourceChecksum);
+#else
+ fprintf(f, "/* Shader %u source */\n", shader->Name);
+#endif
fputs(shader->Source, f);
fprintf(f, "\n");