[Mesa-dev] [PATCH 17/32] i965/blorp: Don't clear an empty region

Jason Ekstrand jason at jlekstrand.net
Thu Aug 11 21:15:14 UTC 2016


---
 src/mesa/drivers/dri/i965/brw_blorp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index f12c1f8..ccc7136 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -582,6 +582,10 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
       y1 = rb->Height - fb->_Ymin;
    }
 
+   /* If the clear region is empty, just return. */
+   if (x0 == x1 || y0 == y1)
+      return true;
+
    bool can_fast_clear = !partial_clear;
 
    bool color_write_disable[4] = { false, false, false, false };
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list