summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-17 09:26:34 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-17 09:29:09 -0700
commit9865b79a882e6eb9bc38427bcff199da3d787b66 (patch)
tree3f5165945ac48686d9a8bc4112dbf75d4722a84a /src/gallium
parent3a9b7692f1aecad3947fd2d4f8c3d2a947a16335 (diff)
panfrost: Drop draws with complete scissor
The hardware support for scissoring requires minimally 1 pixel to be drawn. If the scissor culls *everything*, we need to drop the draw entirely early on. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/panfrost/ci/expected-failures.txt4
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c20
2 files changed, 20 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/ci/expected-failures.txt b/src/gallium/drivers/panfrost/ci/expected-failures.txt
index 8bfe988e99c..66ca0507cc3 100644
--- a/src/gallium/drivers/panfrost/ci/expected-failures.txt
+++ b/src/gallium/drivers/panfrost/ci/expected-failures.txt
@@ -285,10 +285,6 @@ dEQP-GLES2.functional.fragment_ops.random.96
dEQP-GLES2.functional.fragment_ops.random.97
dEQP-GLES2.functional.fragment_ops.random.98
dEQP-GLES2.functional.fragment_ops.random.99
-dEQP-GLES2.functional.fragment_ops.scissor.clear_color
-dEQP-GLES2.functional.fragment_ops.scissor.outside_render_line
-dEQP-GLES2.functional.fragment_ops.scissor.outside_render_point
-dEQP-GLES2.functional.fragment_ops.scissor.outside_render_tri
dEQP-GLES2.functional.lifetime.attach.deleted_output.renderbuffer_framebuffer
dEQP-GLES2.functional.lifetime.attach.deleted_output.texture_framebuffer
dEQP-GLES2.functional.negative_api.shader.uniform_matrixfv_invalid_transpose
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 7ad20a80fb1..f7033006494 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1569,6 +1569,19 @@ panfrost_get_index_buffer_mapped(struct panfrost_context *ctx, const struct pipe
}
}
+static bool
+panfrost_scissor_culls_everything(struct panfrost_context *ctx)
+{
+ const struct pipe_scissor_state *ss = &ctx->scissor;
+
+ /* Check if we're scissoring at all */
+
+ if (!(ss && ctx->rasterizer && ctx->rasterizer->base.scissor))
+ return false;
+
+ return (ss->minx == ss->maxx) && (ss->miny == ss->maxy);
+}
+
static void
panfrost_draw_vbo(
struct pipe_context *pipe,
@@ -1576,6 +1589,13 @@ panfrost_draw_vbo(
{
struct panfrost_context *ctx = pan_context(pipe);
+ /* First of all, check the scissor to see if anything is drawn at all.
+ * If it's not, we drop the draw (mostly a conformance issue;
+ * well-behaved apps shouldn't hit this) */
+
+ if (panfrost_scissor_culls_everything(ctx))
+ return;
+
ctx->payload_vertex.draw_start = info->start;
ctx->payload_tiler.draw_start = info->start;