Skip to content

Voodoo: default LFB relax frontsync + wait stats#6728

Merged
OBattler merged 1 commit into
86Box:masterfrom
AITUS95:master
Jan 18, 2026
Merged

Voodoo: default LFB relax frontsync + wait stats#6728
OBattler merged 1 commit into
86Box:masterfrom
AITUS95:master

Conversation

@AITUS95

@AITUS95 AITUS95 commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Enable front-sync LFB relax and wait stats by default (with env disable), remove unused pending_* counters, add clarifying comments around LFB sync/swap behavior, reduce swap wait stalls on Windows by using a zero‑ms sleep in the swap-complete loop, and avoid redundant fifo_empty_event resets to cut Win32 ResetEvent churn. Improvements target Voodoo 1 and Voodoo 2 behavior, stabilizing menu/gameplay hot spots across multiple titles.

Root Cause

On Voodoo 1/2, LFB reads always forced a full FIFO drain and render-thread idle, even when the CPU was reading from the back buffer. Games like Dungeon Keeper 2 (menu), Descent 2 (Voodoo mode when rockets hit walls), Sub Culture, and Thief issue frequent LFB reads, so the main thread repeatedly stalled the pipeline and speed could drop dramatically (menus down to ~85% or worse, and ~30% in the heaviest cases). The safer relax/frontsync path that avoids unnecessary flushes was only active when the env vars were set manually, so default runs never benefited; enabling it by default (while still forcing sync for front/aux reads) resolves those slowdowns without reintroducing artifacts. On Linux (Wayland), the stalls were far less pronounced and the relax path delivered stable 100% behavior quickly; on Windows, additional latency came from Sleep(1) granularity in the swap‑pending loop and heavy ResetEvent churn on the FIFO empty event. Switching to Sleep(0) and gating fifo_empty_event resets removes those extra Windows‑specific stalls while preserving correctness, bringing Windows behavior in line with the Linux results.

thanks to @unreal9010 for extensive testing across titles.

Checklist

References

Provide links to datasheets or other documentation that helped you implement this pull request.

Make LFB relax/front-sync the default for V1/V2, keep wait stats opt-in, document sync behavior, and reduce Windows swap/event stalls.
@OBattler OBattler merged commit 605a144 into 86Box:master Jan 18, 2026
44 checks passed
@AITUS95 AITUS95 mentioned this pull request Jan 25, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants