[video_core] Add option to control the DMA precision level at runtime #304

Merged
Shinmegumi merged 6 commits from dma-feature into master 2025-08-23 19:42:11 +02:00
2 changed files with 17 additions and 18 deletions
Showing only changes of commit 201ad66e8f - Show all commits

View file

@ -427,17 +427,19 @@ struct Values {
Specialization::Default,
true,
true};
GpuAccuracy current_gpu_accuracy{GpuAccuracy::High};
SwitchableSetting<DmaAccuracy, true> dma_accuracy{linkage,
DmaAccuracy::Default,
MaranBr marked this conversation as resolved

remove the high since for ranged settings you only need upper and lower bound

DmaAccuracy::Default, // default
DmaAccuracy::Default, // min
DmaAccuracy::Extreme, // max
remove the high since for ranged settings you only need upper and lower bound ```cpp DmaAccuracy::Default, // default DmaAccuracy::Default, // min DmaAccuracy::Extreme, // max ```
DmaAccuracy::Normal,
DmaAccuracy::High,
DmaAccuracy::Default,
DmaAccuracy::Extreme,
"dma_accuracy",
Category::RendererAdvanced,
Specialization::Default,
true,
true};
SwitchableSetting<AnisotropyMode, true> max_anisotropy{linkage,
#ifdef ANDROID
AnisotropyMode::Default,

View file

@ -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