Mesa (main): nir/print: expand printing of io semantics.gs_streams

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 16 10:33:46 UTC 2021


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

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Mon Oct 18 15:40:13 2021 +0200

nir/print: expand printing of io semantics.gs_streams

gs_streams can be set for at least 2 other intrinsics.

Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>

---

 src/compiler/nir/nir_print.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 467230ca9a6..670d950b163 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -983,17 +983,18 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
          if (io.high_16bits)
             fprintf(fp, " high_16bits");
 
-         if (state->shader) {
-            if (state->shader->info.stage == MESA_SHADER_GEOMETRY &&
-                instr->intrinsic == nir_intrinsic_store_output) {
-               unsigned gs_streams = io.gs_streams;
-               fprintf(fp, " gs_streams(");
-               for (unsigned i = 0; i < 4; i++) {
-                  fprintf(fp, "%s%c=%u", i ? " " : "", "xyzw"[i],
-                          (gs_streams >> (i * 2)) & 0x3);
-               }
-               fprintf(fp, ")");
+         if (state->shader &&
+               state->shader->info.stage == MESA_SHADER_GEOMETRY &&
+               (instr->intrinsic == nir_intrinsic_store_output ||
+                instr->intrinsic == nir_intrinsic_store_per_primitive_output ||
+                instr->intrinsic == nir_intrinsic_store_per_vertex_output)) {
+            unsigned gs_streams = io.gs_streams;
+            fprintf(fp, " gs_streams(");
+            for (unsigned i = 0; i < 4; i++) {
+               fprintf(fp, "%s%c=%u", i ? " " : "", "xyzw"[i],
+                       (gs_streams >> (i * 2)) & 0x3);
             }
+            fprintf(fp, ")");
          }
 
          break;



More information about the mesa-commit mailing list