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

2015-11-13 Thread Neil Roberts
Ben Widawsky  writes:

> 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.

If we do this we could limit it to just multisample buffers. I think the
problem only happens when sampling the cleared texels but we effectively
never do that for single-sampled surfaces because in that case we always
do a resolve before using them as textures. Being able to fast clear a
single-sampled RGBX window system buffer is probably one of the more
useful use cases so it's probably worth allowing that.

We could also remove the explicit check the those two FLOAT16 formats in
that case because neither of them have alpha bits.

> 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.

If anyone's interested, the patch is here:

https://github.com/bpeel/mesa/commit/2c7b2ddc8dba388665c258a1182

Obviously I'm not suggesting we merge that patch because it's a massive
kludge.

The test case which we're using to find these issues is here:

http://patchwork.freedesktop.org/patch/64578/

- Neil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2015-11-12 Thread Ben Widawsky
---

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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev