tu: Advertise COLOR_ATTACHMENT_BLEND_BIT for blendable formats
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 14 May 2020 10:34:53 +0000 (12:34 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 14 May 2020 18:15:31 +0000 (18:15 +0000)
Whoops. After fixing dual-source blending, dEQP-VK.pipeline.blend.* all
go from skipped to pass, and fixes a bunch of
dEQP-VK.api.info.format_properties.* tests where blending is required.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5039>

src/freedreno/vulkan/tu_formats.c
src/freedreno/vulkan/vk_format.h

index 24f7f246e367eb25c47bc79804b4f63c59e84bb4..8ae18433826e0a50ff6e4e6cbcf078bc6f98154b 100644 (file)
@@ -395,6 +395,13 @@ tu_physical_device_get_format_properties(
       optimal |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
                  VK_FORMAT_FEATURE_BLIT_SRC_BIT |
                  VK_FORMAT_FEATURE_BLIT_DST_BIT;
+
+      if (vk_format_is_float(format) ||
+          vk_format_is_unorm(format) ||
+          vk_format_is_snorm(format) ||
+          vk_format_is_srgb(format)) {
+         optimal |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
+      }
    }
 
    /* For the most part, we can do anything with a linear image that we could
index a9b7f1b4a3176c6aaf4571bcef72ca44dcfdc31b..7b041b60625cd59c0b5135990e0701c57cf425e8 100644 (file)
@@ -243,6 +243,12 @@ vk_format_is_srgb(VkFormat format)
    return util_format_is_srgb(vk_format_to_pipe_format(format));
 }
 
+static inline bool
+vk_format_is_unorm(VkFormat format)
+{
+   return util_format_is_unorm(vk_format_to_pipe_format(format));
+}
+
 static inline bool
 vk_format_is_snorm(VkFormat format)
 {