mirror of
https://github.com/Ishan09811/pine.git
synced 2025-04-24 08:55:10 +00:00
Update libadrenotools submodule and adapt to API changes (#29)
- Updated the libadrenotools submodule to the latest version. - Adapted the `adrenotools_open_libvulkan` calls to handle the new function signature. - Replaced the `adrenotools_gpu_mapping*` argument with a `void**` for user mapping. - Properly cast `userMappingHandle` to `adrenotools_gpu_mapping*` after loading Vulkan driver. - Updated related code in `LoadVulkanDriver` to handle the new GPU mapping logic for both custom and built-in Vulkan drivers. - Ensured backward compatibility with the new feature flags and import handling in the updated API.
This commit is contained in:
parent
4fa5879f9a
commit
1d0b0ec14d
@ -1 +1 @@
|
||||
Subproject commit 19d1998c5a39dc18f90086e068ce7b3331110d74
|
||||
Subproject commit 8fae8ce254dfc1344527e05301e43f37dea2df80
|
@ -343,6 +343,7 @@ namespace skyline::gpu {
|
||||
|
||||
static PFN_vkGetInstanceProcAddr LoadVulkanDriver(const DeviceState &state, adrenotools_gpu_mapping *mapping) {
|
||||
void *libvulkanHandle{};
|
||||
void *userMappingHandle = nullptr; // New void* pointer for user mapping handle
|
||||
|
||||
// If the user has selected a custom driver, try to load it
|
||||
if (!(*state.settings->gpuDriver).empty()) {
|
||||
@ -354,9 +355,14 @@ namespace skyline::gpu {
|
||||
(state.os->privateAppFilesPath + "gpu_drivers/" + *state.settings->gpuDriver + "/").c_str(),
|
||||
(*state.settings->gpuDriverLibraryName).c_str(),
|
||||
(state.os->publicAppFilesPath + "gpu/vk_file_redirect/").c_str(),
|
||||
mapping
|
||||
reinterpret_cast<void**>(&userMappingHandle) // Use reinterpret_cast to pass as void**
|
||||
);
|
||||
|
||||
// Cast the userMappingHandle back to adrenotools_gpu_mapping*
|
||||
if (libvulkanHandle) {
|
||||
mapping = reinterpret_cast<adrenotools_gpu_mapping*>(userMappingHandle);
|
||||
}
|
||||
|
||||
if (!libvulkanHandle) {
|
||||
char *error = dlerror();
|
||||
LOGW("Failed to load custom Vulkan driver {}/{}: {}", *state.settings->gpuDriver, *state.settings->gpuDriverLibraryName, error ? error : "");
|
||||
@ -372,9 +378,14 @@ namespace skyline::gpu {
|
||||
nullptr,
|
||||
nullptr,
|
||||
(state.os->publicAppFilesPath + "gpu/vk_file_redirect/").c_str(),
|
||||
mapping
|
||||
reinterpret_cast<void**>(&userMappingHandle) // Use reinterpret_cast for user mapping handle
|
||||
);
|
||||
|
||||
// Cast the userMappingHandle back to adrenotools_gpu_mapping*
|
||||
if (libvulkanHandle) {
|
||||
mapping = reinterpret_cast<adrenotools_gpu_mapping*>(userMappingHandle);
|
||||
}
|
||||
|
||||
if (!libvulkanHandle) {
|
||||
char *error = dlerror();
|
||||
LOGW("Failed to load builtin Vulkan driver: {}", error ? error : "");
|
||||
@ -383,10 +394,10 @@ namespace skyline::gpu {
|
||||
if (!libvulkanHandle)
|
||||
libvulkanHandle = dlopen("libvulkan.so", RTLD_NOW);
|
||||
}
|
||||
|
||||
return reinterpret_cast<PFN_vkGetInstanceProcAddr>(dlsym(libvulkanHandle, "vkGetInstanceProcAddr"));
|
||||
}
|
||||
|
||||
|
||||
GPU::GPU(const DeviceState &state)
|
||||
: state(state),
|
||||
vkContext(LoadVulkanDriver(state, &adrenotoolsImportMapping)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user