From: Connor Abbott Date: Thu, 14 May 2020 10:34:53 +0000 (+0200) Subject: tu: Advertise COLOR_ATTACHMENT_BLEND_BIT for blendable formats X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f293d02dc44e631a888073a884648543feecbe51;p=mesa.git tu: Advertise COLOR_ATTACHMENT_BLEND_BIT for blendable formats 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: --- diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c index 24f7f246e36..8ae18433826 100644 --- a/src/freedreno/vulkan/tu_formats.c +++ b/src/freedreno/vulkan/tu_formats.c @@ -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 diff --git a/src/freedreno/vulkan/vk_format.h b/src/freedreno/vulkan/vk_format.h index a9b7f1b4a31..7b041b60625 100644 --- a/src/freedreno/vulkan/vk_format.h +++ b/src/freedreno/vulkan/vk_format.h @@ -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) {