aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-18 13:37:16 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-03 14:33:46 -0700
commit0a88aa3025db0cc5a68222c7939d7da4d218f1be (patch)
tree21cce7a0ffe7008e87622b5d9d787aa463925037 /src/mesa
parent8845a23698c98c8b377b3a451d13bde4c1bc5a70 (diff)
mesa/st: Passthrough scissor when clearing by quad
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 3a49bd4d6c1..0a2a4bf1b25 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -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 */