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

Author: Boris Brezillon <[email protected]>
Date:   Thu Oct  5 10:29:04 2023 +0200

panfrost: Emit image attribs for compute in panfrost_update_shader_state()

This will make the job-frontend split easier, and it also makes sense
to update image attributes here for compute.

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Erik Faye-Lund <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c 
b/src/gallium/drivers/panfrost/pan_cmdstream.c
index a018d6c0e41..5c565c2a411 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -2894,7 +2894,10 @@ panfrost_update_shader_state(struct panfrost_batch 
*batch,
       batch->rsd[st] = panfrost_emit_frag_shader_meta(batch);
    }
 
-   if (frag && (dirty & PAN_DIRTY_STAGE_IMAGE)) {
+   /* Vertex shaders need to mix vertex data and image descriptors in the
+    * attribute array. This is taken care of in panfrost_update_state_3d().
+    */
+   if (st != PIPE_SHADER_VERTEX && (dirty & PAN_DIRTY_STAGE_IMAGE)) {
       batch->attribs[st] =
          panfrost_emit_image_attribs(batch, &batch->attrib_bufs[st], st);
    }
@@ -3824,8 +3827,8 @@ panfrost_launch_grid_on_batch(struct pipe_context *pipe,
 
    pan_section_pack(t.cpu, COMPUTE_JOB, DRAW, cfg) {
       cfg.state = batch->rsd[PIPE_SHADER_COMPUTE];
-      cfg.attributes = panfrost_emit_image_attribs(
-         batch, &cfg.attribute_buffers, PIPE_SHADER_COMPUTE);
+      cfg.attributes = batch->attribs[PIPE_SHADER_COMPUTE];
+      cfg.attribute_buffers = batch->attrib_bufs[PIPE_SHADER_COMPUTE];
       cfg.thread_storage = panfrost_emit_shared_memory(batch, info);
       cfg.uniform_buffers = batch->uniform_buffers[PIPE_SHADER_COMPUTE];
       cfg.push_uniforms = batch->push_uniforms[PIPE_SHADER_COMPUTE];

Reply via email to