mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-27 11:28:58 +02:00
[android] Pipeline workers asigment slider
This commit is contained in:
parent
6d40943c85
commit
e67e3d86a5
6 changed files with 31 additions and 5 deletions
|
|
@ -67,7 +67,8 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
|
|||
MY_PAGE_APPLET("my_page_applet_mode"),
|
||||
INPUT_OVERLAY_AUTO_HIDE("input_overlay_auto_hide"),
|
||||
OVERLAY_GRID_SIZE("overlay_grid_size"),
|
||||
GPU_LOG_RING_BUFFER_SIZE("gpu_log_ring_buffer_size")
|
||||
GPU_LOG_RING_BUFFER_SIZE("gpu_log_ring_buffer_size"),
|
||||
ANDROID_PIPELINE_WORKERS("pipeline_worker_count")
|
||||
;
|
||||
|
||||
override fun getInt(needsGlobal: Boolean): Int = NativeConfig.getInt(key, needsGlobal)
|
||||
|
|
|
|||
|
|
@ -582,6 +582,16 @@ abstract class SettingsItem(
|
|||
units = "%"
|
||||
)
|
||||
)
|
||||
put(
|
||||
SliderSetting(
|
||||
IntSetting.ANDROID_PIPELINE_WORKERS,
|
||||
titleId = R.string.pipeline_worker_cores,
|
||||
descriptionId = R.string.pipeline_worker_cores_description,
|
||||
min = 4,
|
||||
max = 8,
|
||||
units = "cores"
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.RENDERER_ANTI_ALIASING,
|
||||
|
|
|
|||
|
|
@ -294,6 +294,7 @@ class SettingsFragmentPresenter(
|
|||
add(BooleanSetting.FIX_BLOOM_EFFECTS.key)
|
||||
add(BooleanSetting.EMULATE_BGR565.key)
|
||||
add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key)
|
||||
add(IntSetting.ANDROID_PIPELINE_WORKERS.key)
|
||||
add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key)
|
||||
add(BooleanSetting.RENDERER_ASYNC_PRESENTATION.key)
|
||||
add(SettingsItem.GPU_UNSWIZZLE_COMBINED)
|
||||
|
|
|
|||
|
|
@ -147,6 +147,13 @@ namespace AndroidSettings {
|
|||
&show_performance_overlay};
|
||||
|
||||
|
||||
Settings::Setting<s32> pipeline_worker_count{linkage, 4, "pipeline_worker_count",
|
||||
Settings::Category::Android,
|
||||
Settings::Specialization::Default,
|
||||
true,
|
||||
true};
|
||||
|
||||
|
||||
Settings::Setting<bool> show_input_overlay{linkage, true, "show_input_overlay",
|
||||
Settings::Category::Overlay};
|
||||
Settings::Setting<bool> overlay_snap_to_grid{linkage, false, "overlay_snap_to_grid",
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@
|
|||
<string name="show_power_info_description">Display current power draw and remaining capacity on battery</string>
|
||||
<string name="show_shaders_building">Show Shaders Building</string>
|
||||
<string name="show_shaders_building_description">Display current number of shaders being built</string>
|
||||
<string name="pipeline_worker_cores">Pipeline Worker Threads</string>
|
||||
<string name="pipeline_worker_cores_description">Manage the amount of cores used for building Vulkan pipelines, the higher value will improve pipeline compilation performance but temperatures will increase as well.</string>
|
||||
<string name="overlay_position">Overlay Position</string>
|
||||
<string name="overlay_position_description">Choose where the overlay is displayed on the screen</string>
|
||||
<string name="overlay_position_top_left">Top Left</string>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@
|
|||
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
||||
#include "video_core/gpu_logging/gpu_logging.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#include "android_settings.h"
|
||||
#endif
|
||||
|
||||
namespace Vulkan {
|
||||
|
||||
namespace {
|
||||
|
|
@ -325,12 +329,13 @@ size_t GetTotalPipelineWorkers() {
|
|||
const size_t max_core_threads =
|
||||
std::max<size_t>(static_cast<size_t>(std::thread::hardware_concurrency()), 2ULL) - 1ULL;
|
||||
#ifdef ANDROID
|
||||
// Leave at least 3 cores free on Android to avoid stalling the system.
|
||||
constexpr size_t free_cores = 3ULL;
|
||||
if (max_core_threads <= free_cores) {
|
||||
const int configured = AndroidSettings::values.pipeline_worker_count.GetValue();
|
||||
const int clamped = std::clamp(configured, 4, 8);
|
||||
const size_t desired = static_cast<size_t>(clamped);
|
||||
if (desired == 0) {
|
||||
return 1ULL;
|
||||
}
|
||||
return max_core_threads - free_cores;
|
||||
return std::min(max_core_threads, desired);
|
||||
#else
|
||||
return max_core_threads;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue