panfrost: Simplify panfrost_emit_for_draw() and make it private
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 5 Mar 2020 10:23:41 +0000 (11:23 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 10 Mar 2020 11:47:34 +0000 (12:47 +0100)
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 <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_context.c
src/gallium/drivers/panfrost/pan_context.h

index 0f2d8b5a72870ca994f7f2f16a8a649dd867d137..3932e11ccfccfb39eb9876c10d33d189943b3e78 100644 (file)
@@ -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 */
 
index 70a2dc3cbbc5c66b1a47aea6b480f8fcc49d5a16..768e1cd30df1b0820c297e3a32edb146da7e55b2 100644 (file)
@@ -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);