summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-11-18 19:49:55 +0100
committerMarek Olšák <[email protected]>2016-11-22 18:05:51 +0100
commitb818df1e714ed8bd2f1c3a68ee842cd81a0d7cf4 (patch)
treeec681ad62ab1b0322c8dab0244b2032fa226d5bf /src/compiler
parent6dfdf52b6af416fccf28420d64585d809d745b0a (diff)
glsl: add gl_linked_shader::SourceChecksum
for debugging v2: wrap all checksums in #ifdef DEBUG Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/linker.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 845a7938f91..1a00a900ef0 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -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;
}