summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}