summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/ff_fragment_shader.cpp
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-12-31 13:42:09 +0100
committerMarek Olšák <[email protected]>2017-01-05 13:07:12 +0100
commit0a5018c1a483abe6c4dddc6c65a7f4e939efc726 (patch)
tree17a58572cfb31f921c54399c5b28b1434cff0532 /src/mesa/main/ff_fragment_shader.cpp
parente51baeb6c1386681d8f9c285a8f4912d91fad7ee (diff)
mesa: add gl_constants::GLSLOptimizeConservatively
to reduce the amount of GLSL optimizations for drivers that can do better. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/ff_fragment_shader.cpp')
-rw-r--r--src/mesa/main/ff_fragment_shader.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index fd2c71f93ee..48b84e8fd73 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1254,9 +1254,13 @@ create_new_program(struct gl_context *ctx, struct state_key *key)
const struct gl_shader_compiler_options *options =
&ctx->Const.ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
- while (do_common_optimization(p.shader->ir, false, false, options,
- ctx->Const.NativeIntegers))
- ;
+ /* Conservative approach: Don't optimize here, the linker does it too. */
+ if (!ctx->Const.GLSLOptimizeConservatively) {
+ while (do_common_optimization(p.shader->ir, false, false, options,
+ ctx->Const.NativeIntegers))
+ ;
+ }
+
reparent_ir(p.shader->ir, p.shader->ir);
p.shader->CompileStatus = true;