summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 3f46bfd60df..aa080228694 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -2798,7 +2798,9 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader)
shader->CompileStatus = success;
if (success) {
- _mesa_optimize_program(ctx, shader->Program);
+ if (shader->Pragmas.Optimize) {
+ _mesa_optimize_program(ctx, shader->Program);
+ }
}
if (ctx->Shader.Flags & GLSL_LOG) {