Skip to content
Snippets Groups Projects
Commit 13a5036b authored by Jakob Bornecrantz's avatar Jakob Bornecrantz Committed by Ryan Pavlik
Browse files

c/main: Make temp_vk be a pointer

parent 9b6b5b7e
No related branches found
No related tags found
No related merge requests found
...@@ -1079,8 +1079,10 @@ compositor_check_vulkan_caps(struct comp_compositor *c) ...@@ -1079,8 +1079,10 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
} }
COMP_DEBUG(c, "Checking for NVIDIA vulkan driver."); COMP_DEBUG(c, "Checking for NVIDIA vulkan driver.");
struct vk_bundle temp_vk = {0}; struct vk_bundle temp_vk_storage = {0};
ret = vk_get_loader_functions(&temp_vk, vkGetInstanceProcAddr); struct vk_bundle *temp_vk = &temp_vk_storage;
ret = vk_get_loader_functions(temp_vk, vkGetInstanceProcAddr);
if (ret != VK_SUCCESS) { if (ret != VK_SUCCESS) {
CVK_ERROR(c, "vk_get_loader_functions", "Failed to get loader functions.", ret); CVK_ERROR(c, "vk_get_loader_functions", "Failed to get loader functions.", ret);
return false; return false;
...@@ -1095,13 +1097,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c) ...@@ -1095,13 +1097,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
.ppEnabledExtensionNames = extension_names, .ppEnabledExtensionNames = extension_names,
}; };
ret = temp_vk.vkCreateInstance(&instance_create_info, NULL, &(temp_vk.instance)); ret = temp_vk->vkCreateInstance(&instance_create_info, NULL, &(temp_vk->instance));
if (ret != VK_SUCCESS) { if (ret != VK_SUCCESS) {
CVK_ERROR(c, "vkCreateInstance", "Failed to create VkInstance.", ret); CVK_ERROR(c, "vkCreateInstance", "Failed to create VkInstance.", ret);
return false; return false;
} }
ret = vk_get_instance_functions(&temp_vk); ret = vk_get_instance_functions(temp_vk);
if (ret != VK_SUCCESS) { if (ret != VK_SUCCESS) {
CVK_ERROR(c, "vk_get_instance_functions", "Failed to get Vulkan instance functions.", ret); CVK_ERROR(c, "vk_get_instance_functions", "Failed to get Vulkan instance functions.", ret);
return false; return false;
...@@ -1109,7 +1111,7 @@ compositor_check_vulkan_caps(struct comp_compositor *c) ...@@ -1109,7 +1111,7 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
// follow same device selection logic as subsequent calls // follow same device selection logic as subsequent calls
ret = vk_create_device( // ret = vk_create_device( //
&temp_vk, // temp_vk, //
c->settings.selected_gpu_index, // c->settings.selected_gpu_index, //
VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT, // global_priority VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT, // global_priority
required_device_extensions, // required_device_extensions, //
...@@ -1122,13 +1124,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c) ...@@ -1122,13 +1124,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
return false; return false;
} }
if (_test_for_nvidia(c, &temp_vk)) { if (_test_for_nvidia(c, temp_vk)) {
c->settings.window_type = WINDOW_DIRECT_NVIDIA; c->settings.window_type = WINDOW_DIRECT_NVIDIA;
COMP_DEBUG(c, "Selecting direct NVIDIA window type!"); COMP_DEBUG(c, "Selecting direct NVIDIA window type!");
} }
temp_vk.vkDestroyDevice(temp_vk.device, NULL); temp_vk->vkDestroyDevice(temp_vk->device, NULL);
temp_vk.vkDestroyInstance(temp_vk.instance, NULL); temp_vk->vkDestroyInstance(temp_vk->instance, NULL);
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment