Module: Mesa
Branch: master
Commit: 0033c8134401cd4c42845a8e33c001ec62612015
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0033c8134401cd4c42845a8e33c001ec62612015

Author: Neil Roberts <n...@linux.intel.com>
Date:   Tue Nov 24 16:34:46 2015 +0100

i965/gen9: Allow fast clears for non-MSRT SRGB buffers

SRGB buffers are not marked as losslessly compressible so previously
they would not be used for fast clears. However in practice the
hardware will never actually see that we are using SRGB buffers for
fast clears if we use the linear equivalent format when clearing and
make sure to resolve the buffer as a linear format before sampling
from it.

This is an important use case because by default the window system
framebuffers are created as SRGB so without this fast clears won't be
used there.

Reviewed-by: Topi Pohjolainen <topi.pohjolai...@intel.com>

---

 src/mesa/drivers/dri/i965/intel_mipmap_tree.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 87e0136..88c0a19 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -259,7 +259,8 @@ intel_miptree_supports_non_msrt_fast_clear(struct 
brw_context *brw,
       return false;
 
    if (brw->gen >= 9) {
-      const uint32_t brw_format = brw_format_for_mesa_format(mt->format);
+      mesa_format linear_format = _mesa_get_srgb_format_linear(mt->format);
+      const uint32_t brw_format = brw_format_for_mesa_format(linear_format);
       return brw_losslessly_compressible_format(brw, brw_format);
    } else
       return true;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to