Mesa (master): panfrost: Implement rasterizer discard

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 21 16:35:58 UTC 2019


Module: Mesa
Branch: master
Commit: cd5d618b5ccf1ff847de4d0203830f9ad81862c7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd5d618b5ccf1ff847de4d0203830f9ad81862c7

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu Jun 20 15:25:17 2019 -0700

panfrost: Implement rasterizer discard

D'aww, look how cute that is now that scoreboarding is setup.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/gallium/drivers/panfrost/pan_context.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 6257ffe2ac4..a803a8b68cb 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1338,12 +1338,22 @@ panfrost_queue_draw(struct panfrost_context *ctx)
         /* Handle dirty flags now */
         panfrost_emit_for_draw(ctx, true);
 
+        /* If rasterizer discard is enable, only submit the vertex */
+
+        bool rasterizer_discard = ctx->rasterizer
+                && ctx->rasterizer->base.rasterizer_discard;
+
         struct panfrost_transfer vertex = panfrost_vertex_tiler_job(ctx, false);
-        struct panfrost_transfer tiler = panfrost_vertex_tiler_job(ctx, true);
+        struct panfrost_transfer tiler;
+
+        if (!rasterizer_discard)
+                tiler = panfrost_vertex_tiler_job(ctx, true);
 
         struct panfrost_job *batch = panfrost_get_job_for_fbo(ctx);
 
-        if (ctx->wallpaper_batch)
+        if (rasterizer_discard)
+                panfrost_scoreboard_queue_vertex_job(batch, vertex, FALSE);
+        else if (ctx->wallpaper_batch)
                 panfrost_scoreboard_queue_fused_job_prepend(batch, vertex, tiler);
         else
                 panfrost_scoreboard_queue_fused_job(batch, vertex, tiler);




More information about the mesa-commit mailing list