The open source OpenXR runtime
0
fork

Configure Feed

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

aux/vk: add support for optional VK_ANDROID_external_format_resolve

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2316>

+49 -1
+1
scripts/generate_vk_helpers.py
··· 305 305 "VK_EXT_global_priority", 306 306 "VK_EXT_image_drm_format_modifier", 307 307 "VK_EXT_robustness2", 308 + "VK_ANDROID_external_format_resolve", 308 309 "VK_GOOGLE_display_timing", 309 310 ] 310 311
+41
src/xrt/auxiliary/vk/vk_bundle_init.c
··· 756 756 vk->has_EXT_global_priority = false; 757 757 vk->has_EXT_image_drm_format_modifier = false; 758 758 vk->has_EXT_robustness2 = false; 759 + vk->has_ANDROID_external_format_resolve = false; 759 760 vk->has_GOOGLE_display_timing = false; 760 761 761 762 const char *const *exts = u_string_list_get_data(ext_list); ··· 882 883 continue; 883 884 } 884 885 #endif // defined(VK_EXT_robustness2) 886 + 887 + #if defined(VK_ANDROID_external_format_resolve) 888 + if (strcmp(ext, VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME) == 0) { 889 + vk->has_ANDROID_external_format_resolve = true; 890 + continue; 891 + } 892 + #endif // defined(VK_ANDROID_external_format_resolve) 885 893 886 894 #if defined(VK_GOOGLE_display_timing) 887 895 if (strcmp(ext, VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME) == 0) { ··· 1030 1038 }; 1031 1039 #endif 1032 1040 1041 + #ifdef VK_ANDROID_external_format_resolve 1042 + VkPhysicalDeviceExternalFormatResolveFeaturesANDROID ext_fmt_resolve_info = { 1043 + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID, 1044 + .pNext = NULL, 1045 + }; 1046 + #endif 1047 + 1033 1048 VkPhysicalDeviceFeatures2 physical_device_features = { 1034 1049 .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, 1035 1050 .pNext = NULL, ··· 1056 1071 } 1057 1072 #endif 1058 1073 1074 + #ifdef VK_ANDROID_external_format_resolve 1075 + if (vk->has_ANDROID_external_format_resolve) { 1076 + append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1077 + (VkBaseInStructure *)&ext_fmt_resolve_info); 1078 + } 1079 + #endif 1080 + 1059 1081 vk->vkGetPhysicalDeviceFeatures2( // 1060 1082 physical_device, // physicalDevice 1061 1083 &physical_device_features); // pFeatures ··· 1077 1099 1078 1100 #ifdef VK_KHR_synchronization2 1079 1101 CHECK(synchronization_2, synchronization_2_info.synchronization2); 1102 + #endif 1103 + 1104 + #ifdef VK_ANDROID_external_format_resolve 1105 + CHECK(ext_fmt_resolve, ext_fmt_resolve_info.externalFormatResolve); 1080 1106 #endif 1081 1107 1082 1108 CHECK(shader_image_gather_extended, physical_device_features.features.shaderImageGatherExtended); ··· 1243 1269 }; 1244 1270 #endif 1245 1271 1272 + #ifdef VK_ANDROID_external_format_resolve 1273 + VkPhysicalDeviceExternalFormatResolveFeaturesANDROID ext_fmt_resolve_info = { 1274 + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID, 1275 + .pNext = NULL, 1276 + .externalFormatResolve = device_features.ext_fmt_resolve, 1277 + }; 1278 + #endif 1279 + 1246 1280 VkPhysicalDeviceFeatures enabled_features = { 1247 1281 .shaderImageGatherExtended = device_features.shader_image_gather_extended, 1248 1282 .shaderStorageImageWriteWithoutFormat = device_features.shader_storage_image_write_without_format, ··· 1274 1308 if (vk->has_KHR_synchronization2) { 1275 1309 append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1276 1310 (VkBaseInStructure *)&synchronization_2_info); 1311 + } 1312 + #endif 1313 + 1314 + #ifdef VK_ANDROID_external_format_resolve 1315 + if (vk->has_ANDROID_external_format_resolve) { 1316 + append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1317 + (VkBaseInStructure *)&ext_fmt_resolve_info); 1277 1318 } 1278 1319 #endif 1279 1320
+2
src/xrt/auxiliary/vk/vk_helpers.h
··· 142 142 bool has_EXT_global_priority; 143 143 bool has_EXT_image_drm_format_modifier; 144 144 bool has_EXT_robustness2; 145 + bool has_ANDROID_external_format_resolve; 145 146 bool has_GOOGLE_display_timing; 146 147 // end of GENERATED device extension code - do not modify - used by scripts 147 148 ··· 996 997 bool null_descriptor; 997 998 bool timeline_semaphore; 998 999 bool synchronization_2; 1000 + bool ext_fmt_resolve; 999 1001 }; 1000 1002 1001 1003 /*!
+5 -1
src/xrt/compositor/main/comp_compositor.c
··· 556 556 VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME, // 557 557 558 558 #elif defined(XRT_GRAPHICS_SYNC_HANDLE_IS_WIN32_HANDLE) // Not optional 559 - 559 + #elif defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER) 560 + #if defined(VK_ANDROID_external_format_resolve) 561 + // Requires Vulkan 1.3.268.1 562 + VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME // 563 + #endif 560 564 #else 561 565 #error "Need port!" 562 566 #endif