summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2020-03-24 10:35:05 +0100
committerMarge Bot <eric+marge@anholt.net>2020-10-13 21:21:28 +0000
commitcfc0e15b9bdc5cde158083c04de3e9b7ec1e9e60 (patch)
tree0afd6246de35f7aed6be43d0b8158ee665b503f2
parent19841fd5502b0b69f97ab11738b81f6732fce2b8 (diff)
v3dv: make sure we only expose transfer features for formats we can use
We were already doing this, but this makes it more explicit. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
-rw-r--r--src/broadcom/vulkan/v3dv_formats.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/broadcom/vulkan/v3dv_formats.c b/src/broadcom/vulkan/v3dv_formats.c
index 0d1faafecb3..d48fe551e5e 100644
--- a/src/broadcom/vulkan/v3dv_formats.c
+++ b/src/broadcom/vulkan/v3dv_formats.c
@@ -351,8 +351,7 @@ image_format_features(VkFormat vk_format,
return 0;
}
- VkFormatFeatureFlags flags = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
- VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
+ VkFormatFeatureFlags flags = 0;
if (v3dv_format->tex_type != TEXTURE_DATA_FORMAT_NO) {
flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
@@ -381,6 +380,11 @@ image_format_features(VkFormat vk_format,
flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT;
}
+ if (flags) {
+ flags |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
+ VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
+ }
+
return flags;
}