case UPLOAD_STORE:
viewFormatFeatureFlags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
break;
+ case UPLOAD_CLEAR:
+ viewFormatFeatureFlags |= VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
+ break;
+ case UPLOAD_COPY:
+ viewFormatFeatureFlags |= VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
+ break;
default:
DE_FATAL("Invalid upload method");
break;
case DOWNLOAD_LOAD:
viewFormatFeatureFlags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
break;
+ case DOWNLOAD_COPY:
+ viewFormatFeatureFlags |= VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
+ break;
default:
DE_FATAL("Invalid download method");
break;
if ((viewFormatProps.optimalTilingFeatures & viewFormatFeatureFlags) != viewFormatFeatureFlags)
TCU_THROW(NotSupportedError, "View format doesn't support upload/download method");
+ const bool haveMaintenance2 = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2");
+
// We don't use the base image for anything other than transfer
// operations so there are no features to check. However, The Vulkan
// 1.0 spec does not allow us to create an image view with usage that
// is not supported by the main format. With VK_KHR_maintenance2, we
// can do this via VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR.
if ((imageFormatProps.optimalTilingFeatures & viewFormatFeatureFlags) != viewFormatFeatureFlags &&
- !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"))
+ !haveMaintenance2)
{
TCU_THROW(NotSupportedError, "Image format doesn't support upload/download method");
}
+ // If no format feature flags are supported, the format itself is not supported,
+ // and images of that format cannot be created.
+ if (imageFormatProps.optimalTilingFeatures == 0)
+ {
+ TCU_THROW(NotSupportedError, "Base image format is not supported");
+ }
+
// Create a color buffer for host-inspection of results
// For the Copy download method, this is the target of the download, for other
// download methods, pixel data will be copied to this buffer from the download