[Mesa-dev] [PATCH 12/22] i965: Reduce the assertions in the blitter to an error code

Chris Wilson chris at chris-wilson.co.uk
Sat Aug 5 09:40:04 UTC 2017


Simplify the caller by reporting the incompatible formats rather than
asserting the caller doesn't request sRGB encoding/decoding.
---
 src/mesa/drivers/dri/i965/intel_blit.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 1da37ed730..6db3c37e9d 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -140,14 +140,17 @@ blt_pitch(struct intel_mipmap_tree *mt)
 bool
 intel_miptree_blit_compatible_formats(mesa_format src, mesa_format dst)
 {
-   /* The BLT doesn't handle sRGB conversion */
-   assert(src == _mesa_get_srgb_format_linear(src));
-   assert(dst == _mesa_get_srgb_format_linear(dst));
-
    /* No swizzle or format conversions possible, except... */
    if (src == dst)
       return true;
 
+   /* The BLT doesn't handle sRGB conversion */
+   if (src != _mesa_get_srgb_format_linear(src))
+      return false;
+
+   if (dst != _mesa_get_srgb_format_linear(dst))
+      return false;
+
    /* ...we can either discard the alpha channel when going from A->X,
     * or we can fill the alpha channel with 0xff when going from X->A
     */
-- 
2.13.3



More information about the mesa-dev mailing list