diff options
author | Liam <byteslice@airmail.cc> | 2023-03-16 16:56:51 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:43 +0200 |
commit | 616cf70a801ccf7c2312118d163185a8d341e517 (patch) | |
tree | 063170927625dfda9151bf20a5f2d44da6fc51b7 /src | |
parent | android: Use Skyline's document provider (diff) | |
download | yuzu-616cf70a801ccf7c2312118d163185a8d341e517.tar yuzu-616cf70a801ccf7c2312118d163185a8d341e517.tar.gz yuzu-616cf70a801ccf7c2312118d163185a8d341e517.tar.bz2 yuzu-616cf70a801ccf7c2312118d163185a8d341e517.tar.lz yuzu-616cf70a801ccf7c2312118d163185a8d341e517.tar.xz yuzu-616cf70a801ccf7c2312118d163185a8d341e517.tar.zst yuzu-616cf70a801ccf7c2312118d163185a8d341e517.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/android/app/build.gradle | 5 | ||||
-rw-r--r-- | src/android/app/src/main/jni/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/android/app/src/main/jni/native.cpp | 4 | ||||
-rw-r--r-- | src/video_core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_turbo_mode.cpp | 6 | ||||
-rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 4 | ||||
-rw-r--r-- | src/video_core/vulkan_common/vulkan_library.cpp | 2 |
7 files changed, 18 insertions, 10 deletions
diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle index 8b621f5d5..7e2717b11 100644 --- a/src/android/app/build.gradle +++ b/src/android/app/build.gradle @@ -10,7 +10,6 @@ plugins { */ def autoVersion = (int) (((new Date().getTime() / 1000) - 1451606400) / 10) def buildType -def abiFilter = "arm64-v8a" //, "x86" android { namespace 'org.yuzu.yuzu_emu' @@ -44,7 +43,7 @@ android { targetSdkVersion 33 versionCode autoVersion versionName getVersion() - ndk.abiFilters abiFilter + ndk.abiFilters "arm64-v8a", "x86_64" } signingConfigs { @@ -115,7 +114,7 @@ android { "-DYUZU_USE_BUNDLED_VCPKG=ON", "-DYUZU_USE_BUNDLED_FFMPEG=ON" - abiFilters abiFilter + abiFilters "arm64-v8a", "x86_64" } } } diff --git a/src/android/app/src/main/jni/CMakeLists.txt b/src/android/app/src/main/jni/CMakeLists.txt index f80c166f4..21c27d4ee 100644 --- a/src/android/app/src/main/jni/CMakeLists.txt +++ b/src/android/app/src/main/jni/CMakeLists.txt @@ -13,6 +13,9 @@ add_library(yuzu-android SHARED set_property(TARGET yuzu-android PROPERTY IMPORTED_LOCATION ${FFmpeg_LIBRARY_DIR}) target_link_libraries(yuzu-android PRIVATE audio_core common core input_common) -target_link_libraries(yuzu-android PRIVATE android camera2ndk EGL glad inih jnigraphics adrenotools log) +target_link_libraries(yuzu-android PRIVATE android camera2ndk EGL glad inih jnigraphics log) +if (ARCHITECTURE_arm64) + target_link_libraries(yuzu-android PRIVATE adrenotools) +endif() set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} yuzu-android) diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 3cfbec87c..6e670e899 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -7,7 +7,9 @@ #include <string_view> #include <dlfcn.h> +#ifdef ARCHITECTURE_arm64 #include <adrenotools/driver.h> +#endif #include <android/api-level.h> #include <android/native_window_jni.h> @@ -76,6 +78,7 @@ public: void InitializeGpuDriver(const std::string& hook_lib_dir, const std::string& custom_driver_dir, const std::string& custom_driver_name, const std::string& file_redirect_dir) { +#ifdef ARCHITECTURE_arm64 void* handle{}; const char* file_redirect_dir_{}; int featureFlags{}; @@ -101,6 +104,7 @@ public: } m_vulkan_library = std::make_shared<Common::DynamicLibrary>(handle); +#endif } bool IsRunning() const { diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 05aa5cfe2..94e3000ba 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -346,6 +346,6 @@ if (YUZU_ENABLE_LTO) set_property(TARGET video_core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) endif() -if (ANDROID) +if (ANDROID AND ARCHITECTURE_arm64) target_link_libraries(video_core PRIVATE adrenotools) endif() diff --git a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp index 29751e6b4..22dbf272e 100644 --- a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp +++ b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#ifdef ANDROID +#if defined(ANDROID) && defined(ARCHITECTURE_arm64) #include <adrenotools/driver.h> #endif @@ -148,7 +148,7 @@ void TurboMode::Run(std::stop_token stop_token) { auto cmdbuf = vk::CommandBuffer{cmdbufs[0], m_device.GetDispatchLoader()}; while (!stop_token.stop_requested()) { -#ifdef ANDROID +#if defined(ANDROID) && defined(ARCHITECTURE_arm64) adrenotools_set_turbo(true); #else // Reset the fence. @@ -224,7 +224,7 @@ void TurboMode::Run(std::stop_token stop_token) { std::chrono::milliseconds{100}; }); } -#ifdef ANDROID +#if defined(ANDROID) && defined(ARCHITECTURE_arm64) adrenotools_set_turbo(false); #endif } diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 06efa1a6c..9e2dee097 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -18,7 +18,7 @@ #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" -#ifdef ANDROID +#if defined(ANDROID) && defined(ARCHITECTURE_arm64) #include <adrenotools/bcenabler.h> #endif @@ -374,6 +374,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR extensions.push_descriptor = false; loaded_extensions.erase(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); +#ifdef ARCHITECTURE_arm64 // Patch the driver to enable BCn textures. const auto major = (properties.properties.driverVersion >> 24) << 2; const auto minor = (properties.properties.driverVersion >> 12) & 0xFFFU; @@ -391,6 +392,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR } else { LOG_WARNING(Render_Vulkan, "Adreno driver can't be patched to enable BCn textures"); } +#endif // ARCHITECTURE_arm64 } const bool is_arm = driver_id == VK_DRIVER_ID_ARM_PROPRIETARY; diff --git a/src/video_core/vulkan_common/vulkan_library.cpp b/src/video_core/vulkan_common/vulkan_library.cpp index 9a7d369f3..47f6f2a03 100644 --- a/src/video_core/vulkan_common/vulkan_library.cpp +++ b/src/video_core/vulkan_common/vulkan_library.cpp @@ -13,7 +13,7 @@ namespace Vulkan { std::shared_ptr<Common::DynamicLibrary> OpenLibrary( [[maybe_unused]] Core::Frontend::GraphicsContext* context) { LOG_DEBUG(Render_Vulkan, "Looking for a Vulkan library"); -#ifdef ANDROID +#if defined(ANDROID) && defined(ARCHITECTURE_arm64) // Android manages its Vulkan driver from the frontend. return context->GetDriverLibrary(); #else |