The open source OpenXR runtime
0
fork

Configure Feed

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

a/vk: Move "append_to_pnext_chain" to public header

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

+27 -27
+18 -27
src/xrt/auxiliary/vk/vk_bundle_init.c
··· 31 31 * 32 32 */ 33 33 34 - static inline void 35 - append_to_pnext_chain(VkBaseInStructure *head, VkBaseInStructure *new_struct) 36 - { 37 - assert(new_struct->pNext == NULL); 38 - // Insert ourselves between head and its previous pNext 39 - new_struct->pNext = head->pNext; 40 - head->pNext = (void *)new_struct; 41 - } 42 - 43 34 static bool 44 35 should_skip_optional_instance_ext(struct vk_bundle *vk, 45 36 struct u_string_list *required_instance_ext_list, ··· 1093 1084 1094 1085 #ifdef VK_EXT_robustness2 1095 1086 if (vk->has_EXT_robustness2) { 1096 - append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1097 - (VkBaseInStructure *)&robust_info); 1087 + vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1088 + (VkBaseInStructure *)&robust_info); 1098 1089 } 1099 1090 #endif 1100 1091 1101 1092 #ifdef VK_KHR_8bit_storage 1102 1093 if (vk->has_KHR_8bit_storage) { 1103 - append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1104 - (VkBaseInStructure *)&storage_8bit); 1094 + vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1095 + (VkBaseInStructure *)&storage_8bit); 1105 1096 } 1106 1097 #endif 1107 1098 1108 1099 #ifdef VK_KHR_timeline_semaphore 1109 1100 if (vk->has_KHR_timeline_semaphore) { 1110 - append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1111 - (VkBaseInStructure *)&timeline_semaphore_info); 1101 + vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1102 + (VkBaseInStructure *)&timeline_semaphore_info); 1112 1103 } 1113 1104 #endif 1114 1105 1115 1106 #ifdef VK_KHR_synchronization2 1116 1107 if (vk->has_KHR_synchronization2) { 1117 - append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1118 - (VkBaseInStructure *)&synchronization_2_info); 1108 + vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1109 + (VkBaseInStructure *)&synchronization_2_info); 1119 1110 } 1120 1111 #endif 1121 1112 1122 1113 #ifdef VK_ANDROID_external_format_resolve 1123 1114 if (vk->has_ANDROID_external_format_resolve) { 1124 - append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1125 - (VkBaseInStructure *)&ext_fmt_resolve_info); 1115 + vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features, 1116 + (VkBaseInStructure *)&ext_fmt_resolve_info); 1126 1117 } 1127 1118 #endif 1128 1119 ··· 1357 1348 1358 1349 #ifdef VK_EXT_robustness2 1359 1350 if (vk->has_EXT_robustness2) { 1360 - append_to_pnext_chain((VkBaseInStructure *)&device_create_info, (VkBaseInStructure *)&robust_info); 1351 + vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info, (VkBaseInStructure *)&robust_info); 1361 1352 } 1362 1353 #endif 1363 1354 1364 1355 #ifdef VK_KHR_8bit_storage 1365 1356 if (vk->has_KHR_8bit_storage) { 1366 - append_to_pnext_chain((VkBaseInStructure *)&device_create_info, (VkBaseInStructure *)&storage_8bit); 1357 + vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info, (VkBaseInStructure *)&storage_8bit); 1367 1358 } 1368 1359 #endif 1369 1360 1370 1361 #ifdef VK_KHR_timeline_semaphore 1371 1362 if (vk->has_KHR_timeline_semaphore) { 1372 - append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1373 - (VkBaseInStructure *)&timeline_semaphore_info); 1363 + vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1364 + (VkBaseInStructure *)&timeline_semaphore_info); 1374 1365 } 1375 1366 #endif 1376 1367 1377 1368 #ifdef VK_KHR_synchronization2 1378 1369 if (vk->has_KHR_synchronization2) { 1379 - append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1380 - (VkBaseInStructure *)&synchronization_2_info); 1370 + vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1371 + (VkBaseInStructure *)&synchronization_2_info); 1381 1372 } 1382 1373 #endif 1383 1374 1384 1375 #ifdef VK_ANDROID_external_format_resolve 1385 1376 if (vk->has_ANDROID_external_format_resolve) { 1386 - append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1387 - (VkBaseInStructure *)&ext_fmt_resolve_info); 1377 + vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info, 1378 + (VkBaseInStructure *)&ext_fmt_resolve_info); 1388 1379 } 1389 1380 #endif 1390 1381
+9
src/xrt/auxiliary/vk/vk_helpers.h
··· 550 550 } while (false) 551 551 552 552 553 + static inline void 554 + vk_append_to_pnext_chain(VkBaseInStructure *head, VkBaseInStructure *new_struct) 555 + { 556 + assert(new_struct->pNext == NULL); 557 + // Insert ourselves between head and its previous pNext 558 + new_struct->pNext = head->pNext; 559 + head->pNext = new_struct; 560 + } 561 + 553 562 /* 554 563 * 555 564 * String helper functions.