iris: Check for zero in clear color compatibility fn
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 14 Dec 2022 00:30:01 +0000 (16:30 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 15 Dec 2022 21:20:37 +0000 (21:20 +0000)
Both formats may interpret the clear color as zero.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20320>

src/gallium/drivers/iris/iris_resolve.c

index 2e17e48..f00731a 100644 (file)
@@ -1129,6 +1129,13 @@ iris_render_formats_color_compatible(enum isl_format a, enum isl_format b,
       return true;
    }
 
+   /* Both formats may interpret the clear color as zero. */
+   if (!clear_color_unknown &&
+       isl_color_value_is_zero(color, a) &&
+       isl_color_value_is_zero(color, b)) {
+      return true;
+   }
+
    return false;
 }