Mesa (master): tu: Advertise COLOR_ATTACHMENT_BLEND_BIT for blendable formats
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu May 14 18:33:37 UTC 2020
Module: Mesa
Branch: master
Commit: f293d02dc44e631a888073a884648543feecbe51
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f293d02dc44e631a888073a884648543feecbe51
Author: Connor Abbott <cwabbott0 at gmail.com>
Date: Thu May 14 12:34:53 2020 +0200
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>
---
src/freedreno/vulkan/tu_formats.c | 7 +++++++
src/freedreno/vulkan/vk_format.h | 6 ++++++
2 files changed, 13 insertions(+)
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)
{
More information about the mesa-commit
mailing list