Module: Mesa
Branch: main
Commit: 27a9ddad28ab44207bb84b9fc0e00d87e9fb8dec
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=27a9ddad28ab44207bb84b9fc0e00d87e9fb8dec

Author: Marek Olšák <[email protected]>
Date:   Sat Nov 18 22:37:27 2023 -0500

nir: return progress from nir_remove_sysval_output

Changing IO semantics doesn't affect the SSA structure.

Same as nir_remove_varying.

Reviewed-by: Qiang Yu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>

---

 src/compiler/nir/nir.c | 4 +++-
 src/compiler/nir/nir.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 00860a06a86..b78fa575a4b 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -3371,7 +3371,7 @@ nir_remove_varying(nir_intrinsic_instr *intr, 
gl_shader_stage next_shader)
  * This marks the output store instruction as not feeding fixed-function
  * logic. If the instruction has no other use, it's removed.
  */
-void
+bool
 nir_remove_sysval_output(nir_intrinsic_instr *intr)
 {
    nir_io_semantics sem = nir_intrinsic_io_semantics(intr);
@@ -3381,8 +3381,10 @@ nir_remove_sysval_output(nir_intrinsic_instr *intr)
       /* Demote the store instruction. */
       sem.no_sysval_output = true;
       nir_intrinsic_set_io_semantics(intr, sem);
+      return false;
    } else {
       nir_instr_remove(&intr->instr);
+      return true;
    }
 }
 
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 40417cdfb09..76502c7f5e1 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -5148,7 +5148,7 @@ bool nir_slot_is_varying(gl_varying_slot slot);
 bool nir_slot_is_sysval_output_and_varying(gl_varying_slot slot,
                                            gl_shader_stage next_shader);
 bool nir_remove_varying(nir_intrinsic_instr *intr, gl_shader_stage 
next_shader);
-void nir_remove_sysval_output(nir_intrinsic_instr *intr);
+bool nir_remove_sysval_output(nir_intrinsic_instr *intr);
 
 bool nir_lower_amul(nir_shader *shader,
                     int (*type_size)(const struct glsl_type *, bool));

Reply via email to