Commit 57378335 by Chris Forbes

Produce correct error result for unsupported formats

vkGetPhysicalDeviceImageFormatProperties is required to return VK_ERROR_FORMAT_NOT_SUPPORTED when the format is not supported. CTS (validly) assumes that the format /is/ supported if this function returns VK_SUCCESS. Bug: b/119620767 Change-Id: I1f7d3ff8dbbfbc2dd100af7c3c4d7204f350dd06 Reviewed-on: https://swiftshader-review.googlesource.com/c/23668Reviewed-by: 's avatarCorentin Wallez <cwallez@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 4252891a
......@@ -152,6 +152,23 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysic
TRACE("(VkPhysicalDevice physicalDevice = 0x%X, VkFormat format = %d, VkImageType type = %d, VkImageTiling tiling = %d, VkImageUsageFlags usage = %d, VkImageCreateFlags flags = %d, VkImageFormatProperties* pImageFormatProperties = 0x%X)",
physicalDevice, (int)format, (int)type, (int)tiling, usage, flags, pImageFormatProperties);
VkFormatProperties properties;
vk::Cast(physicalDevice)->getFormatProperties(format, &properties);
switch (tiling)
{
case VK_IMAGE_TILING_LINEAR:
if (properties.linearTilingFeatures == 0) return VK_ERROR_FORMAT_NOT_SUPPORTED;
break;
case VK_IMAGE_TILING_OPTIMAL:
if (properties.optimalTilingFeatures == 0) return VK_ERROR_FORMAT_NOT_SUPPORTED;
break;
default:
UNIMPLEMENTED();
}
vk::Cast(physicalDevice)->getImageFormatProperties(format, type, tiling, usage, flags, pImageFormatProperties);
return VK_SUCCESS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment