[Mesa-dev] [PATCH] i965/skl: Disable fast clear for formats without alpha

Ben Widawsky benjamin.widawsky at intel.com
Thu Nov 12 13:49:51 PST 2015


---

Here is one proposal to fix the issue. I noticed that only formats without alpha
were failing. This sucks for RGBX formats (which technically aren't fast
clearable based on the surface format). The hunk for moving the format should
happen regardless of this patch.

Neil has another patch which attempts to not disable formats, and workaround the
hardware issue that we cannot explain. I just wanted to put this on the list.

---
 src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
index a024d02..06ccc16 100644
--- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
@@ -359,6 +359,11 @@ is_color_fast_clear_compatible(struct brw_context *brw,
       return false;
    }
 
+   if (brw->gen >= 9 &&
+       (!_mesa_get_format_bits(format, GL_ALPHA_BITS) ||
+       format == MESA_FORMAT_L_FLOAT16 || format == MESA_FORMAT_I_FLOAT16))
+      return false;
+
    for (int i = 0; i < 4; i++) {
       if (!_mesa_format_has_color_component(format, i)) {
          continue;
@@ -369,9 +374,6 @@ is_color_fast_clear_compatible(struct brw_context *brw,
          return false;
       }
 
-      if (format == MESA_FORMAT_L_FLOAT16 ||
-          format == MESA_FORMAT_I_FLOAT16)
-         return false;
    }
    return true;
 }
-- 
2.6.2



More information about the mesa-dev mailing list