panfrost: Stop using panfrost_emit_for_draw() for compute jobs
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 5 Mar 2020 10:18:37 +0000 (11:18 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 10 Mar 2020 11:47:34 +0000 (12:47 +0100)
We actually need a small subset of what's done in
panfrost_emit_for_draw() when emitting compute jobs, so let's copy
what we need directly in panfrost_launch_grid() instead of re-using
this function whose initial purpose was to generate vertex/tiler jobs
for draw operations.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4083>

src/gallium/drivers/panfrost/pan_compute.c
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h

index d344d86..d05016e 100644 (file)
@@ -121,7 +121,9 @@ panfrost_launch_grid(struct pipe_context *pipe,
         if (info->input)
                 pipe->set_constant_buffer(pipe, PIPE_SHADER_COMPUTE, 0, &ubuf);
 
-        panfrost_emit_for_draw(ctx, false);
+        panfrost_patch_shader_state(ctx, PIPE_SHADER_COMPUTE);
+        panfrost_emit_shader_meta(batch, PIPE_SHADER_COMPUTE, payload);
+        panfrost_emit_const_buf(batch, PIPE_SHADER_COMPUTE, payload);
         panfrost_emit_shared_memory(batch, info, payload);
 
         /* Invoke according to the grid info */
index 41eda89..0f2d8b5 100644 (file)
@@ -505,7 +505,7 @@ panfrost_ubo_count(struct panfrost_context *ctx, enum pipe_shader_type stage)
 
 /* Fixes up a shader state with current state */
 
-static void
+void
 panfrost_patch_shader_state(struct panfrost_context *ctx,
                             enum pipe_shader_type stage)
 {
index 2bb8120..70a2dc3 100644 (file)
@@ -294,6 +294,10 @@ bool
 panfrost_writes_point_size(struct panfrost_context *ctx);
 
 void
+panfrost_patch_shader_state(struct panfrost_context *ctx,
+                            enum pipe_shader_type stage);
+
+void
 panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data);
 
 struct panfrost_transfer