android: vulkan: Implement adrenotools turbo mode.
This commit is contained in:
parent
21320d80d9
commit
8248d69093
|
@ -160,12 +160,14 @@ public final class SettingsFragmentPresenter {
|
|||
Setting rendererAccuracy = rendererSection.getSetting(SettingsFile.KEY_RENDERER_ACCURACY);
|
||||
Setting rendererReolution = rendererSection.getSetting(SettingsFile.KEY_RENDERER_RESOLUTION);
|
||||
Setting rendererAspectRation = rendererSection.getSetting(SettingsFile.KEY_RENDERER_ASPECT_RATIO);
|
||||
Setting rendererForceMaxClocks = rendererSection.getSetting(SettingsFile.KEY_RENDERER_FORCE_MAX_CLOCK);
|
||||
Setting rendererAsynchronousShaders = rendererSection.getSetting(SettingsFile.KEY_RENDERER_ASYNCHRONOUS_SHADERS);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_BACKEND, Settings.SECTION_RENDERER, R.string.renderer_api, 0, R.array.rendererApiNames, R.array.rendererApiValues, 1, rendererBackend));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_ACCURACY, Settings.SECTION_RENDERER, R.string.renderer_accuracy, 0, R.array.rendererAccuracyNames, R.array.rendererAccuracyValues, 1, rendererAccuracy));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_RESOLUTION, Settings.SECTION_RENDERER, R.string.renderer_resolution, 0, R.array.rendererResolutionNames, R.array.rendererResolutionValues, 2, rendererReolution));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_ASPECT_RATIO, Settings.SECTION_RENDERER, R.string.renderer_aspect_ratio, 0, R.array.rendererAspectRatioNames, R.array.rendererAspectRatioValues, 0, rendererAspectRation));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_RENDERER_FORCE_MAX_CLOCK, Settings.SECTION_RENDERER, R.string.renderer_force_max_clock, R.string.renderer_force_max_clock_description, true, rendererForceMaxClocks));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_RENDERER_ASYNCHRONOUS_SHADERS, Settings.SECTION_RENDERER, R.string.renderer_asynchronous_shaders, R.string.renderer_asynchronous_shaders_description, false, rendererAsynchronousShaders));
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public final class SettingsFile {
|
|||
public static final String KEY_RENDERER_ASPECT_RATIO = "aspect_ratio";
|
||||
public static final String KEY_RENDERER_ACCURACY = "gpu_accuracy";
|
||||
public static final String KEY_RENDERER_ASYNCHRONOUS_SHADERS = "use_asynchronous_shaders";
|
||||
public static final String KEY_RENDERER_FORCE_MAX_CLOCK = "force_max_clock";
|
||||
public static final String KEY_RENDERER_USE_SPEED_LIMIT = "use_speed_limit";
|
||||
public static final String KEY_RENDERER_SPEED_LIMIT = "speed_limit";
|
||||
// Audio
|
||||
|
|
|
@ -192,7 +192,6 @@ void Config::ReadValues() {
|
|||
|
||||
// Renderer
|
||||
ReadSetting("Renderer", Settings::values.renderer_backend);
|
||||
ReadSetting("Renderer", Settings::values.renderer_force_max_clock);
|
||||
ReadSetting("Renderer", Settings::values.renderer_debug);
|
||||
ReadSetting("Renderer", Settings::values.renderer_shader_feedback);
|
||||
ReadSetting("Renderer", Settings::values.enable_nsight_aftermath);
|
||||
|
@ -223,6 +222,10 @@ void Config::ReadValues() {
|
|||
ReadSetting("Renderer", Settings::values.bg_green);
|
||||
ReadSetting("Renderer", Settings::values.bg_blue);
|
||||
|
||||
// Enable force_max_clock by default on Android
|
||||
Settings::values.renderer_force_max_clock =
|
||||
config->GetBoolean("Renderer", "force_max_clock", true);
|
||||
|
||||
// Audio
|
||||
ReadSetting("Audio", Settings::values.sink_id);
|
||||
ReadSetting("Audio", Settings::values.audio_output_device_id);
|
||||
|
|
|
@ -247,6 +247,10 @@ cpuopt_unsafe_ignore_global_monitor =
|
|||
# 0: OpenGL (unsupported), 1 (default): Vulkan, 2: Null
|
||||
backend =
|
||||
|
||||
# Enable graphics API debugging mode.
|
||||
# 0 (default): Disabled, 1: Enabled
|
||||
force_max_clock =
|
||||
|
||||
# Enable graphics API debugging mode.
|
||||
# 0 (default): Disabled, 1: Enabled
|
||||
debug =
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
<string name="renderer_accuracy">Accuracy level</string>
|
||||
<string name="renderer_resolution">Resolution</string>
|
||||
<string name="renderer_aspect_ratio">Aspect Ratio</string>
|
||||
<string name="renderer_force_max_clock">Force maximum clocks (Adreno only)</string>
|
||||
<string name="renderer_force_max_clock_description">Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).</string>
|
||||
<string name="renderer_asynchronous_shaders">Use asynchronous shaders</string>
|
||||
<string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously, which will reduce stutter but may introduce glitches.</string>
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue