nir: return progress from nir_lower_io_to_scalar_early
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 21 Sep 2020 14:56:25 +0000 (15:56 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 9 Oct 2020 15:47:59 +0000 (15:47 +0000)
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>

src/compiler/nir/nir.h
src/compiler/nir/nir_lower_io_to_scalar.c

index 332903b..cca046f 100644 (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);
index b54d775..d2ce42e 100644 (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;
 }