Module: Mesa
Branch: staging/23.3
Commit: 583b2e031cdf19ca08e5da79652b82d47bc3729b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=583b2e031cdf19ca08e5da79652b82d47bc3729b

Author: Dave Airlie <[email protected]>
Date:   Thu Dec  7 13:14:34 2023 +1000

nvk: fix transform feedback with multiple saved counters.

The SET_STREAM_OUT_BUFFER_LOAD_WRITE_POINTER registers have an
8 dword stride, but the code is only adding one dword between them
then the MME is calling an illegal method.

This is the simple fix, otherwise I think we'd have to multiply
somehow in the MME which seems pointless.

Fixes KHR-GL45.transform_feedback* on zink on nvk.

Fixes: 5fd7df4aa2c3 ("nvk: Support for vertex shader transform feedback")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26558>
(cherry picked from commit 1b27a6be20732b251648c5ca6f93e6c0a9279f7f)

---

 .pick_status.json                   | 2 +-
 src/nouveau/vulkan/nvk_cmd_buffer.c | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 6713728252c..fbaaede4ae1 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -624,7 +624,7 @@
         "description": "nvk: fix transform feedback with multiple saved 
counters.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "5fd7df4aa2c36726d190ba06c6ce9f1c01da5d4a",
         "notes": null
diff --git a/src/nouveau/vulkan/nvk_cmd_buffer.c 
b/src/nouveau/vulkan/nvk_cmd_buffer.c
index b6d7ee3979a..8fefcd58560 100644
--- a/src/nouveau/vulkan/nvk_cmd_buffer.c
+++ b/src/nouveau/vulkan/nvk_cmd_buffer.c
@@ -649,7 +649,8 @@ nvk_CmdBeginTransformFeedbackEXT(VkCommandBuffer 
commandBuffer,
          struct nv_push *p = nvk_cmd_buffer_push(cmd, 6);
          P_IMMD(p, NVC597, SET_MME_DATA_FIFO_CONFIG, FIFO_SIZE_SIZE_4KB);
          P_1INC(p, NV9097, CALL_MME_MACRO(NVK_MME_XFB_COUNTER_LOAD));
-         P_INLINE_DATA(p, cb_idx);
+         /* The STREAM_OUT_BUFFER_LOAD_WRITE_POINTER registers are 8 dword 
stride */
+         P_INLINE_DATA(p, cb_idx * 8);
          P_INLINE_DATA(p, cb_addr >> 32);
          P_INLINE_DATA(p, cb_addr);
       } else {
@@ -658,7 +659,8 @@ nvk_CmdBeginTransformFeedbackEXT(VkCommandBuffer 
commandBuffer,
          __push_immd(p, SUBC_NV9097, NV906F_SET_REFERENCE, 0);
 
          P_1INC(p, NV9097, CALL_MME_MACRO(NVK_MME_XFB_COUNTER_LOAD));
-         P_INLINE_DATA(p, cb_idx);
+         /* The STREAM_OUT_BUFFER_LOAD_WRITE_POINTER registers are 8 dword 
stride */
+         P_INLINE_DATA(p, cb_idx * 8);
          nv_push_update_count(p, 1);
          nvk_cmd_buffer_push_indirect_buffer(cmd, buffer, offset, 4);
       }

Reply via email to