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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9344>
This commit is contained in:
Mike Blumenkrantz 2021-03-01 14:53:50 -05:00 committed by Marge Bot
parent c5e72eb09d
commit 6a8c51dc5a
1 changed files with 3 additions and 0 deletions

View File

@ -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.