From 8ac17139b1c9b5f8b017c389a29fd373ecfd9e55 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 5 Mar 2020 11:18:37 +0100 Subject: [PATCH] panfrost: Stop using panfrost_emit_for_draw() for compute jobs 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 Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_compute.c | 4 +++- src/gallium/drivers/panfrost/pan_context.c | 2 +- src/gallium/drivers/panfrost/pan_context.h | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c index d344d86..d05016e 100644 --- a/src/gallium/drivers/panfrost/pan_compute.c +++ b/src/gallium/drivers/panfrost/pan_compute.c @@ -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 */ diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 41eda89..0f2d8b5 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -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) { diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 2bb8120..70a2dc3 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -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 -- 2.7.4