mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 08:15:46 +00:00
[Rasterizer]: Implement "Skip CPU Inner Invalidation" hack
This commit is contained in:
parent
693404bf37
commit
3e44389bfc
7 changed files with 28 additions and 2 deletions
|
@ -17,6 +17,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||||
RENDERER_USE_SPEED_LIMIT("use_speed_limit"),
|
RENDERER_USE_SPEED_LIMIT("use_speed_limit"),
|
||||||
USE_FAST_CPU_TIME("use_fast_cpu_time"),
|
USE_FAST_CPU_TIME("use_fast_cpu_time"),
|
||||||
USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"),
|
USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"),
|
||||||
|
SKIP_CPU_INNER_INVALIDATION("skip_cpu_inner_invalidation"),
|
||||||
USE_DOCKED_MODE("use_docked_mode"),
|
USE_DOCKED_MODE("use_docked_mode"),
|
||||||
USE_AUTO_STUB("use_auto_stub"),
|
USE_AUTO_STUB("use_auto_stub"),
|
||||||
RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"),
|
RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"),
|
||||||
|
|
|
@ -655,6 +655,13 @@ abstract class SettingsItem(
|
||||||
max = 65535
|
max = 65535
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
put(
|
||||||
|
SwitchSetting(
|
||||||
|
BooleanSetting.SKIP_CPU_INNER_INVALIDATION,
|
||||||
|
titleId = R.string.skip_cpu_inner_invalidation,
|
||||||
|
descriptionId = R.string.skip_cpu_inner_invalidation_description
|
||||||
|
)
|
||||||
|
)
|
||||||
put(
|
put(
|
||||||
SwitchSetting(
|
SwitchSetting(
|
||||||
BooleanSetting.RENDERER_REACTIVE_FLUSHING,
|
BooleanSetting.RENDERER_REACTIVE_FLUSHING,
|
||||||
|
|
|
@ -463,6 +463,7 @@ class SettingsFragmentPresenter(
|
||||||
add(IntSetting.FAST_CPU_TIME.key)
|
add(IntSetting.FAST_CPU_TIME.key)
|
||||||
add(BooleanSetting.USE_CUSTOM_CPU_TICKS.key)
|
add(BooleanSetting.USE_CUSTOM_CPU_TICKS.key)
|
||||||
add(IntSetting.CPU_TICKS.key)
|
add(IntSetting.CPU_TICKS.key)
|
||||||
|
add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key)
|
||||||
add(BooleanSetting.USE_LRU_CACHE.key)
|
add(BooleanSetting.USE_LRU_CACHE.key)
|
||||||
add(BooleanSetting.CORE_SYNC_CORE_SPEED.key)
|
add(BooleanSetting.CORE_SYNC_CORE_SPEED.key)
|
||||||
add(IntSetting.MEMORY_LAYOUT.key)
|
add(IntSetting.MEMORY_LAYOUT.key)
|
||||||
|
|
|
@ -104,6 +104,8 @@
|
||||||
<string name="custom_cpu_ticks">Custom CPU Ticks</string>
|
<string name="custom_cpu_ticks">Custom CPU Ticks</string>
|
||||||
<string name="custom_cpu_ticks_description">Set a custom value of CPU ticks. Higher values can increase performance, but may also cause the game to freeze. A range of 77–21000 is recommended.</string>
|
<string name="custom_cpu_ticks_description">Set a custom value of CPU ticks. Higher values can increase performance, but may also cause the game to freeze. A range of 77–21000 is recommended.</string>
|
||||||
<string name="cpu_ticks">Ticks</string>
|
<string name="cpu_ticks">Ticks</string>
|
||||||
|
<string name="skip_cpu_inner_invalidation">Skip CPU Inner Invalidation</string>
|
||||||
|
<string name="skip_cpu_inner_invalidation_description">Skips certain CPU-side cache invalidations during memory updates, reducing CPU usage and improving it's performance. This may cause glitches or crashes on some games.</string>
|
||||||
<string name="fast_cpu_time">CPU Clock</string>
|
<string name="fast_cpu_time">CPU Clock</string>
|
||||||
<string name="fast_cpu_time_description">Use Boost (1700MHz) to run at the Switch\'s highest native clock, or Fast (2000MHz) to run at 2x clock.</string>
|
<string name="fast_cpu_time_description">Use Boost (1700MHz) to run at the Switch\'s highest native clock, or Fast (2000MHz) to run at 2x clock.</string>
|
||||||
<string name="memory_layout">Memory Layout</string>
|
<string name="memory_layout">Memory Layout</string>
|
||||||
|
|
|
@ -450,6 +450,13 @@ struct Values {
|
||||||
VramUsageMode::Aggressive,
|
VramUsageMode::Aggressive,
|
||||||
"vram_usage_mode",
|
"vram_usage_mode",
|
||||||
Category::RendererAdvanced};
|
Category::RendererAdvanced};
|
||||||
|
SwitchableSetting<bool> skip_cpu_inner_invalidation{linkage,
|
||||||
|
true,
|
||||||
|
"skip_cpu_inner_invalidation",
|
||||||
|
Category::RendererAdvanced,
|
||||||
|
Specialization::Default,
|
||||||
|
true,
|
||||||
|
true};
|
||||||
SwitchableSetting<bool> async_presentation{linkage,
|
SwitchableSetting<bool> async_presentation{linkage,
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/polyfill_thread.h"
|
#include "common/polyfill_thread.h"
|
||||||
|
#include "common/settings.h"
|
||||||
#include "video_core/cache_types.h"
|
#include "video_core/cache_types.h"
|
||||||
#include "video_core/engines/fermi_2d.h"
|
#include "video_core/engines/fermi_2d.h"
|
||||||
#include "video_core/gpu.h"
|
#include "video_core/gpu.h"
|
||||||
|
@ -100,8 +101,10 @@ public:
|
||||||
VideoCommon::CacheType which = VideoCommon::CacheType::All) = 0;
|
VideoCommon::CacheType which = VideoCommon::CacheType::All) = 0;
|
||||||
|
|
||||||
virtual void InnerInvalidation(std::span<const std::pair<DAddr, std::size_t>> sequences) {
|
virtual void InnerInvalidation(std::span<const std::pair<DAddr, std::size_t>> sequences) {
|
||||||
for (const auto& [cpu_addr, size] : sequences) {
|
if (!Settings::values.skip_cpu_inner_invalidation.GetValue()) {
|
||||||
InvalidateRegion(cpu_addr, size);
|
for (const auto& [cpu_addr, size] : sequences) {
|
||||||
|
InvalidateRegion(cpu_addr, size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,11 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent)
|
||||||
"of available video memory for performance. Has no effect on integrated graphics. "
|
"of available video memory for performance. Has no effect on integrated graphics. "
|
||||||
"Aggressive mode may severely impact the performance of other applications such as "
|
"Aggressive mode may severely impact the performance of other applications such as "
|
||||||
"recording software."));
|
"recording software."));
|
||||||
|
INSERT(Settings,
|
||||||
|
skip_cpu_inner_invalidation,
|
||||||
|
tr("Skip CPU Inner Invalidation"),
|
||||||
|
tr("Skips certain CPU-side cache invalidations during memory updates, reducing CPU usage and "
|
||||||
|
"improving it's performance. This may cause glitches or crashes on some games."));
|
||||||
INSERT(
|
INSERT(
|
||||||
Settings,
|
Settings,
|
||||||
vsync_mode,
|
vsync_mode,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue