You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
This is part of an effort to update Unreal Engine's SDL_dynapi function table to match upstream's, allowing for safe use of SDL_DYNAMIC_API. Currently UE breaks away from upstream in two places: SDL_Vulkan_GetRequiredInstanceExtensions, which works similar to the upstream SDL_Vulkan_GetInstanceExtensions SDL_ConfineCursor, a new API altogether I'll be working to introduce an upstream version of SDL_ConfineCursor this week. As for SDL_Vulkan_GetRequiredInstanceExtensions, it turns out that there are some issues here: 1. SDL_Vulkan_GetInstanceExtensions depends on SDL_Vulkan_LoadLibrary, which UE does not use when checking for Vulkan functions 2. The UE base Vulkan functions aren't quite what you can get out of vkInstanceGetProcAddr, so we can't trivially replace dlsym for the base and then fudge the rest with a VkInstance 3. Because GetRequiredInstanceExtensions is effectively Epic-only, it only supports as many backends as UE itself does The best solution, at least for now, is to just cut out the SDL part and implement the WSI extension query inside VulkanLinuxPlatform instead. It's basically the same thing but with less mallocs and doesn't break the dynapi table. It'd be cool to fix this "for real" one day, but it would require a bit of refactoring and affect a ton of platforms at once, so this seems like a safe compromise. The patch is based on ue5-main, but can be applied to any UE branch that is still officially supported and uses the SDL extension. It was tested on X11, Wayland, and Xwayland. #jira UE-132665 PR #8548: SDL2: Remove Vulkan_GetRequiredInstanceExtensions (Contributed by flibitijibibo) [at]Brandon.Schaefer #rb Brandon.Schaefer #ROBOMERGE-AUTHOR: michael.sartain #ROBOMERGE-SOURCE: CL 17945563 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292) [CL 17945591 by flibitijibibo in ue5-release-engine-test branch]