The open source OpenXR runtime
0
fork

Configure Feed

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

c/main: Make temp_vk be a pointer

authored by

Jakob Bornecrantz and committed by
Ryan Pavlik
13a5036b 9b6b5b7e

+10 -8
+10 -8
src/xrt/compositor/main/comp_compositor.c
··· 1079 1079 } 1080 1080 COMP_DEBUG(c, "Checking for NVIDIA vulkan driver."); 1081 1081 1082 - struct vk_bundle temp_vk = {0}; 1083 - ret = vk_get_loader_functions(&temp_vk, vkGetInstanceProcAddr); 1082 + struct vk_bundle temp_vk_storage = {0}; 1083 + struct vk_bundle *temp_vk = &temp_vk_storage; 1084 + 1085 + ret = vk_get_loader_functions(temp_vk, vkGetInstanceProcAddr); 1084 1086 if (ret != VK_SUCCESS) { 1085 1087 CVK_ERROR(c, "vk_get_loader_functions", "Failed to get loader functions.", ret); 1086 1088 return false; ··· 1095 1097 .ppEnabledExtensionNames = extension_names, 1096 1098 }; 1097 1099 1098 - ret = temp_vk.vkCreateInstance(&instance_create_info, NULL, &(temp_vk.instance)); 1100 + ret = temp_vk->vkCreateInstance(&instance_create_info, NULL, &(temp_vk->instance)); 1099 1101 if (ret != VK_SUCCESS) { 1100 1102 CVK_ERROR(c, "vkCreateInstance", "Failed to create VkInstance.", ret); 1101 1103 return false; 1102 1104 } 1103 1105 1104 - ret = vk_get_instance_functions(&temp_vk); 1106 + ret = vk_get_instance_functions(temp_vk); 1105 1107 if (ret != VK_SUCCESS) { 1106 1108 CVK_ERROR(c, "vk_get_instance_functions", "Failed to get Vulkan instance functions.", ret); 1107 1109 return false; ··· 1109 1111 1110 1112 // follow same device selection logic as subsequent calls 1111 1113 ret = vk_create_device( // 1112 - &temp_vk, // 1114 + temp_vk, // 1113 1115 c->settings.selected_gpu_index, // 1114 1116 VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT, // global_priority 1115 1117 required_device_extensions, // ··· 1122 1124 return false; 1123 1125 } 1124 1126 1125 - if (_test_for_nvidia(c, &temp_vk)) { 1127 + if (_test_for_nvidia(c, temp_vk)) { 1126 1128 c->settings.window_type = WINDOW_DIRECT_NVIDIA; 1127 1129 COMP_DEBUG(c, "Selecting direct NVIDIA window type!"); 1128 1130 } 1129 1131 1130 - temp_vk.vkDestroyDevice(temp_vk.device, NULL); 1131 - temp_vk.vkDestroyInstance(temp_vk.instance, NULL); 1132 + temp_vk->vkDestroyDevice(temp_vk->device, NULL); 1133 + temp_vk->vkDestroyInstance(temp_vk->instance, NULL); 1132 1134 1133 1135 #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT 1134 1136 return true;