mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-21 06:01:43 +00:00
a/vk: allow VkImageViewUsageCreateInfo in Vulkan 1.1
Some drivers do not advertise support for VK_KHR_maintenance2 in Vulkan 1.1, because it has been promoted to core. This caused a validation error on compositors that use Vulkan 1.1 because the scratch image is allocated with unorm format and STORAGE usage: an image view with srgb format can not be created with STORAGE usage on many GPUs.
This commit is contained in:
parent
a188ef219c
commit
6f263dbda4
|
@ -1166,6 +1166,10 @@ vk_create_view_usage(struct vk_bundle *vk,
|
||||||
{
|
{
|
||||||
VkBaseInStructure *next_chain = NULL;
|
VkBaseInStructure *next_chain = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @todo Handle Vulkan 1.0 instance without VK_KHR_maintenance2 on GPUs that don't support srgb with storage
|
||||||
|
* usage.
|
||||||
|
*/
|
||||||
#ifdef VK_KHR_maintenance2
|
#ifdef VK_KHR_maintenance2
|
||||||
VkImageViewUsageCreateInfo image_view_usage_create_info = {
|
VkImageViewUsageCreateInfo image_view_usage_create_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO,
|
||||||
|
@ -1173,10 +1177,11 @@ vk_create_view_usage(struct vk_bundle *vk,
|
||||||
.usage = image_usage,
|
.usage = image_usage,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (vk->has_KHR_maintenance2) {
|
if (vk->has_KHR_maintenance2 || vk->version >= VK_VERSION_1_1) {
|
||||||
CHAIN(image_view_usage_create_info, next_chain);
|
CHAIN(image_view_usage_create_info, next_chain);
|
||||||
} else {
|
} else {
|
||||||
VK_WARN(vk, "VK_KHR_maintenance2 not supported can't use usage image view");
|
VK_WARN(vk,
|
||||||
|
"Using Vulkan 1.0 instance without VK_KHR_maintenance2 support, can't use usage image view.");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue