Merge pull request #19456 from warmenhoven/warmenhoven/pr/vulkan-context
Some checks failed
Build / build-windows (ARM64) (push) Waiting to run
Build / build-windows (x64) (push) Waiting to run
Build / build-uwp (push) Waiting to run
Build / test-windows (push) Blocked by required conditions
Build / build (./b.sh --headless --unittest --fat --no-png --no-sdl2, clang, clang++, test, macos, macos-latest) (push) Waiting to run
Build / build (./b.sh --ios, clang, clang++, ios, ios, macos-latest) (push) Waiting to run
Build / test (macos-latest) (push) Blocked by required conditions
Build / test (ubuntu-latest) (push) Blocked by required conditions
Build / build (./b.sh --headless --unittest, clang, clang++, test, clang-normal, ubuntu-latest) (push) Failing after 0s
Build / build (./b.sh --headless --unittest, gcc, g++, gcc-normal, ubuntu-latest) (push) Failing after 0s
Build / build (./b.sh --libretro_android ppsspp_libretro, clang, clang++, android, android-libretro, ubuntu-latest) (push) Failing after 0s
Build / build (./b.sh --qt, gcc, g++, qt, qt, ubuntu-latest) (push) Failing after 0s
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a OPENXR=1, clang, clang++, android, android-vr, ubuntu-latest) (push) Failing after 0s
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm64, ubuntu-latest) (push) Failing after 0s
Build / build (cd android && ./ab.sh -j2 APP_ABI=armeabi-v7a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm32, ubuntu-latest) (push) Failing after 0s
Build / build (cd android && ./ab.sh -j2 APP_ABI=x86_64 UNITTEST=1 HEADLESS=1, clang, clang++, android, android-x86_64, ubuntu-latest) (push) Failing after 0s
Build / build (make -C libretro -f Makefile -j2, clang, clang++, libretro, clang-libretro, ubuntu-latest) (push) Failing after 0s
Build / build (make -C libretro -f Makefile -j2, gcc, g++, libretro, gcc-libretro, ubuntu-latest) (push) Failing after 0s
Build / build_test_headless_alpine (push) Failing after 0s
Generate Docker Layer / build (push) Failing after 0s

libretro: Don't use VulkanLoader to load the vulkan library
This commit is contained in:
Henrik Rydgård 2024-09-14 10:22:26 +02:00 committed by GitHub
commit ebe7ba2b0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 10 deletions

View File

@ -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);

View File

@ -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;
@ -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) {