From 5f043cc7766fc506f8de88d38cf9b60d7a47afbf Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 5 Mar 2020 11:23:41 +0100 Subject: [PATCH] panfrost: Simplify panfrost_emit_for_draw() and make it private Now that panfrost_launch_grid() no longer calls panfrost_emit_for_draw(), we can keep it private to pan_context.c and drop all compute-related stuff. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 24 ++++++++-------------- src/gallium/drivers/panfrost/pan_context.h | 3 --- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 0f2d8b5a728..3932e11ccfc 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -525,25 +525,22 @@ panfrost_patch_shader_state(struct panfrost_context *ctx, /* Go through dirty flags and actualise them in the cmdstream. */ -void -panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data) +static void +panfrost_emit_for_draw(struct panfrost_context *ctx) { struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx); struct panfrost_screen *screen = pan_screen(ctx->base.screen); panfrost_batch_add_fbo_bos(batch); - for (int i = 0; i < PIPE_SHADER_TYPES; ++i) + for (int i = 0; i <= PIPE_SHADER_FRAGMENT; ++i) panfrost_vt_attach_framebuffer(ctx, &ctx->payloads[i]); - if (with_vertex_data) { - panfrost_emit_vertex_data(batch); - - /* Varyings emitted for -all- geometry */ - unsigned total_count = ctx->padded_count * ctx->instance_count; - panfrost_emit_varying_descriptor(ctx, total_count); - } + panfrost_emit_vertex_data(batch); + /* Varyings emitted for -all- geometry */ + unsigned total_count = ctx->padded_count * ctx->instance_count; + panfrost_emit_varying_descriptor(ctx, total_count); if (ctx->rasterizer) { bool msaa = ctx->rasterizer->base.multisample; @@ -564,9 +561,6 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data) panfrost_patch_shader_state(ctx, PIPE_SHADER_VERTEX); panfrost_emit_shader_meta(batch, PIPE_SHADER_VERTEX, &ctx->payloads[PIPE_SHADER_VERTEX]); - panfrost_patch_shader_state(ctx, PIPE_SHADER_COMPUTE); - panfrost_emit_shader_meta(batch, PIPE_SHADER_COMPUTE, - &ctx->payloads[PIPE_SHADER_COMPUTE]); if (ctx->shader[PIPE_SHADER_VERTEX] && ctx->shader[PIPE_SHADER_FRAGMENT]) { /* Check if we need to link the gl_PointSize varying */ @@ -734,7 +728,7 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data) panfrost_upload_sampler_descriptors(ctx); panfrost_upload_texture_descriptors(ctx); - for (int i = 0; i < PIPE_SHADER_TYPES; ++i) + for (int i = 0; i <= PIPE_SHADER_FRAGMENT; ++i) panfrost_emit_const_buf(batch, i, &ctx->payloads[i]); /* TODO: Upload the viewport somewhere more appropriate */ @@ -748,7 +742,7 @@ static void panfrost_queue_draw(struct panfrost_context *ctx) { /* Handle dirty flags now */ - panfrost_emit_for_draw(ctx, true); + panfrost_emit_for_draw(ctx); /* If rasterizer discard is enable, only submit the vertex */ diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 70a2dc3cbbc..768e1cd30df 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -297,9 +297,6 @@ 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 panfrost_vertex_tiler_job(struct panfrost_context *ctx, bool is_tiler); -- 2.30.2