From b765740a66821c4e97816a938c94740717661ba3 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 17 Apr 2013 17:30:22 -0700 Subject: 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 Reviewed-by: Ian Romanick Reviewed-by: Eric Anholt --- src/glsl/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/glsl/main.cpp') diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index ce084b4d7ac..d7e35bcb3a2 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); -- cgit v1.2.3