Mesa (master): nv50/ir/nir: add workaround for double vertex attribs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 22 11:52:39 UTC 2020


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

Author: Karol Herbst <kherbst at redhat.com>
Date:   Sun Jun 14 11:46:46 2020 +0200

nv50/ir/nir: add workaround for double vertex attribs

Gallium adjusts the vertrix attrib types for doubles, but can run out of
bounds this way. As the slot is counted from 0 anyway, just fix it.

Signed-off-by: Karol Herbst <kherbst at redhat.com>
Tested-by: Ben Skeggs <bskeggs at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5512>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 2 ++
 1 file changed, 2 insertions(+)

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 90ce9ebd2eb..81aa7af63ba 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -989,6 +989,8 @@ bool Converter::assignSlots() {
             info->numPatchConstants = MAX2(info->numPatchConstants, index + slots);
          break;
       case Program::TYPE_VERTEX:
+         if (slot >= VERT_ATTRIB_GENERIC0)
+            slot = VERT_ATTRIB_GENERIC0 + vary;
          vert_attrib_to_tgsi_semantic((gl_vert_attrib)slot, &name, &index);
          switch (name) {
          case TGSI_SEMANTIC_EDGEFLAG:



More information about the mesa-commit mailing list