i965/blorp: Don't clear an empty region
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 8 Aug 2016 19:10:26 +0000 (12:10 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 19 Aug 2016 10:11:29 +0000 (03:11 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_blorp.c

index 8650cc41be2258af313bed5b5eb2c1e080be9f26..f4c2740f6c18da6993f1856dd319e1b5e2e7dedc 100644 (file)
@@ -591,6 +591,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 };