Module: Mesa
Branch: master
Commit: 5f2671bcc5f6b9e3d22f12e18ac254d440dc3510
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f2671bcc5f6b9e3d22f12e18ac254d440dc3510

Author: Rhys Perry <pendingchao...@gmail.com>
Date:   Mon Sep 21 15:56:25 2020 +0100

nir: return progress from nir_lower_io_to_scalar_early

Signed-off-by: Rhys Perry <pendingchao...@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6891>

---

 src/compiler/nir/nir.h                    |  2 +-
 src/compiler/nir/nir_lower_io_to_scalar.c | 14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 332903b76ad..cca046f76db 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -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);
diff --git a/src/compiler/nir/nir_lower_io_to_scalar.c 
b/src/compiler/nir/nir_lower_io_to_scalar.c
index b54d7754531..d2ce42e68ec 100644
--- a/src/compiler/nir/nir_lower_io_to_scalar.c
+++ b/src/compiler/nir/nir_lower_io_to_scalar.c
@@ -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;
 }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to