From 201ad66e8fd6faa375c9eca45f8f3594e5926f71 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 22 Aug 2025 22:19:52 -0400 Subject: [PATCH] fix comp + make code slightly easier to read Signed-off-by: crueter --- src/common/settings.h | 6 ++++-- src/video_core/dma_pusher.cpp | 29 +++++++++++++---------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/common/settings.h b/src/common/settings.h index 51fe9d8d6a..01e391d501 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -427,17 +427,19 @@ struct Values { Specialization::Default, true, true}; + GpuAccuracy current_gpu_accuracy{GpuAccuracy::High}; + SwitchableSetting dma_accuracy{linkage, DmaAccuracy::Default, - DmaAccuracy::Normal, - DmaAccuracy::High, + DmaAccuracy::Default, DmaAccuracy::Extreme, "dma_accuracy", Category::RendererAdvanced, Specialization::Default, true, true}; + SwitchableSetting max_anisotropy{linkage, #ifdef ANDROID AnisotropyMode::Default, diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index fa8c438b6c..4b9a506cdf 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp @@ -102,29 +102,26 @@ bool DmaPusher::Step() { ProcessCommands(headers); }; - if (Settings::values.current_gpu_accuracy == DmaAccuracy::Extreme) { + const Settings::DmaAccuracy accuracy = Settings::values.dma_accuracy.GetValue(); + const bool use_gpu_accuracy = accuracy == Settings::DmaAccuracy::Default; + + // reduces eye bleeding but also macros are dumb so idk +#define CHECK_LEVEL(level) use_gpu_accuracy ? Settings::IsGPULevel##level() : accuracy == Settings::DmaAccuracy::level; + const bool force_safe = CHECK_LEVEL(Extreme) + const bool unsafe_compute = CHECK_LEVEL(High) +#undef CHECK_LEVEL + + if (force_safe) { safe_process(); - } else if (Settings::values.current_gpu_accuracy == DmaAccuracy::High) { + } else if (unsafe_compute) { if (dma_state.method >= MacroRegistersStart) { unsafe_process(); } else { safe_process(); } - } else if (Settings::values.current_gpu_accuracy == DmaAccuracy::Normal) { + } else { unsafe_process(); - } else if (Settings::values.current_gpu_accuracy == DmaAccuracy::Default) { - if (Settings::IsGPULevelExtreme()) { - safe_process(); - } else if (Settings::IsGPULevelHigh()) { - if (dma_state.method >= MacroRegistersStart) { - unsafe_process(); - } else { - safe_process(); - } - } else { - unsafe_process(); - } - } + } if (dma_pushbuffer_subindex >= command_list.command_lists.size()) { // We've gone through the current list, remove it from the queue