From: Kenneth Graunke Date: Fri, 22 Feb 2019 07:37:58 +0000 (-0800) Subject: iris: Properly allow rendering to RGBX formats. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b45186a6cd0ed7539e427d4443671faef9f95058;p=mesa.git iris: Properly allow rendering to RGBX formats. I was converting them at pipe_surface creation time, but not when answering queries about whether formats support rendering. This caused a lot of FBO incomplete errors for formats that ought to be supported. Fixes "Child of Light", which uses PIPE_FORMAT_R8G8B8X8_UNORM_SRGB. Also fixes Witcher 1 using wined3d (GL) according to Timur Kristóf. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109738 --- diff --git a/src/gallium/drivers/iris/iris_formats.c b/src/gallium/drivers/iris/iris_formats.c index 8a53bc19f3f..c160d19f4ea 100644 --- a/src/gallium/drivers/iris/iris_formats.c +++ b/src/gallium/drivers/iris/iris_formats.c @@ -427,9 +427,16 @@ iris_is_format_supported(struct pipe_screen *pscreen, } if (usage & PIPE_BIND_RENDER_TARGET) { - supported &= isl_format_supports_rendering(devinfo, format); + enum isl_format rt_format = format; + + if (isl_format_is_rgbx(format) && + !isl_format_supports_rendering(devinfo, format)) + rt_format = isl_format_rgbx_to_rgba(format); + + supported &= isl_format_supports_rendering(devinfo, rt_format); + if (!is_integer) - supported &= isl_format_supports_alpha_blending(devinfo, format); + supported &= isl_format_supports_alpha_blending(devinfo, rt_format); } if (usage & PIPE_BIND_SHADER_IMAGE) {