i965/meta: Assert fast clears and rep clears never overlap
authorBen Widawsky <benjamin.widawsky@intel.com>
Wed, 14 Oct 2015 03:50:25 +0000 (20:50 -0700)
committerBen Widawsky <benjamin.widawsky@intel.com>
Wed, 4 Nov 2015 05:54:11 +0000 (21:54 -0800)
There is nothing wrong with the code today, but as one modifies the code it
turns out to be not too difficult to mess up the code, and this easy assertion
should catch such driver implementation failures quickly.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
src/mesa/drivers/dri/i965/brw_meta_fast_clear.c

index fbde3f0..69fe7b4 100644 (file)
@@ -536,6 +536,8 @@ brw_meta_fast_clear(struct brw_context *brw, struct gl_framebuffer *fb,
       }
    }
 
+   assert((fast_clear_buffers & rep_clear_buffers) == 0);
+
    if (!(fast_clear_buffers | rep_clear_buffers)) {
       if (plain_clear_buffers)
          /* If we only have plain clears, skip the meta save/restore. */