ifcviewer: MDI compaction via glMultiDrawElementsIndirectCount

Pack compute shader compacts non-empty indirect commands into
contiguous fwd/rev ranges, eliminating ~690k empty sub-draws that
dominated command-processor overhead.  GL 4.6 entrypoint loaded via
getProcAddress with ARB fallback; graceful degradation to uncompacted
MDI when unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-04-17 17:44:52 +10:00
parent a34c36d22e
commit 4bedb40d8a
3 changed files with 202 additions and 40 deletions
+7 -4
View File
@@ -809,9 +809,12 @@ single giant model / <18 cores CPU BVH trv Phase 3E GPU cull (plann
Occlusion halves survivors on dense interiors. Depth
pre-pass has same CP overhead as color pass (690k empty
sub-draws); cost dominated by MDI command processing.
- [ ] MDI compaction — compact non-empty commands into contiguous
buffer, use `glMultiDrawElementsIndirectCount` (GL 4.6 /
`ARB_indirect_parameters`). Deferred until all feature buckets
land so we can introduce GL 4.6 loading once, cleanly.
- [x] MDI compaction — pack compute shader compacts non-empty
commands into contiguous fwd/rev ranges; drawn via
`glMultiDrawElementsIndirectCount` (GL 4.6 /
`ARB_indirect_parameters`, loaded via `getProcAddress`).
Eliminates ~690k empty sub-draws from both depth pre-pass
and color pass. Falls back to uncompacted MDI when the
entrypoint is unavailable.
- [ ] Vulkan/MoltenVK backend for macOS
- [ ] Embedded Python scripting console