glsl: don't optimize program if MESA_GLSL=nopt
authorBrian Paul <brianp@vmware.com>
Tue, 7 Apr 2009 17:01:15 +0000 (11:01 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 7 Apr 2009 17:01:15 +0000 (11:01 -0600)
src/mesa/shader/slang/slang_compile.c

index 6348f799aa2c40a2896b337d8a9350fa2fb49d55..ba2fc4f85c9c7bcc52071f2fdbc9598af167910b 100644 (file)
@@ -2801,7 +2801,8 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader)
    shader->CompileStatus = success;
 
    if (success) {
-      if (shader->Pragmas.Optimize) {
+      if (shader->Pragmas.Optimize &&
+          (ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
          _mesa_optimize_program(ctx, shader->Program);
       }
    }