Mesa (master): mesa/st: no-op scissored clear calls with size zero
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Mar 1 20:42:13 UTC 2021
Module: Mesa
Branch: master
Commit: 6a8c51dc5a4b5f802967b70c5869d48a26c61555
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a8c51dc5a4b5f802967b70c5869d48a26c61555
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Mon Mar 1 14:53:50 2021 -0500
mesa/st: no-op scissored clear calls with size zero
Wx0 and 0xH should result in no-ops in the driver, so they can just
become no-ops before they reach the driver to save some validation later
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9344>
---
src/mesa/state_tracker/st_cb_clear.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 28ce51a936f..87b664c201a 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -542,6 +542,9 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
const struct gl_framebuffer *fb = ctx->DrawBuffer;
scissor_state.maxx = MIN2(scissor_state.maxx, fb->Width);
scissor_state.maxy = MIN2(scissor_state.maxy, fb->Height);
+ if (scissor_state.minx == scissor_state.maxx ||
+ scissor_state.miny == scissor_state.maxy)
+ return;
}
/* We can't translate the clear color to the colorbuffer format,
* because different colorbuffers may have different formats.
More information about the mesa-commit
mailing list