From d3cb79e043338b0e55a3fba8df652f3ce4894d0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 31 Dec 2016 12:02:26 +0100 Subject: [PATCH] glsl: run do_lower_jumps properly in do_common_optimizations so that backends don't have to run it manually Reviewed-by: Eric Anholt --- src/compiler/glsl/glsl_parser_extras.cpp | 3 ++- src/mesa/program/ir_to_mesa.cpp | 2 -- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 +------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index 4566aa92ecd..b12cf3d90c0 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -2106,7 +2106,8 @@ do_common_optimization(exec_list *ir, bool linked, OPT(do_minmax_prune, ir); OPT(do_rebalance_tree, ir); OPT(do_algebraic, ir, native_integers, options); - OPT(do_lower_jumps, ir); + OPT(do_lower_jumps, ir, true, true, options->EmitNoMainReturn, + options->EmitNoCont, options->EmitNoLoops); OPT(do_vec_index_to_swizzle, ir); OPT(lower_vector_insert, ir, false); OPT(do_swizzle_swizzle, ir); diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 653b8221dee..0089e80faa3 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2979,8 +2979,6 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) | LOG_TO_LOG2 | INT_DIV_TO_MUL_RCP | ((options->EmitNoPow) ? POW_TO_EXP2 : 0))); - progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress; - progress = do_common_optimization(ir, true, true, options, ctx->Const.NativeIntegers) || progress; diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 95992965ed8..af4dd0e6b7f 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6872,14 +6872,8 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) } do { - progress = false; - - progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress; - progress = do_common_optimization(ir, true, true, options, - ctx->Const.NativeIntegers) - || progress; - + ctx->Const.NativeIntegers); progress = lower_if_to_cond_assign((gl_shader_stage)i, ir, options->MaxIfDepth, if_threshold) || progress; -- 2.30.2