Mesa (main): anv: Require transfer features for transfer usages
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Nov 30 14:06:56 UTC 2021
Module: Mesa
Branch: main
Commit: bdf8b36c4cf0b4ea4f234b4b4f4ba80d10a8586e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bdf8b36c4cf0b4ea4f234b4b4f4ba80d10a8586e
Author: Nanley Chery <nanley.g.chery at intel.com>
Date: Fri Nov 12 13:36:20 2021 -0500
anv: Require transfer features for transfer usages
In order for an image to support the transfer usage, require that its
format can be used for blits or copies.
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13881>
---
src/intel/vulkan/anv_formats.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index a43e06c8443..82bd618d183 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -1110,12 +1110,16 @@ anv_get_image_format_properties(
sampleCounts = isl_device_get_sample_counts(&physical_device->isl_dev);
}
- if (info->usage & (VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
- VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
- /* Accept transfers on anything we can sample from or renderer to. */
- if (!(format_feature_flags & (VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR |
- VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR |
- VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR))) {
+ if (info->usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
+ if (!(format_feature_flags & (VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR |
+ VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR))) {
+ goto unsupported;
+ }
+ }
+
+ if (info->usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
+ if (!(format_feature_flags & (VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR |
+ VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR))) {
goto unsupported;
}
}
More information about the mesa-commit
mailing list