panfrost: Implement rasterizer discard
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 20 Jun 2019 22:25:17 +0000 (15:25 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 21 Jun 2019 16:35:31 +0000 (09:35 -0700)
D'aww, look how cute that is now that scoreboarding is setup.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c

index 6257ffe2ac47ac57a9d6ee8050d4ce94b1fe7a1a..a803a8b68cb5fd38d27f73331ce2179b02be873b 100644 (file)
@@ -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);