build: only enable adrenotools on arm64

This commit is contained in:
Liam 2023-03-16 11:56:51 -04:00 committed by bunnei
parent 515f3deea1
commit 616cf70a80
9 changed files with 33 additions and 15 deletions

View file

@ -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()

View file

@ -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
}

View file

@ -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;

View file

@ -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