-
Notifications
You must be signed in to change notification settings - Fork 989
Description
F1 2017 running through DXVK creates an image with VK_IMAGE_USAGE_STORAGE_BIT set and then creates a view of that image with a format of VK_FORMAT_R8G8B8A8_SRGB. This is illegal according to the Vulkan spec:
If image was created with
VK_IMAGE_TILING_OPTIMAL, and format is notVK_FORMAT_UNDEFINED, and usage containsVK_IMAGE_USAGE_STORAGE_BIT, format must be supported for storage images, as specified by theVK_FORMAT_FEATURE_STORAGE_IMAGE_BITflag inVkFormatProperties::optimalTilingFeaturesreturned byvkGetPhysicalDeviceFormatPropertieswith the same value of format.
What F1 and DXVK are trying to do is sensible and that's why we added support for this with VK_KHR_maintenance2. What you need to do is the following:
- Create the image with
VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHRand all of the possible usages of the image even if they aren't supported by the format. - Chain a
VkImageViewUsageCreateInfoKHRstruct intoVkImageViewCreateInfoand provide a view-specific usage whenever you create an image view. For a UAV, for instance, it would just beVK_IMAGE_USAGE_STORAGE_BIT.
This should also slightly improve memory usage on Intel because we create different hardware surface states for storage vs. texture so right now the texture surface state is unnecessarily being created for UAVs and the storage surface state is unnecessarily being created for sampler views.