nir: return progress from nir_lower_io_to_scalar_early

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6891>
This commit is contained in:
Rhys Perry 2020-09-21 15:56:25 +01:00 committed by Marge Bot
parent fd4d0b447c
commit 5f2671bcc5
2 changed files with 9 additions and 7 deletions

View file

@ -4413,7 +4413,7 @@ void nir_lower_io_arrays_to_elements(nir_shader *producer, nir_shader *consumer)
void nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
bool outputs_only);
void nir_lower_io_to_scalar(nir_shader *shader, nir_variable_mode mask);
void nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask);
bool nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask);
bool nir_lower_io_to_vector(nir_shader *shader, nir_variable_mode mask);
bool nir_lower_fragcolor(nir_shader *shader);

View file

@ -374,7 +374,7 @@ nir_lower_io_to_scalar_early_instr(nir_builder *b, nir_instr *instr, void *data)
* This function is intended to be called earlier than nir_lower_io_to_scalar()
* i.e. before nir_lower_io() is called.
*/
void
bool
nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask)
{
struct io_to_scalar_early_state state = {
@ -383,11 +383,11 @@ nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask)
.mask = mask
};
nir_shader_instructions_pass(shader,
nir_lower_io_to_scalar_early_instr,
nir_metadata_block_index |
nir_metadata_dominance,
&state);
bool progress = nir_shader_instructions_pass(shader,
nir_lower_io_to_scalar_early_instr,
nir_metadata_block_index |
nir_metadata_dominance,
&state);
/* Remove old input from the shaders inputs list */
hash_table_foreach(state.split_inputs, entry) {
@ -409,4 +409,6 @@ nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask)
_mesa_hash_table_destroy(state.split_outputs, NULL);
nir_remove_dead_derefs(shader);
return progress;
}