mirror of
https://github.com/Ishan09811/pine.git
synced 2025-04-24 08:55:10 +00:00
Revert "Integrate GPU memory mapping using adrenotools_mem_gpu_allocate and a…" (#31)
This reverts commit 3fdef75d032a47225021da4b1bc8ec55f3922c30.
This commit is contained in:
parent
56de0ab2af
commit
4859b7a685
@ -343,8 +343,7 @@ namespace skyline::gpu {
|
||||
|
||||
static PFN_vkGetInstanceProcAddr LoadVulkanDriver(const DeviceState &state, adrenotools_gpu_mapping *mapping) {
|
||||
void *libvulkanHandle{};
|
||||
void *userMappingHandle = nullptr;
|
||||
uint64_t gpuMemSize = 0;
|
||||
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()) {
|
||||
@ -356,24 +355,15 @@ 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(),
|
||||
reinterpret_cast<void**>(&userMappingHandle)
|
||||
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);
|
||||
}
|
||||
|
||||
// GPU memory allocation
|
||||
if (!adrenotools_mem_gpu_allocate(userMappingHandle, &gpuMemSize)) {
|
||||
LOGW("Failed to allocate GPU memory.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// CPU-side memory mapping
|
||||
if (!adrenotools_mem_cpu_map(userMappingHandle, mapping->host_ptr, gpuMemSize)) {
|
||||
LOGW("Failed to map GPU memory to CPU.");
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
if (!libvulkanHandle) {
|
||||
char *error = dlerror();
|
||||
LOGW("Failed to load custom Vulkan driver {}/{}: {}", *state.settings->gpuDriver, *state.settings->gpuDriverLibraryName, error ? error : "");
|
||||
}
|
||||
@ -388,24 +378,15 @@ namespace skyline::gpu {
|
||||
nullptr,
|
||||
nullptr,
|
||||
(state.os->publicAppFilesPath + "gpu/vk_file_redirect/").c_str(),
|
||||
reinterpret_cast<void**>(&userMappingHandle)
|
||||
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);
|
||||
}
|
||||
|
||||
// GPU memory allocation
|
||||
if (!adrenotools_mem_gpu_allocate(userMappingHandle, &gpuMemSize)) {
|
||||
LOGW("Failed to allocate GPU memory.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// CPU-side memory mapping
|
||||
if (!adrenotools_mem_cpu_map(userMappingHandle, mapping->host_ptr, gpuMemSize)) {
|
||||
LOGW("Failed to map GPU memory to CPU.");
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
if (!libvulkanHandle) {
|
||||
char *error = dlerror();
|
||||
LOGW("Failed to load builtin Vulkan driver: {}", error ? error : "");
|
||||
}
|
||||
@ -417,7 +398,6 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
|
||||
|
||||
GPU::GPU(const DeviceState &state)
|
||||
: state(state),
|
||||
vkContext(LoadVulkanDriver(state, &adrenotoolsImportMapping)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user