{
VkImageFormatProperties imageFormatProperties;
- if (VK_ERROR_FORMAT_NOT_SUPPORTED == vk.getPhysicalDeviceImageFormatProperties(physicalDevice, m_parameters.formatUncompressed,
- mapImageType(m_parameters.imageType), VK_IMAGE_TILING_OPTIMAL,
- m_parameters.uncompressedImageUsage, 0u, &imageFormatProperties))
+ if (vk.getPhysicalDeviceImageFormatProperties(physicalDevice, m_parameters.formatUncompressed,
+ mapImageType(m_parameters.imageType), VK_IMAGE_TILING_OPTIMAL,
+ m_parameters.uncompressedImageUsage, 0u, &imageFormatProperties) == VK_ERROR_FORMAT_NOT_SUPPORTED)
TCU_THROW(NotSupportedError, "Operation not supported with this image format");
- if (vk.getPhysicalDeviceImageFormatProperties(physicalDevice, m_parameters.formatCompressed,
- mapImageType(m_parameters.imageType), VK_IMAGE_TILING_OPTIMAL,
- m_parameters.compressedImageUsage,
- VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR,
- &imageFormatProperties) == VK_ERROR_FORMAT_NOT_SUPPORTED)
+ if (VK_ERROR_FORMAT_NOT_SUPPORTED == vk.getPhysicalDeviceImageFormatProperties(physicalDevice, m_parameters.formatCompressed,
+ mapImageType(m_parameters.imageType), VK_IMAGE_TILING_OPTIMAL,
+ m_parameters.compressedImageUsage,
+ VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR,
+ &imageFormatProperties))
TCU_THROW(NotSupportedError, "Operation not supported with this image format");
}
const InstanceDriver& vki = instHelper.vki;
const VkDevice device = *devHelper.device;
const VkPhysicalDevice physDevice = devHelper.physicalDevice;
+ SimpleAllocator allocator(vk, device, getPhysicalDeviceMemoryProperties(vki, context.getPhysicalDevice()));
- SimpleAllocator allocator(vk, device, getPhysicalDeviceMemoryProperties(vki, context.getPhysicalDevice()));
-
- // Check required features on the format for the required upload/download methods
- VkFormatProperties imageFormatProps, viewFormatProps;
- vki.getPhysicalDeviceFormatProperties(physDevice, caseDef.imageFormat, &imageFormatProps);
- vki.getPhysicalDeviceFormatProperties(physDevice, caseDef.viewFormat, &viewFormatProps);
-
- const VkImageUsageFlags imageUsage = getImageUsageForTestCase(caseDef);
+ const VkImageUsageFlags imageUsage = getImageUsageForTestCase(caseDef);
- const VkSurfaceCapabilitiesKHR capabilities = getPhysicalDeviceSurfaceCapabilities(vki,
- physDevice,
- *surface);
+ {
+ VkImageFormatProperties properties;
+ VkResult result;
+
+ result = vki.getPhysicalDeviceImageFormatProperties(physDevice, caseDef.imageFormat, getImageType(caseDef.imageType), VK_IMAGE_TILING_OPTIMAL, imageUsage, 0, &properties);
+
+ if (result == VK_ERROR_FORMAT_NOT_SUPPORTED)
+ {
+ TCU_THROW(NotSupportedError, "Image format is not supported for required usage");
+ }
+
+ result = vki.getPhysicalDeviceImageFormatProperties(physDevice, caseDef.viewFormat, getImageType(caseDef.imageType), VK_IMAGE_TILING_OPTIMAL, imageUsage, 0, &properties);
+
+ if (result == VK_ERROR_FORMAT_NOT_SUPPORTED)
+ {
+ TCU_THROW(NotSupportedError, "Image view format is not supported for required usage");
+ }
+ }
+
+ const VkSurfaceCapabilitiesKHR capabilities = getPhysicalDeviceSurfaceCapabilities(vki,
+ physDevice,
+ *surface);
if (caseDef.numLayers > capabilities.maxImageArrayLayers)
caseDef.numLayers = capabilities.maxImageArrayLayers;