3D map: material table draws decals and see-through surfaces #548

Manually merged
github merged 4 commits from github-bot/gh-548 into gh-pr/548/base 2026-11-28 07:03:09 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-28 06:45 UTC · original
holdmysocks:six-map3d-tablelate → master · +287 −102 · 2 files · 4 commits · merged 2026-11-28 06:58 UTC

3D map: the material table draws its models' decals and see-through surfaces.

After PR 531, the "late" draws were the largest block the table had not taken over: decals and see-through surfaces, 259–930 per frame, drawn one by one in sorted order with their own binds. CPU time spent in enc.finish() was the largest CPU part of the frame, at 2.2–5.0 ms with the table on.

What changes

  • Same order. The sorted decal and see-through lists are built as before, now in late_lists.
    • Runs of the table's models' entries become its sub-draws: one multi-draw per run of one kind and one set of chunks.
    • A model's meshes that follow straight on join into one sub-draw across materials, since each vertex carries its material.
    • Everything else stays on the old path, in place.
  • Three more table pipelines: decal, blended decal and see-through. They use the existing programs; fs_mesh_blend now reads the material from the table.
  • Arguments written later. The sub-draw arguments are written once, after the late runs are added (gd_write).
  • Fewer rebinds. A table run binds only what changed since the previous one.
  • Table field: it counts the late runs by kind.
  • A/B switch: SIXNG_MAP_GPU_TABLE=nolate draws the late entries the old way.

Grouping the table's opaque decals by chunk was tried and dropped. There are only 2–11 such runs per frame, and moving them split the blended-decal runs further.

Results (second PC, RTX 3090, rounds 45–46)

CPU sum of pass, finish and submit, µs. "Old way" is this build with nolate; "now" is this PR's code (round 46's plain order).

View Old way Now Change
s3 5235 4593 −12 %
dtst 5507 4885 −11 %
rs 7172 6121 −15 %
wide 3532 3146 −11 %
  • The wide figures are from round 45 (old way) and round 46 (now). Round 46's old-way wide run hit an intermittent pass-time spike.
  • Finish: 171–689 µs lower. Submit: 47–142 µs lower.
  • Late draws: s3 739 → 537, dtst 690 → 467, rs 930 → 597, wide 259 → 184.
  • GPU: unchanged, within ±0.3 ms.
  • Images against the old way, pixels differing by more than 16: dtst 0, rs 0–2, wide 9–19 (run noise). Road markings, grime, overlapping decals, glass and fences match.
  • s3: round 46's s3 shots disagreed by 230 px, from s3's two-state frame. Reruns came out 0 px apart.
  • No pipeline, validation or watchdog lines in 51 runs.
**@⁠holdmysocks** on GitHub · 2026-11-28 06:45 UTC · [original](https://github.com/holdmysocks/SixNG/pull/548) `holdmysocks:six-map3d-tablelate` → `master` · +287 −102 · 2 files · 4 commits · merged 2026-11-28 06:58 UTC 3D map: the material table draws its models' decals and see-through surfaces. After PR 531, the "late" draws were the largest block the table had not taken over: decals and see-through surfaces, 259–930 per frame, drawn one by one in sorted order with their own binds. CPU time spent in `enc.finish()` was the largest CPU part of the frame, at 2.2–5.0 ms with the table on. ## What changes - **Same order.** The sorted decal and see-through lists are built as before, now in `late_lists`. - Runs of the table's models' entries become its sub-draws: one multi-draw per run of one kind and one set of chunks. - A model's meshes that follow straight on join into one sub-draw across materials, since each vertex carries its material. - Everything else stays on the old path, in place. - **Three more table pipelines:** decal, blended decal and see-through. They use the existing programs; `fs_mesh_blend` now reads the material from the table. - **Arguments written later.** The sub-draw arguments are written once, after the late runs are added (`gd_write`). - **Fewer rebinds.** A table run binds only what changed since the previous one. - **Table field:** it counts the late runs by kind. - **A/B switch:** `SIXNG_MAP_GPU_TABLE=nolate` draws the late entries the old way. Grouping the table's opaque decals by chunk was tried and dropped. There are only 2–11 such runs per frame, and moving them split the blended-decal runs further. ## Results (second PC, RTX 3090, rounds 45–46) CPU sum of pass, finish and submit, µs. "Old way" is this build with `nolate`; "now" is this PR's code (round 46's plain order). | View | Old way | Now | Change | |---|---|---|---| | s3 | 5235 | 4593 | −12 % | | dtst | 5507 | 4885 | −11 % | | rs | 7172 | 6121 | −15 % | | wide | 3532 | 3146 | −11 % | - The wide figures are from round 45 (old way) and round 46 (now). Round 46's old-way wide run hit an intermittent pass-time spike. - Finish: 171–689 µs lower. Submit: 47–142 µs lower. - Late draws: s3 739 → 537, dtst 690 → 467, rs 930 → 597, wide 259 → 184. - GPU: unchanged, within ±0.3 ms. - Images against the old way, pixels differing by more than 16: dtst 0, rs 0–2, wide 9–19 (run noise). Road markings, grime, overlapping decals, glass and fences match. - s3: round 46's s3 shots disagreed by 230 px, from s3's two-state frame. Reruns came out 0 px apart. - No pipeline, validation or watchdog lines in 51 runs.
The sorted decal and see-through lists keep their order; runs of the table's models' entries become its sub-draws (one multi-draw per run of one kind and set of chunks), and a model's meshes that follow on join across materials. The table gains decal, blended decal and see-through pipelines. SIXNG_MAP_GPU_TABLE=nolate draws them the old way.
Opaque decals of the table's models go first in their layer, by geometry chunk (their order matters only within a model), so they form long runs; blended decals and see-through surfaces keep their order. A table run binds only what differs from the run before it. The table field counts the late runs by kind. SIXNG_MAP_GPU_TABLE=lateexact keeps the plain decal order.
Grouping the table's opaque decals by chunk split the blended-decal runs further (round 46); the rebind savings stay.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 06:51:27 +00:00
github-bot changed target branch from master to gh-pr/548/base 2026-11-28 07:03:06 +00:00
github manually merged commit 6595e3b365 into gh-pr/548/base 2026-11-28 07:03:09 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.