mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
android: removed libadrenotools
This commit is contained in:
parent
047d4dfd0f
commit
057740cade
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -128,9 +128,6 @@
|
|||
path = 3rdparty/GPUOpen/VulkanMemoryAllocator
|
||||
url = ../../Megamouse/VulkanMemoryAllocator.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/libadrenotools"]
|
||||
path = 3rdparty/libadrenotools
|
||||
url = ../../bylaws/libadrenotools.git
|
||||
[submodule "3rdparty/Vulkan-Headers"]
|
||||
path = 3rdparty/Vulkan-Headers
|
||||
url = ../../KhronosGroup/Vulkan-Headers.git
|
||||
|
|
|
|||
7
3rdparty/CMakeLists.txt
vendored
7
3rdparty/CMakeLists.txt
vendored
|
|
@ -394,12 +394,6 @@ else()
|
|||
add_library(3rdparty::libusb ALIAS usb-1.0-static)
|
||||
endif()
|
||||
|
||||
if (ANDROID AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
add_subdirectory(libadrenotools)
|
||||
else()
|
||||
add_library(adrenotools INTERFACE)
|
||||
endif()
|
||||
|
||||
add_library(3rdparty::zlib ALIAS 3rdparty_zlib)
|
||||
add_library(3rdparty::zstd ALIAS 3rdparty_zstd)
|
||||
add_library(3rdparty::7zip ALIAS 3rdparty_7zip)
|
||||
|
|
@ -425,4 +419,3 @@ add_library(3rdparty::rtmidi ALIAS rtmidi)
|
|||
add_library(3rdparty::opencv ALIAS ${OPENCV_TARGET})
|
||||
add_library(3rdparty::fusion ALIAS Fusion)
|
||||
add_library(3rdparty::json ALIAS 3rdparty_json)
|
||||
add_library(3rdparty::adrenotools ALIAS adrenotools)
|
||||
|
|
|
|||
1
3rdparty/libadrenotools
vendored
1
3rdparty/libadrenotools
vendored
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 8fae8ce254dfc1344527e05301e43f37dea2df80
|
||||
|
|
@ -2625,4 +2625,19 @@ extern "C" std::string _rpcsx_getVersion() {
|
|||
return rx::getVersion().toString();
|
||||
}
|
||||
|
||||
extern "C" void *_rpcsx_setCustomDriver(void *driverHandle) {
|
||||
auto prevLoader = vk::instance::g_vk_loader;
|
||||
if (prevLoader != nullptr) {
|
||||
vk::symbol_cache::cache_instance().clear();
|
||||
}
|
||||
|
||||
vk::instance::g_vk_loader = driverHandle;
|
||||
|
||||
if (driverHandle != nullptr) {
|
||||
vk::symbol_cache::cache_instance().initialize();
|
||||
}
|
||||
|
||||
return prevLoader;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ target_link_libraries(rpcs3_emu
|
|||
3rdparty::soundtouch
|
||||
3rdparty::miniupnpc
|
||||
3rdparty::json
|
||||
3rdparty::adrenotools
|
||||
)
|
||||
|
||||
# Cell
|
||||
|
|
|
|||
|
|
@ -1,16 +1,10 @@
|
|||
#include "Emu/RSX/VK/VulkanAPI.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/RSX/VK/VulkanAPI.h"
|
||||
#include "instance.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <fstream>
|
||||
#include <dlfcn.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID) && defined(ARCH_ARM64)
|
||||
#include "libadrenotools/include/adrenotools/priv.h"
|
||||
#include <libadrenotools/include/adrenotools/driver.h>
|
||||
#endif
|
||||
|
||||
namespace vk
|
||||
|
|
@ -84,9 +78,8 @@ namespace vk
|
|||
m_instance = VK_NULL_HANDLE;
|
||||
|
||||
#if defined(ANDROID) && defined(ARCH_ARM64)
|
||||
if (owns_loader && g_vk_loader != nullptr)
|
||||
if (g_vk_loader != nullptr && owns_loader)
|
||||
{
|
||||
adrenotools_set_turbo(false);
|
||||
::dlclose(g_vk_loader);
|
||||
g_vk_loader = nullptr;
|
||||
|
||||
|
|
@ -122,56 +115,15 @@ namespace vk
|
|||
#if defined(ANDROID) && defined(ARCH_ARM64)
|
||||
if (g_vk_loader == nullptr)
|
||||
{
|
||||
auto custom_driver_path = g_cfg.video.vk.driver.path.to_string();
|
||||
if (!custom_driver_path.empty())
|
||||
{
|
||||
rsx_log.warning("Loading custom driver %s", custom_driver_path);
|
||||
|
||||
auto meta = nlohmann::json::parse(std::ifstream(custom_driver_path + "/meta.json"));
|
||||
|
||||
if (meta.contains("libraryName"))
|
||||
{
|
||||
auto library_name = meta["libraryName"].get<std::string>();
|
||||
rsx_log.warning("Custom driver: library name %s", library_name);
|
||||
|
||||
auto hook_dir = g_cfg.video.vk.driver.hook_dir.to_string();
|
||||
rsx_log.warning("Custom driver: hook dir %s", hook_dir);
|
||||
|
||||
::dlerror();
|
||||
g_vk_loader = adrenotools_open_libvulkan(
|
||||
RTLD_NOW, ADRENOTOOLS_DRIVER_CUSTOM,
|
||||
nullptr, (hook_dir + "/").c_str(),
|
||||
(custom_driver_path + "/").c_str(), library_name.c_str(),
|
||||
nullptr, nullptr);
|
||||
|
||||
if (g_vk_loader == nullptr)
|
||||
{
|
||||
rsx_log.error("Failed to load custom driver at '%s': %s", custom_driver_path, ::dlerror());
|
||||
}
|
||||
else
|
||||
{
|
||||
adrenotools_set_turbo(g_cfg.video.vk.driver.turbo_mode.get());
|
||||
rsx_log.success("Custom driver at '%s' successfully loaded", custom_driver_path);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rsx_log.error("Custom driver load error: Invalid meta.json at %s", custom_driver_path);
|
||||
}
|
||||
}
|
||||
g_vk_loader = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
|
||||
|
||||
if (g_vk_loader == nullptr)
|
||||
{
|
||||
g_vk_loader = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
|
||||
|
||||
if (g_vk_loader == nullptr)
|
||||
{
|
||||
g_vk_loader = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
|
||||
}
|
||||
g_vk_loader = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
|
||||
}
|
||||
|
||||
symbol_cache::cache_instance().initialize();
|
||||
owns_loader = true;
|
||||
symbol_cache::cache_instance().initialize();
|
||||
}
|
||||
#endif
|
||||
// Initialize a vulkan instance
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ namespace vk
|
|||
VkDebugReportCallbackEXT m_debugger = nullptr;
|
||||
|
||||
#ifdef ANDROID
|
||||
static void* g_vk_loader;
|
||||
bool owns_loader = false;
|
||||
#endif
|
||||
|
||||
|
|
@ -49,6 +48,8 @@ namespace vk
|
|||
|
||||
public:
|
||||
#ifdef ANDROID
|
||||
static void* g_vk_loader;
|
||||
|
||||
static void* get_vk_loader()
|
||||
{
|
||||
return g_vk_loader;
|
||||
|
|
|
|||
Loading…
Reference in a new issue