diff options
author | Connor Abbott <[email protected]> | 2019-08-30 17:57:18 +0200 |
---|---|---|
committer | Connor Abbott <[email protected]> | 2019-09-05 12:38:46 +0200 |
commit | 2af431cf7fe9303bbfbd719e4612f00043583f40 (patch) | |
tree | 47b24510d420f4fa65984147b7959e9fbcc1c15d /src/compiler | |
parent | 49503ae74e2634ebd2e0d3caa36c25ed99e19b9c (diff) |
gallium: Plumb through a way to disable GLSL const lowering
For radeonsi, we will prefer the NIR pass as it'll generate better code
(some index calculation and a single load vs. a load, then index
calculation, then another load) and oftentimes NIR optimization can kick
in and make all the access indices constant.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 281d59d12a5..c52c665a4c2 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -5211,7 +5211,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) 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 (ctx->Const.GLSLLowerConstArrays && + 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); |