mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-25 00:40:32 +00:00
DynamicRendering + Pipeline Worker Thread toggles
This commit is contained in:
+1
@@ -36,6 +36,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||
RENDERER_DEBUG("debug"),
|
||||
RENDERER_PATCH_OLD_QCOM_DRIVERS("patch_old_qcom_drivers"),
|
||||
RENDERER_VERTEX_INPUT_DYNAMIC_STATE("vertex_input_dynamic_state"),
|
||||
RENDERER_DYNAMIC_RENDERING("dynamic_rendering"),
|
||||
RENDERER_SAMPLE_SHADING("sample_shading"),
|
||||
GPU_UNSWIZZLE_ENABLED("gpu_unswizzle_enabled"),
|
||||
PICTURE_IN_PICTURE("picture_in_picture"),
|
||||
|
||||
+7
@@ -155,6 +155,13 @@ abstract class SettingsItem(
|
||||
descriptionId = R.string.vertex_input_dynamic_state_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RENDERER_DYNAMIC_RENDERING,
|
||||
titleId = R.string.dynamic_rendering,
|
||||
descriptionId = R.string.dynamic_rendering_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SliderSetting(
|
||||
IntSetting.RENDERER_SAMPLE_SHADING,
|
||||
|
||||
+1
@@ -313,6 +313,7 @@ class SettingsFragmentPresenter(
|
||||
|
||||
add(IntSetting.RENDERER_DYNA_STATE.key)
|
||||
add(BooleanSetting.RENDERER_VERTEX_INPUT_DYNAMIC_STATE.key)
|
||||
add(BooleanSetting.RENDERER_DYNAMIC_RENDERING.key)
|
||||
add(IntSetting.RENDERER_SAMPLE_SHADING.key)
|
||||
|
||||
add(HeaderSetting(R.string.display))
|
||||
|
||||
@@ -147,13 +147,6 @@ namespace AndroidSettings {
|
||||
&show_performance_overlay};
|
||||
|
||||
|
||||
Settings::Setting<s32> pipeline_worker_count{linkage, 2, "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",
|
||||
|
||||
@@ -544,6 +544,8 @@
|
||||
<string name="disabled">Disabled</string>
|
||||
<string name="vertex_input_dynamic_state">Vertex Input Dynamic State</string>
|
||||
<string name="vertex_input_dynamic_state_description">Enabling this feature allows for more flexible vertex input handling, potentially reducing pipeline compilation time in vertex/buffer.</string>
|
||||
<string name="dynamic_rendering">Dynamic Rendering</string>
|
||||
<string name="dynamic_rendering_description">Render without render pass and framebuffer objects. Results vary by driver: some gain performance, others lose it.</string>
|
||||
<string name="sample_shading_fraction">Sample Shading</string>
|
||||
<string name="sample_shading_fraction_description">Allows the fragment shader to execute per sample in a multi-sampled fragment instead once per fragment. Improves graphics quality at the cost of some performance.</string>
|
||||
|
||||
|
||||
@@ -635,6 +635,13 @@ struct Values {
|
||||
#endif
|
||||
"vertex_input_dynamic_state", Category::RendererExtensions};
|
||||
|
||||
SwitchableSetting<bool> dynamic_rendering{linkage, true, "dynamic_rendering",
|
||||
Category::RendererExtensions};
|
||||
|
||||
SwitchableSetting<s32, true> pipeline_worker_count{
|
||||
linkage, 2, 2, 8, "pipeline_worker_count", Category::RendererAdvanced,
|
||||
Specialization::Scalar};
|
||||
|
||||
Setting<bool> renderer_debug{linkage, false, "debug", Category::RendererDebug};
|
||||
Setting<bool> renderer_shader_feedback{linkage, false, "shader_feedback",
|
||||
Category::RendererDebug};
|
||||
|
||||
@@ -230,6 +230,9 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) {
|
||||
tr("Preserves GPU-modified data by reading it back before uploading.\nSome games require this to render certain effects properly."));
|
||||
INSERT(Settings, use_asynchronous_shaders, tr("Enable asynchronous shader compilation"),
|
||||
tr("May reduce shader stutter."));
|
||||
INSERT(Settings, pipeline_worker_count, tr("Pipeline Worker Threads"),
|
||||
tr("Number of threads used to build Vulkan pipelines.\n"
|
||||
"Higher values speed up compilation at the cost of heat and power."));
|
||||
INSERT(Settings, fast_gpu_time, tr("Fast GPU Time"),
|
||||
tr("Overclocks the emulated GPU to increase dynamic resolution and render "
|
||||
"distance.\nUse 256 for maximal performance and 512 for maximal graphics fidelity."));
|
||||
@@ -287,6 +290,10 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) {
|
||||
INSERT(Settings, vertex_input_dynamic_state, tr("Vertex Input Dynamic State"),
|
||||
tr("Enables vertex input dynamic state feature for better quality and performance."));
|
||||
|
||||
INSERT(Settings, dynamic_rendering, tr("Dynamic Rendering"),
|
||||
tr("Renders without render pass and framebuffer objects.\n"
|
||||
"Results vary by driver: some gain performance, others lose it."));
|
||||
|
||||
INSERT(
|
||||
Settings, sample_shading, tr("Sample Shading"),
|
||||
tr("Allows the fragment shader to execute per sample in a multi-sampled fragment "
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "common/cityhash.h"
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/thread_worker.h"
|
||||
#include "core/core.h"
|
||||
#include "shader_recompiler/backend/spirv/emit_spirv.h"
|
||||
@@ -45,10 +46,6 @@
|
||||
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
||||
#include "video_core/gpu_logging/gpu_logging.h"
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include "../../android/app/src/main/jni/android_settings.h"
|
||||
#endif
|
||||
|
||||
namespace Vulkan {
|
||||
|
||||
namespace {
|
||||
@@ -306,12 +303,8 @@ 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__
|
||||
const int configured = AndroidSettings::values.pipeline_worker_count.GetValue();
|
||||
const int clamped = std::clamp(configured, 2, 8);
|
||||
const size_t desired = static_cast<size_t>(clamped);
|
||||
if (desired == 0) {
|
||||
return 1ULL;
|
||||
}
|
||||
const s32 configured = Settings::values.pipeline_worker_count.GetValue();
|
||||
const size_t desired = static_cast<size_t>(std::clamp(configured, 2, 8));
|
||||
return std::min(max_core_threads, desired);
|
||||
#else
|
||||
return max_core_threads;
|
||||
|
||||
@@ -1534,6 +1534,10 @@ void Device::RemoveUnsuitableExtensions() {
|
||||
RemoveExtensionIfUnsuitable(extensions.maintenance3, VK_KHR_MAINTENANCE_3_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_dynamic_rendering
|
||||
if (!Settings::values.dynamic_rendering.GetValue()) {
|
||||
LOG_INFO(Render_Vulkan, "Dynamic rendering disabled by user setting");
|
||||
features.dynamic_rendering.dynamicRendering = false;
|
||||
}
|
||||
extensions.dynamic_rendering = features.dynamic_rendering.dynamicRendering;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.dynamic_rendering, features.dynamic_rendering,
|
||||
VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME);
|
||||
|
||||
Reference in New Issue
Block a user