[android] Early release fences option fix

This commit is contained in:
Pavel Barabanov 2025-07-30 23:22:46 +03:00
parent 7249bc0d22
commit 2bb50378d0
2 changed files with 15 additions and 2 deletions

View file

@ -88,8 +88,8 @@
<string name="enable_raii_description">A method of automatic resource management in Vulkan that ensures proper release of resources when they are no longer needed, but may cause crashes in bundled games.</string>
<string name="frame_interpolation">Enhanced Frame Pacing</string>
<string name="frame_interpolation_description">Ensures smooth and consistent frame delivery by synchronizing the timing between frames, reducing stuttering and uneven animation. Ideal for games that experience frame timing instability or micro-stutters during gameplay.</string>
<string name="renderer_early_release_fences">Release fences early</string>
<string name="renderer_early_release_fences_description">Some games may require this to get past 0FPS errors, such as DKCR:HD, Subnautica, and Ori 2. Other games, notably Unreal Engine games, may work improperly or not boot with this enabled.</string>
<string name="renderer_early_release_fences">Release Fences Early</string>
<string name="renderer_early_release_fences_description">Helps fix 0 FPS in games like DKCR:HD, Subnautica Below Zero and Ori 2, but may break loading or performance in Unreal Engine games.</string>
<string name="veil_misc">CPU and Memory</string>
<string name="use_sync_core">Synchronize Core Speed</string>

View file

@ -88,9 +88,15 @@ public:
const bool should_flush = ShouldFlush();
CommitAsyncFlushes();
TFence new_fence = CreateFence(!should_flush);
#ifdef __ANDROID__
if (delay_fence && Settings::values.early_release_fences.GetValue()) {
guard.lock();
}
#else
if constexpr (can_async_check) {
guard.lock();
}
#endif
if (delay_fence) {
uncommitted_operations.emplace_back(std::move(func));
}
@ -103,10 +109,17 @@ public:
if (should_flush) {
rasterizer.FlushCommands();
}
#ifdef __ANDROID__
if (delay_fence && Settings::values.early_release_fences.GetValue()) {
guard.unlock();
cv.notify_all();
}
#else
if constexpr (can_async_check) {
guard.unlock();
cv.notify_all();
}
#endif
rasterizer.InvalidateGPUCache();
}