From 6a8c51dc5a4b5f802967b70c5869d48a26c61555 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 1 Mar 2021 14:53:50 -0500 Subject: [PATCH] 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 Part-of: --- 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.