From ac51cc12b1d1ccc8fa6e91616b5d94908450eee9 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 19 Jul 2023 08:42:35 -0400 Subject: [PATCH] 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 Part-of: --- 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 185b2f9..4779b26 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; } /* -- 2.7.4