diff options
author | Bas Nieuwenhuizen <[email protected]> | 2018-08-29 17:04:25 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2018-08-30 01:21:20 +0200 |
commit | 4738b6ac81422ad4498dc6554dae9d0170fcefc7 (patch) | |
tree | e685481850dca425b9194e6983bca4eb08d8a343 /src/amd | |
parent | bb17ae49ee2591a4a35479ed6e48cb3c18422e2a (diff) |
radv: Add missing checks in radv_get_image_format_properties.
CC: <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_formats.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c index f0cc0fc5f95..6253c27b95d 100644 --- a/src/amd/vulkan/radv_formats.c +++ b/src/amd/vulkan/radv_formats.c @@ -1112,6 +1112,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, |