glsl: add gl_linked_shader::SourceChecksum

for debugging

v2: wrap all checksums in #ifdef DEBUG

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
This commit is contained in:
Marek Olšák
2016-11-18 19:49:55 +01:00
parent 6dfdf52b6a
commit b818df1e71
4 changed files with 27 additions and 1 deletions

View File

@@ -2297,6 +2297,16 @@ link_intrastage_shaders(void *mem_ctx,
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;
}