mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-20 06:37:54 -05:00
android: vulkan: Implement adrenotools turbo mode.
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <adrenotools/driver.h>
|
||||
#endif
|
||||
|
||||
#include "common/literals.h"
|
||||
#include "video_core/host_shaders/vulkan_turbo_mode_comp_spv.h"
|
||||
#include "video_core/renderer_vulkan/renderer_vulkan.h"
|
||||
@ -144,6 +148,9 @@ void TurboMode::Run(std::stop_token stop_token) {
|
||||
auto cmdbuf = vk::CommandBuffer{cmdbufs[0], m_device.GetDispatchLoader()};
|
||||
|
||||
while (!stop_token.stop_requested()) {
|
||||
#ifdef ANDROID
|
||||
adrenotools_set_turbo(true);
|
||||
#else
|
||||
// Reset the fence.
|
||||
fence.Reset();
|
||||
|
||||
@ -209,7 +216,7 @@ void TurboMode::Run(std::stop_token stop_token) {
|
||||
|
||||
// Wait for completion.
|
||||
fence.Wait();
|
||||
|
||||
#endif
|
||||
// Wait for the next graphics queue submission if necessary.
|
||||
std::unique_lock lk{m_submission_lock};
|
||||
Common::CondvarWait(m_submission_cv, lk, stop_token, [this] {
|
||||
@ -217,6 +224,9 @@ void TurboMode::Run(std::stop_token stop_token) {
|
||||
std::chrono::milliseconds{100};
|
||||
});
|
||||
}
|
||||
#ifdef ANDROID
|
||||
adrenotools_set_turbo(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Vulkan
|
||||
|
@ -681,7 +681,9 @@ bool Device::ShouldBoostClocks() const {
|
||||
driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE ||
|
||||
driver_id == VK_DRIVER_ID_MESA_RADV || driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS ||
|
||||
driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA;
|
||||
driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA ||
|
||||
driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_MESA_TURNIP;
|
||||
|
||||
const bool is_steam_deck = vendor_id == 0x1002 && device_id == 0x163F;
|
||||
|
||||
|
Reference in New Issue
Block a user