compiler/glsl: Return progress from propagate_invariance()
Doing so allow you to easily tell what the pass did using the existing infrastructure in the OPT macro. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10292>
This commit is contained in:
@@ -2331,7 +2331,7 @@ do_common_optimization(exec_list *ir, bool linked,
|
||||
OPT(do_dead_functions, ir);
|
||||
OPT(do_structure_splitting, ir);
|
||||
}
|
||||
propagate_invariance(ir);
|
||||
OPT(propagate_invariance, ir);
|
||||
OPT(do_if_simplification, ir);
|
||||
OPT(opt_flatten_nested_if_blocks, ir);
|
||||
OPT(opt_conditional_discard, ir);
|
||||
|
@@ -177,7 +177,7 @@ bool lower_blend_equation_advanced(gl_linked_shader *shader, bool coherent);
|
||||
|
||||
bool lower_builtins(exec_list *instructions);
|
||||
bool lower_subroutine(exec_list *instructions, struct _mesa_glsl_parse_state *state);
|
||||
void propagate_invariance(exec_list *instructions);
|
||||
bool propagate_invariance(exec_list *instructions);
|
||||
|
||||
namespace ir_builder { class ir_factory; };
|
||||
|
||||
|
@@ -113,13 +113,17 @@ ir_invariance_propagation_visitor::visit(ir_dereference_variable *ir)
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
propagate_invariance(exec_list *instructions)
|
||||
{
|
||||
ir_invariance_propagation_visitor visitor;
|
||||
bool progress = false;
|
||||
|
||||
do {
|
||||
visitor.progress = false;
|
||||
visit_list_elements(&visitor, instructions);
|
||||
progress = progress || visitor.progress;
|
||||
} while (visitor.progress);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
Reference in New Issue
Block a user