Map 3D: static models' draws recorded once and replayed #347

Closed
github-bot wants to merge 2 commits from gh-pr/347/head into gh-pr/347/base
Owner

@⁠holdmysocks on GitHub · 2026-11-26 03:13 UTC · original
holdmysocks:six-map3d-bundles → master · +405 −11 · 5 files · 2 commits · closed without merging

Downtown, the 3D map runs at about 20 fps. The graphics card only needs 12-17 ms of a 45-49 ms frame. The time goes to the CPU encoding about 7,700 draws a frame, about 2.3 µs each, 15-19 ms in all. Built on #343, which adds the timing.

  • Recorded draws. A static model's opaque, coverage-fallback and shadow-caster draws are recorded once as render bundles and replayed every frame. The graphics library then validates and encodes those draws once, not every frame.
    • A model's bundle is recorded again when its instances, shown meshes, pass, pipeline or frame group change. That's checked with one hash per model and pass.
    • Recorded models are replayed in one call, until the stencil value changes or a model is drawn directly.
    • Skinned models and strand hair are still drawn directly. So are the blended and decal passes, which sort by distance.
    • SIXNG_NO_BUNDLES=1 draws everything directly, for comparison.
  • Instance uploads. Instances are written to the GPU only when they change. Before, every model's instances were copied and hashed every frame.
  • The README's note that bundles are never freed applied to an older version of the graphics library. The version in use now keeps a replayed bundle only until that frame's commands are done.

Checked

  • cargo check and cargo clippy clean.
  • On the test PC: pending. Frame time and pass|finish|submit downtown with and without SIXNG_NO_BUNDLES, and a fly over the city for the live buffer and bind group counts after eviction.
**@⁠holdmysocks** on GitHub · 2026-11-26 03:13 UTC · [original](https://github.com/holdmysocks/SixNG/pull/347) `holdmysocks:six-map3d-bundles` → `master` · +405 −11 · 5 files · 2 commits · closed without merging Downtown, the 3D map runs at about 20 fps. The graphics card only needs 12-17 ms of a 45-49 ms frame. The time goes to the CPU encoding about 7,700 draws a frame, about 2.3 µs each, 15-19 ms in all. Built on #343, which adds the timing. - **Recorded draws.** A static model's opaque, coverage-fallback and shadow-caster draws are recorded once as render bundles and replayed every frame. The graphics library then validates and encodes those draws once, not every frame. - A model's bundle is recorded again when its instances, shown meshes, pass, pipeline or frame group change. That's checked with one hash per model and pass. - Recorded models are replayed in one call, until the stencil value changes or a model is drawn directly. - Skinned models and strand hair are still drawn directly. So are the blended and decal passes, which sort by distance. - `SIXNG_NO_BUNDLES=1` draws everything directly, for comparison. - **Instance uploads.** Instances are written to the GPU only when they change. Before, every model's instances were copied and hashed every frame. - The README's note that bundles are never freed applied to an older version of the graphics library. The version in use now keeps a replayed bundle only until that frame's commands are done. ## Checked - `cargo check` and `cargo clippy` clean. - On the test PC: pending. Frame time and `pass|finish|submit` downtown with and without `SIXNG_NO_BUNDLES`, and a fly over the city for the live buffer and bind group counts after eviction.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:29:21 +00:00
github-bot closed this pull request 2026-11-26 20:29:21 +00:00
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-26 03:24 UTC · original

Closed: on the test PC the replayed bundles drew wrong geometry (stale resources), encoder finish stayed at 17-22 ms (the replay costs as much as direct draws), and re-recording during a fly dropped it to 8 fps. Draw count has to come down instead.

**@⁠holdmysocks** on GitHub · 2026-11-26 03:24 UTC · [original](https://github.com/holdmysocks/SixNG/pull/347#issuecomment-7181688906) Closed: on the test PC the replayed bundles drew wrong geometry (stale resources), encoder finish stayed at 17-22 ms (the replay costs as much as direct draws), and re-recording during a fly dropped it to 8 fps. Draw count has to come down instead.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.