aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2020-05-14 12:34:53 +0200
committerMarge Bot <[email protected]>2020-05-14 18:15:31 +0000
commitf293d02dc44e631a888073a884648543feecbe51 (patch)
tree29a2a320a7df40bfbc426c53d5845e8d3b5cd532 /src/freedreno/vulkan
parentadbdab3ee80017a4939e9cb586ea85f8c4e7efc9 (diff)
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5039>
Diffstat (limited to 'src/freedreno/vulkan')
-rw-r--r--src/freedreno/vulkan/tu_formats.c7
-rw-r--r--src/freedreno/vulkan/vk_format.h6
2 files changed, 13 insertions, 0 deletions
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
@@ -244,6 +244,12 @@ vk_format_is_srgb(VkFormat 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)
{
return util_format_is_snorm(vk_format_to_pipe_format(format));