diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2013-04-17 17:30:22 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2013-05-12 09:36:41 -0700 |
commit | b765740a66821c4e97816a938c94740717661ba3 (patch) | |
tree | edc9135329af865781199d48e12514a1aa74ab01 /src/glsl/main.cpp | |
parent | 6bb9acfb4eb3f6a2c61e03cbd5a6c6c464d2ae0c (diff) | |
download | external_mesa3d-b765740a66821c4e97816a938c94740717661ba3.zip external_mesa3d-b765740a66821c4e97816a938c94740717661ba3.tar.gz external_mesa3d-b765740a66821c4e97816a938c94740717661ba3.tar.bz2 |
glsl: Pass struct shader_compiler_options into do_common_optimization.
do_common_optimization may need to make choices about whether to emit
certain kinds of instructions. gl_context::ShaderCompilerOptions
contains exactly that information, so it makes sense to pass it in.
Rather than passing the whole array, pass the structure for the stage
that's currently being worked on.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/glsl/main.cpp')
-rw-r--r-- | src/glsl/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index ce084b4..d7e35bc 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -174,9 +174,11 @@ compile_shader(struct gl_context *ctx, struct gl_shader *shader) /* Optimization passes */ if (!state->error && !shader->ir->is_empty()) { + const struct gl_shader_compiler_options *opts = + &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)]; bool progress; do { - progress = do_common_optimization(shader->ir, false, false, 32); + progress = do_common_optimization(shader->ir, false, false, 32, opts); } while (progress); validate_ir_tree(shader->ir); |