Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libretro: Don't use VulkanLoader to load the vulkan library #19456

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions libretro/LibretroVulkanContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ void LibretroVulkanContext::SwapBuffers() {
static bool create_device(retro_vulkan_context *context, VkInstance instance, VkPhysicalDevice gpu, VkSurfaceKHR surface, PFN_vkGetInstanceProcAddr get_instance_proc_addr, const char **required_device_extensions, unsigned num_required_device_extensions, const char **required_device_layers, unsigned num_required_device_layers, const VkPhysicalDeviceFeatures *required_features) {
init_glslang();

std::string errorStr;
if (!VulkanLoad(&errorStr)) {
// TODO: In the context of RetroArch, someone has already loaded the functions.
// But grabbing the pointers for ourselves can't really be a bad thing.
ERROR_LOG(Log::G3D, "RetroArch called the Vulkan entry point without Vulkan available??? %s", errorStr.c_str());
return false;
}

vk = new VulkanContext();

vk_libretro_init(instance, gpu, surface, get_instance_proc_addr, required_device_extensions, num_required_device_extensions, required_device_layers, num_required_device_layers, required_features);
Expand Down
8 changes: 6 additions & 2 deletions libretro/libretro_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr_libretro(VkInstan
return (PFN_vkVoidFunction)vkCreateLibretroSurfaceKHR;
}

PFN_vkVoidFunction fptr = vkGetInstanceProcAddr_org(instance, pName);
PFN_vkVoidFunction fptr = vk_init_info.get_instance_proc_addr(instance, pName);
if (!fptr) {
ERROR_LOG(Log::G3D, "Failed to load VK instance function: %s", pName);
return fptr;
Expand Down Expand Up @@ -412,9 +412,13 @@ void vk_libretro_init(VkInstance instance, VkPhysicalDevice gpu, VkSurfaceKHR su

vkGetInstanceProcAddr_org = vkGetInstanceProcAddr;
vkGetInstanceProcAddr = vkGetInstanceProcAddr_libretro;
vkGetDeviceProcAddr_org = vkGetDeviceProcAddr;
vkGetDeviceProcAddr_org = (PFN_vkGetDeviceProcAddr)vkGetInstanceProcAddr(instance, "vkGetDeviceProcAddr");;
vkGetDeviceProcAddr = vkGetDeviceProcAddr_libretro;
vkCreateInstance = vkCreateInstance_libretro;

vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion)vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion");
vkEnumerateInstanceExtensionProperties = (PFN_vkEnumerateInstanceExtensionProperties)vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceExtensionProperties");
vkEnumerateInstanceLayerProperties = (PFN_vkEnumerateInstanceLayerProperties)vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceLayerProperties");
}

void vk_libretro_set_hwrender_interface(retro_hw_render_interface *hw_render_interface) {
Expand Down
Loading