diff options
| author | 2023-02-19 02:19:21 -0800 | |
|---|---|---|
| committer | 2023-06-03 00:05:32 -0700 | |
| commit | 8248d690935dbd2df8294c75360348a07a30afed (patch) | |
| tree | 28a0dd2e9ef6f09ebfc221b895a8b9230e53fab0 /src/video_core | |
| parent | android: vulkan_device: Disable VK_EXT_extended_dynamic_state2 on Qualcomm. (diff) | |
| download | yuzu-8248d690935dbd2df8294c75360348a07a30afed.tar.gz yuzu-8248d690935dbd2df8294c75360348a07a30afed.tar.xz yuzu-8248d690935dbd2df8294c75360348a07a30afed.zip | |
android: vulkan: Implement adrenotools turbo mode.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_turbo_mode.cpp | 12 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp index db04943eb..29751e6b4 100644 --- a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp +++ b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #ifdef ANDROID | ||
| 5 | #include <adrenotools/driver.h> | ||
| 6 | #endif | ||
| 7 | |||
| 4 | #include "common/literals.h" | 8 | #include "common/literals.h" |
| 5 | #include "video_core/host_shaders/vulkan_turbo_mode_comp_spv.h" | 9 | #include "video_core/host_shaders/vulkan_turbo_mode_comp_spv.h" |
| 6 | #include "video_core/renderer_vulkan/renderer_vulkan.h" | 10 | #include "video_core/renderer_vulkan/renderer_vulkan.h" |
| @@ -144,6 +148,9 @@ void TurboMode::Run(std::stop_token stop_token) { | |||
| 144 | auto cmdbuf = vk::CommandBuffer{cmdbufs[0], m_device.GetDispatchLoader()}; | 148 | auto cmdbuf = vk::CommandBuffer{cmdbufs[0], m_device.GetDispatchLoader()}; |
| 145 | 149 | ||
| 146 | while (!stop_token.stop_requested()) { | 150 | while (!stop_token.stop_requested()) { |
| 151 | #ifdef ANDROID | ||
| 152 | adrenotools_set_turbo(true); | ||
| 153 | #else | ||
| 147 | // Reset the fence. | 154 | // Reset the fence. |
| 148 | fence.Reset(); | 155 | fence.Reset(); |
| 149 | 156 | ||
| @@ -209,7 +216,7 @@ void TurboMode::Run(std::stop_token stop_token) { | |||
| 209 | 216 | ||
| 210 | // Wait for completion. | 217 | // Wait for completion. |
| 211 | fence.Wait(); | 218 | fence.Wait(); |
| 212 | 219 | #endif | |
| 213 | // Wait for the next graphics queue submission if necessary. | 220 | // Wait for the next graphics queue submission if necessary. |
| 214 | std::unique_lock lk{m_submission_lock}; | 221 | std::unique_lock lk{m_submission_lock}; |
| 215 | Common::CondvarWait(m_submission_cv, lk, stop_token, [this] { | 222 | Common::CondvarWait(m_submission_cv, lk, stop_token, [this] { |
| @@ -217,6 +224,9 @@ void TurboMode::Run(std::stop_token stop_token) { | |||
| 217 | std::chrono::milliseconds{100}; | 224 | std::chrono::milliseconds{100}; |
| 218 | }); | 225 | }); |
| 219 | } | 226 | } |
| 227 | #ifdef ANDROID | ||
| 228 | adrenotools_set_turbo(false); | ||
| 229 | #endif | ||
| 220 | } | 230 | } |
| 221 | 231 | ||
| 222 | } // namespace Vulkan | 232 | } // namespace Vulkan |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 79686a176..70ee60a96 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -681,7 +681,9 @@ bool Device::ShouldBoostClocks() const { | |||
| 681 | driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE || | 681 | driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE || |
| 682 | driver_id == VK_DRIVER_ID_MESA_RADV || driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY || | 682 | driver_id == VK_DRIVER_ID_MESA_RADV || driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY || |
| 683 | driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS || | 683 | driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS || |
| 684 | driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA; | 684 | driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA || |
| 685 | driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || | ||
| 686 | driver_id == VK_DRIVER_ID_MESA_TURNIP; | ||
| 685 | 687 | ||
| 686 | const bool is_steam_deck = vendor_id == 0x1002 && device_id == 0x163F; | 688 | const bool is_steam_deck = vendor_id == 0x1002 && device_id == 0x163F; |
| 687 | 689 | ||