mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-10 06:56:49 +00:00
Fix android build
This commit is contained in:
@@ -738,6 +738,35 @@ const char* fallback_cpu_detection() {
|
|||||||
return s_result.c_str();
|
return s_result.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ARCHITECTURE_arm64
|
||||||
|
struct SystemDriverInfo {
|
||||||
|
VkPhysicalDeviceProperties properties{};
|
||||||
|
VkPhysicalDeviceDriverProperties driver{};
|
||||||
|
};
|
||||||
|
|
||||||
|
SystemDriverInfo QuerySystemDriverInfo(JNIEnv* env, jstring j_hook_lib_dir) {
|
||||||
|
const std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir);
|
||||||
|
const Common::DynamicLibrary library{adrenotools_open_libvulkan(
|
||||||
|
RTLD_NOW, 0, nullptr, hook_lib_dir.c_str(), nullptr, nullptr, nullptr, nullptr)};
|
||||||
|
Vulkan::vk::InstanceDispatch dld;
|
||||||
|
const Vulkan::vk::Instance instance = Vulkan::CreateInstance(library, dld, VK_API_VERSION_1_1);
|
||||||
|
const std::vector<VkPhysicalDevice> devices = instance.EnumeratePhysicalDevices();
|
||||||
|
if (devices.empty()) {
|
||||||
|
throw Vulkan::vk::Exception(VK_ERROR_INITIALIZATION_FAILED);
|
||||||
|
}
|
||||||
|
SystemDriverInfo info{};
|
||||||
|
info.driver.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
|
||||||
|
VkPhysicalDeviceProperties2 properties2{
|
||||||
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
|
||||||
|
.pNext = &info.driver,
|
||||||
|
.properties = {},
|
||||||
|
};
|
||||||
|
Vulkan::vk::PhysicalDevice(devices[0], dld).GetProperties2(properties2);
|
||||||
|
info.properties = properties2.properties;
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -855,39 +884,6 @@ jboolean JNICALL Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_supportsCustomDri
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARCHITECTURE_arm64
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct SystemDriverInfo {
|
|
||||||
VkPhysicalDeviceProperties properties{};
|
|
||||||
VkPhysicalDeviceDriverProperties driver{};
|
|
||||||
};
|
|
||||||
|
|
||||||
SystemDriverInfo QuerySystemDriverInfo(JNIEnv* env, jstring j_hook_lib_dir) {
|
|
||||||
const std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir);
|
|
||||||
const Common::DynamicLibrary library{adrenotools_open_libvulkan(
|
|
||||||
RTLD_NOW, 0, nullptr, hook_lib_dir.c_str(), nullptr, nullptr, nullptr, nullptr)};
|
|
||||||
Vulkan::vk::InstanceDispatch dld;
|
|
||||||
const Vulkan::vk::Instance instance = Vulkan::CreateInstance(library, dld, VK_API_VERSION_1_1);
|
|
||||||
const std::vector<VkPhysicalDevice> devices = instance.EnumeratePhysicalDevices();
|
|
||||||
if (devices.empty()) {
|
|
||||||
throw Vulkan::vk::Exception(VK_ERROR_INITIALIZATION_FAILED);
|
|
||||||
}
|
|
||||||
SystemDriverInfo info{};
|
|
||||||
info.driver.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
|
|
||||||
VkPhysicalDeviceProperties2 properties2{
|
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
|
|
||||||
.pNext = &info.driver,
|
|
||||||
.properties = {},
|
|
||||||
};
|
|
||||||
Vulkan::vk::PhysicalDevice(devices[0], dld).GetProperties2(properties2);
|
|
||||||
info.properties = properties2.properties;
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo(
|
jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo(
|
||||||
JNIEnv* env, jobject j_obj, jobject j_surf, jstring j_hook_lib_dir) {
|
JNIEnv* env, jobject j_obj, jobject j_surf, jstring j_hook_lib_dir) {
|
||||||
std::string version_string{"1.1.0"};
|
std::string version_string{"1.1.0"};
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user