return release early fences
This commit is contained in:
parent
19e2dba35a
commit
aaefd54b45
|
|
@ -23,6 +23,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
|||
RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"),
|
||||
RENDERER_FORCE_MAX_CLOCK("force_max_clock"),
|
||||
RENDERER_ASYNCHRONOUS_SHADERS("use_asynchronous_shaders"),
|
||||
RENDERER_EARLY_RELEASE_FENCES("early_release_fences"),
|
||||
RENDERER_REACTIVE_FLUSHING("use_reactive_flushing"),
|
||||
ENABLE_BUFFER_HISTORY("enable_buffer_history"),
|
||||
SYNC_MEMORY_OPERATIONS("sync_memory_operations"),
|
||||
|
|
|
|||
|
|
@ -679,6 +679,13 @@ abstract class SettingsItem(
|
|||
descriptionId = R.string.renderer_asynchronous_shaders_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RENDERER_EARLY_RELEASE_FENCES,
|
||||
titleId = R.string.renderer_early_release_fences,
|
||||
descriptionId = R.string.renderer_early_release_fences_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.FAST_GPU_TIME,
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ class SettingsFragmentPresenter(
|
|||
add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key)
|
||||
add(BooleanSetting.FIX_BLOOM_EFFECTS.key)
|
||||
add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key)
|
||||
add(BooleanSetting.RENDERER_EARLY_RELEASE_FENCES.key)
|
||||
add(SettingsItem.GPU_UNSWIZZLE_COMBINED)
|
||||
|
||||
add(HeaderSetting(R.string.extensions))
|
||||
|
|
|
|||
|
|
@ -510,6 +510,8 @@
|
|||
<string name="fix_bloom_effects_description">Reduces bloom blur in LA/EOW (Adreno 700), removes bloom in Burnout. Warning: may cause graphical artifacts in other games.</string>
|
||||
<string name="renderer_asynchronous_shaders">Use asynchronous shaders</string>
|
||||
<string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously. This may reduce stutters but may also introduce glitches.</string>
|
||||
<string name="renderer_early_release_fences">Release Fences Early</string>
|
||||
<string name="renderer_early_release_fences_description">Fixes crashes and freezes in some games, may cause issues with Unreal Engine games.</string>
|
||||
<string name="gpu_unswizzle_settings">GPU Unswizzle Settings</string>
|
||||
<string name="gpu_unswizzle_settings_description">Configure GPU-based texture unswizzling parameters or disable it entirely. Adjust these settings to balance performance and texture loading quality.</string>
|
||||
<string name="gpu_unswizzle_enable">Enable GPU Unswizzle</string>
|
||||
|
|
|
|||
|
|
@ -546,6 +546,16 @@ struct Values {
|
|||
SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
|
||||
Category::RendererHacks};
|
||||
|
||||
#ifdef ANDROID
|
||||
SwitchableSetting<bool> early_release_fences{linkage,
|
||||
false,
|
||||
"early_release_fences",
|
||||
Category::RendererAdvanced,
|
||||
Specialization::Default,
|
||||
true,
|
||||
true};
|
||||
#endif
|
||||
|
||||
SwitchableSetting<GpuUnswizzleSize> gpu_unswizzle_texture_size{linkage,
|
||||
GpuUnswizzleSize::Large,
|
||||
"gpu_unswizzle_texture_size",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -72,16 +72,27 @@ public:
|
|||
}
|
||||
|
||||
void SignalFence(std::function<void()>&& func) {
|
||||
if constexpr (!can_async_check) {
|
||||
TryReleasePendingFences<false>();
|
||||
}
|
||||
#ifdef ANDROID
|
||||
const bool early_release_fences = Settings::values.early_release_fences.GetValue();
|
||||
#else
|
||||
constexpr bool early_release_fences = false;
|
||||
#endif
|
||||
const bool should_flush = ShouldFlush();
|
||||
const bool delay_fence = Settings::IsGPULevelHigh() || (Settings::IsGPULevelMedium() && should_flush);
|
||||
if (!can_async_check || (!delay_fence && early_release_fences)) {
|
||||
TryReleasePendingFences<false>();
|
||||
}
|
||||
CommitAsyncFlushes();
|
||||
TFence new_fence = CreateFence(!should_flush);
|
||||
if (!early_release_fences){
|
||||
if constexpr (can_async_check) {
|
||||
guard.lock();
|
||||
}
|
||||
} else {
|
||||
if (delay_fence) {
|
||||
guard.lock();
|
||||
}
|
||||
}
|
||||
if (delay_fence) {
|
||||
uncommitted_operations.emplace_back(std::move(func));
|
||||
}
|
||||
|
|
@ -94,10 +105,17 @@ public:
|
|||
if (should_flush) {
|
||||
rasterizer.FlushCommands();
|
||||
}
|
||||
if (!early_release_fences){
|
||||
if constexpr (can_async_check) {
|
||||
guard.unlock();
|
||||
cv.notify_all();
|
||||
}
|
||||
} else {
|
||||
if (delay_fence) {
|
||||
guard.unlock();
|
||||
cv.notify_all();
|
||||
}
|
||||
}
|
||||
rasterizer.InvalidateGPUCache();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -243,7 +243,11 @@ void MasterSemaphore::WaitThread(std::stop_token token) {
|
|||
free_queue.push_front(std::move(fence));
|
||||
gpu_tick.store(host_tick, std::memory_order_release);
|
||||
}
|
||||
#ifdef ANDROID
|
||||
free_cv.notify_all();
|
||||
#else
|
||||
free_cv.notify_one();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue