The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

authored by

Christoph Haag and committed by
Jakob Bornecrantz
6f263dbd a188ef21

+7 -2
+7 -2
src/xrt/auxiliary/vk/vk_helpers.c
··· 1166 1166 { 1167 1167 VkBaseInStructure *next_chain = NULL; 1168 1168 1169 + /* 1170 + * @todo Handle Vulkan 1.0 instance without VK_KHR_maintenance2 on GPUs that don't support srgb with storage 1171 + * usage. 1172 + */ 1169 1173 #ifdef VK_KHR_maintenance2 1170 1174 VkImageViewUsageCreateInfo image_view_usage_create_info = { 1171 1175 .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, ··· 1173 1177 .usage = image_usage, 1174 1178 }; 1175 1179 1176 - if (vk->has_KHR_maintenance2) { 1180 + if (vk->has_KHR_maintenance2 || vk->version >= VK_VERSION_1_1) { 1177 1181 CHAIN(image_view_usage_create_info, next_chain); 1178 1182 } else { 1179 - VK_WARN(vk, "VK_KHR_maintenance2 not supported can't use usage image view"); 1183 + VK_WARN(vk, 1184 + "Using Vulkan 1.0 instance without VK_KHR_maintenance2 support, can't use usage image view."); 1180 1185 } 1181 1186 #endif 1182 1187