summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-22 23:03:09 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-13 13:27:42 +0200
commit357936dc7911e4b061e5e8488c1fb44714148d3e (patch)
tree77bcf29e94454b3a8bde25dae4b6790460a6b142
parentef1a098862c781f7fa613a097d26fe1a36d4ed96 (diff)
glsl/linker: skip optimisations for SPIR-V shaders
There is no IR anyway, so the only thing they would achieve is to incorrectly remove variables.
-rw-r--r--src/compiler/glsl/linker.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index d233fdd1a2..de634772ce 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -5018,15 +5018,17 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
lower_tess_level(prog->_LinkedShaders[i]);
}
- /* Call opts before lowering const arrays to uniforms so we can const
- * propagate any elements accessed directly.
- */
- linker_optimisation_loop(ctx, prog->_LinkedShaders[i]->ir, i);
-
- /* Call opts after lowering const arrays to copy propagate things. */
- if (lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir, i))
+ if (!spirv) {
+ /* Call opts before lowering const arrays to uniforms so we can const
+ * propagate any elements accessed directly.
+ */
linker_optimisation_loop(ctx, prog->_LinkedShaders[i]->ir, i);
+ /* Call opts after lowering const arrays to copy propagate things. */
+ if (lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir, i))
+ linker_optimisation_loop(ctx, prog->_LinkedShaders[i]->ir, i);
+ }
+
propagate_invariance(prog->_LinkedShaders[i]->ir);
}