i965/gen9: Support fast clears for 32b float
authorBen Widawsky <benjamin.widawsky@intel.com>
Wed, 14 Oct 2015 03:50:27 +0000 (20:50 -0700)
committerBen Widawsky <benjamin.widawsky@intel.com>
Fri, 20 Nov 2015 19:45:44 +0000 (11:45 -0800)
SKL supports the ability to do fast clears and resolves of 32b RGBA as both
integer and floats. This patch only enables float color clears because we
haven't yet enabled integer color clears, (HW support for that was added in
BDW).

v2: Remove LUMINANCE16F and INTENSITY16F special cases since they are now
handled by Neil's patch to disable MSAA fast clears.

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

index f3c256d11db7e9ed67bf45d0f4ed443f1e5a0c89..499daba3b009b8574186e360f6c0f6af1d6accd2 100644 (file)
@@ -359,8 +359,12 @@ is_color_fast_clear_compatible(struct brw_context *brw,
    }
 
    for (int i = 0; i < 4; i++) {
-      if (color->f[i] != 0.0f && color->f[i] != 1.0f &&
-          _mesa_format_has_color_component(format, i)) {
+      if (!_mesa_format_has_color_component(format, i)) {
+         continue;
+      }
+
+      if (brw->gen < 9 &&
+          color->f[i] != 0.0f && color->f[i] != 1.0f) {
          return false;
       }
    }
index e81b64629f849709a2c0657b3bda7935195f5221..9cdd1c71b4d58f114b5e36b576a6d3d303e11a77 100644 (file)
@@ -188,14 +188,6 @@ gen8_emit_fast_clear_color(struct brw_context *brw,
                            uint32_t *surf)
 {
    if (brw->gen >= 9) {
-#define check_fast_clear_val(x) \
-      assert(mt->gen9_fast_clear_color.f[x] == 0.0 || \
-             mt->gen9_fast_clear_color.f[x] == 1.0)
-      check_fast_clear_val(0);
-      check_fast_clear_val(1);
-      check_fast_clear_val(2);
-      check_fast_clear_val(3);
-#undef check_fast_clear_val
       surf[12] = mt->gen9_fast_clear_color.ui[0];
       surf[13] = mt->gen9_fast_clear_color.ui[1];
       surf[14] = mt->gen9_fast_clear_color.ui[2];