From: Boris Brezillon Date: Thu, 5 Mar 2020 10:18:37 +0000 (+0100) Subject: panfrost: Stop using panfrost_emit_for_draw() for compute jobs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ac17139b1c9b5f8b017c389a29fd373ecfd9e55;p=mesa.git 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: --- diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c index d344d862243..d05016e9359 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 41eda89d8fb..0f2d8b5a728 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 2bb81203f15..70a2dc3cbbc 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -293,6 +293,10 @@ panfrost_invalidate_frame(struct panfrost_context *ctx); 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);