mesa/st: Passthrough scissor when clearing by quad
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 18 Jun 2019 20:37:16 +0000 (13:37 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 3 Jul 2019 21:33:46 +0000 (14:33 -0700)
The scissor state -is- setup, but the scissor test is not enabled. This
can prevent certain optimizations from occurring on tilers where
unaffected tiles are thrown out entirely.

v2: Only enable scissor test if the scissor test is actually set by the
app, to avoid regressing quad-based clears used for other reasons (like
a color mask).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_clear.c

index 3a49bd4d6c1c65138533663345f5e3a864a46c4d..0a2a4bf1b25481c00051f51096ca984f03036b98 100644 (file)
@@ -323,6 +323,9 @@ clear_with_quad(struct gl_context *ctx, unsigned clear_buffers)
    cso_set_stream_outputs(cso, 0, NULL, NULL);
    cso_set_sample_mask(cso, ~0);
    cso_set_min_samples(cso, 1);
+
+   /* set scissor if necessary to allow optimization */
+   st->clear.raster.scissor = ctx->Scissor.EnableFlags & 1;
    cso_set_rasterizer(cso, &st->clear.raster);
 
    /* viewport state: viewport matching window dims */