Repository navigation
fix(render): vsync-off 下 GUI 撕裂;F10 渲染性能采集 - #4
Merged
Merged
Conversation
The reported "GUI flicker / stale pixels" was screen tearing, not a cache bug. vsync-off selects the Immediate present mode, and the faster GPU-quad UI (from the CPU-rasterize -> quad refactor) pushes frames well past the refresh, so the display scans out torn drawables -- visible only on the crisp, static GUI (masked entirely by screen recording, which forces compositing at the refresh). Fix: choose the surface frame latency per present mode (gpu::frame_latency_for) -- 1 for the unsynced modes so drawable back-pressure paces Immediate to the refresh at the lowest latency, 2 for Fifo so a spare frame keeps vsync from hitching on a spike. Applied at init and kept in sync on vsync toggle. Plus present hygiene: window.pre_present_notify() before present and an opaque surface. Also included (already in the working tree): user GUI-scale option (guiScale Auto/1..4, published once per frame), vanilla title logo + splash text, a version module, and the title-screen panorama post-pass passthrough.
Toggle a per-frame render capture in-game with F10 (press to start, press again to stop); Shift+F10 keeps the mods/ hot-reload it replaces. On stop it logs a statistical summary (frame-time min/avg/p50/p95/p99/max, 1%-low fps, GPU time, CPU pass costs, per-subsystem CPU breakdown, draw counts) and writes the raw per-frame rows to perf_capture_<ts>.csv for offline analysis. A red "REC PERF" banner shows while capturing and GPU timing is forced on so samples carry a real gpu_us. FrameProfiler now keeps the just-closed frame's per-phase durations (last_frame_phases) so the capture can sample them each frame.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
从本地分支 fix/extreme-ci-macos-build 中挑出两个未合并的提交,rebase 到当前 main。该分支上 3 个 CI 提交已在 main,没有带上。
改动
gpu::frame_latency_for按呈现模式选择帧延迟:非同步模式用 1,Fifo 用 2。初始化和切换 vsync 时都会同步更新。另外在 present 前调用window.pre_present_notify(),并使用不透明 surface。perf_capture_<ts>.csv。Shift+F10 保留原来的 mods 热重载。验证
cargo build -p fpsmaster_app通过cargo test -p fpsmaster_app -p fpsmaster_render:373 passed