Mesa (main): nouveau/nir: Set the input for vertex/instance ID like TGSI does.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 20 22:13:40 UTC 2022


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

Author: Emma Anholt <emma at anholt.net>
Date:   Thu Apr 14 11:23:34 2022 -0700

nouveau/nir: Set the input for vertex/instance ID like TGSI does.

Doesn't seem to help tests, but clears a TODO about differences between
them.

Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16063>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index 51b12c189a1..7abd83d3a56 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -1004,19 +1004,21 @@ bool Converter::assignSlots() {
    BITSET_FOREACH_SET(i, nir->info.system_values_read, SYSTEM_VALUE_MAX) {
       info_out->sv[info_out->numSysVals].sn = tgsi_get_sysval_semantic(i);
       info_out->sv[info_out->numSysVals].si = 0;
-      info_out->sv[info_out->numSysVals].input = 0; // TODO inferSysValDirection(sn);
+      info_out->sv[info_out->numSysVals].input = 0;
 
       switch (i) {
+      case SYSTEM_VALUE_VERTEX_ID:
+         info_out->sv[info_out->numSysVals].input = 1;
+         info_out->io.vertexId = info_out->numSysVals;
+         break;
       case SYSTEM_VALUE_INSTANCE_ID:
+         info_out->sv[info_out->numSysVals].input = 1;
          info_out->io.instanceId = info_out->numSysVals;
          break;
       case SYSTEM_VALUE_TESS_LEVEL_INNER:
       case SYSTEM_VALUE_TESS_LEVEL_OUTER:
          info_out->sv[info_out->numSysVals].patch = 1;
          break;
-      case SYSTEM_VALUE_VERTEX_ID:
-         info_out->io.vertexId = info_out->numSysVals;
-         break;
       default:
          break;
       }



More information about the mesa-commit mailing list