Mesa (staging/18.1): radv: Add missing checks in radv_get_image_format_properties.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 30 15:34:19 UTC 2018


Module: Mesa
Branch: staging/18.1
Commit: 8c3aee4038bb72a0bf87fed52e59dcf798c199e5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c3aee4038bb72a0bf87fed52e59dcf798c199e5

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Wed Aug 29 17:04:25 2018 +0200

radv: Add missing checks in radv_get_image_format_properties.

CC: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
(cherry picked from commit 4738b6ac81422ad4498dc6554dae9d0170fcefc7)

---

 src/amd/vulkan/radv_formats.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index 2480ef0f9d..77ef222b98 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -1180,6 +1180,25 @@ static VkResult radv_get_image_format_properties(struct radv_physical_device *ph
 		}
 	}
 
+	if (info->usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
+		if (!(format_feature_flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT)) {
+			goto unsupported;
+		}
+	}
+
+	if (info->usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
+		if (!(format_feature_flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT)) {
+			goto unsupported;
+		}
+	}
+
+	if (info->usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
+		if (!(format_feature_flags & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
+		                              VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))) {
+			goto unsupported;
+		}
+	}
+
 	*pImageFormatProperties = (VkImageFormatProperties) {
 		.maxExtent = maxExtent,
 		.maxMipLevels = maxMipLevels,




More information about the mesa-commit mailing list