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

Author: Alyssa Rosenzweig <[email protected]>
Date:   Wed Jul 19 08:42:35 2023 -0400

panfrost: Fix transform feedback on v9 harder

We might need more push uniforms (FAU) than the currently bound program. Update
that too for correct results on v9.

Fixes: c282f80c988 ("panfrost: Fix transform feedback on v9")
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24198>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c 
b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 185b2f99f8d..4779b260269 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -3430,6 +3430,8 @@ panfrost_launch_xfb(struct panfrost_batch *batch,
    mali_ptr saved_rsd = batch->rsd[PIPE_SHADER_VERTEX];
    mali_ptr saved_ubo = batch->uniform_buffers[PIPE_SHADER_VERTEX];
    mali_ptr saved_push = batch->push_uniforms[PIPE_SHADER_VERTEX];
+   unsigned saved_nr_push_uniforms =
+      batch->nr_push_uniforms[PIPE_SHADER_VERTEX];
 
    ctx->uncompiled[PIPE_SHADER_VERTEX] = NULL; /* should not be read */
    ctx->prog[PIPE_SHADER_VERTEX] = vs_uncompiled->xfb;
@@ -3438,7 +3440,8 @@ panfrost_launch_xfb(struct panfrost_batch *batch,
 
    batch->uniform_buffers[PIPE_SHADER_VERTEX] =
       panfrost_emit_const_buf(batch, PIPE_SHADER_VERTEX, NULL,
-                              &batch->push_uniforms[PIPE_SHADER_VERTEX], NULL);
+                              &batch->push_uniforms[PIPE_SHADER_VERTEX],
+                              &batch->nr_push_uniforms[PIPE_SHADER_VERTEX]);
 
 #if PAN_ARCH >= 9
    pan_section_pack(t.cpu, COMPUTE_JOB, PAYLOAD, cfg) {
@@ -3485,6 +3488,7 @@ panfrost_launch_xfb(struct panfrost_batch *batch,
    batch->rsd[PIPE_SHADER_VERTEX] = saved_rsd;
    batch->uniform_buffers[PIPE_SHADER_VERTEX] = saved_ubo;
    batch->push_uniforms[PIPE_SHADER_VERTEX] = saved_push;
+   batch->nr_push_uniforms[PIPE_SHADER_VERTEX] = saved_nr_push_uniforms;
 }
 
 /*

Reply via email to