mesa/st: even better no-oping for clears
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 1 Mar 2021 21:57:35 +0000 (16:57 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Mar 2021 22:42:30 +0000 (22:42 +0000)
<imirkin> zmike: re 6a8c51dc5a4 -- couldn't minx be > maxx after the clamping? in nouveau i did >= for the bail condition

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9350>

src/mesa/state_tracker/st_cb_clear.c

index 87b664c..729e244 100644 (file)
@@ -542,8 +542,8 @@ 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)
+         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,