android: vulkan: Implement adrenotools turbo mode.
This commit is contained in:
parent
21320d80d9
commit
8248d69093
7 changed files with 27 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue