summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/shader_cache.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-02-13 11:53:30 +1100
committerTimothy Arceri <[email protected]>2017-02-17 11:18:43 +1100
commite3adde023b73cbee1423078163e925dc400078e9 (patch)
tree5ef8b909ab167b87a5591df957a84d04314b4684 /src/compiler/glsl/shader_cache.cpp
parentdc0c0c176d0b4620923182aa8709084119d8f92c (diff)
glsl: add api and glsl version to hash generation for shaders
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/shader_cache.cpp')
-rw-r--r--src/compiler/glsl/shader_cache.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index f1e2bf1386f..3bfcab9bcf5 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -1300,6 +1300,14 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
ralloc_asprintf_append(&buf, "sso: %s\n",
prog->SeparateShader ? "T" : "F");
+ /* A shader might end up producing different output depending on the glsl
+ * version supported by the compiler. For example a different path might be
+ * taken by the preprocessor, so add the version to the hash input.
+ */
+ ralloc_asprintf_append(&buf, "api: %d glsl: %d fglsl: %d\n",
+ ctx->API, ctx->Const.GLSLVersion,
+ ctx->Const.ForceGLSLVersion);
+
char sha1buf[41];
for (unsigned i = 0; i < prog->NumShaders; i++) {
struct gl_shader *sh = prog->Shaders[i];