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 <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
3a9b7692f1
commit
9865b79a88
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue