mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
a34c36d22e
Two-phase compute-cull dispatch when IFC_GPU_CULL=1: Phase 1 frustum + contribution + LOD, no HiZ → survivors Depth render survivors depth-only into half-viewport FBO Build GPU compute max-reduce depth → R32F mip pyramid Phase 2 same cull + HiZ test → final survivors Color render final survivors The compact shader's new hizOccluded() projects 8 AABB corners to screen space, picks the mip level where the covered rect fits in ≤2×2 texels, and rejects when the AABB's near-depth exceeds the pyramid's max depth. New GPU resources (per-window): hiz_gpu_fbo_ / hiz_gpu_depth_tex_ — depth-only FBO at half viewport hiz_gpu_pyramid_tex_ — R32F mipmapped pyramid hiz_gpu_copy_prog_ — compute: depth → pyramid L0 hiz_gpu_reduce_prog_ — compute: max-reduce L(n-1)→L(n) hiz_gpu_depth_prog_ — vertex + trivial fragment On a dense 18-model BIM dataset: survivors: 140k → 65k (HiZ rejects ~50%) triangles: 22M → 13M gpu_cull: 0.06ms → 22.5ms (depth pre-pass CP overhead) The depth pre-pass suffers the same empty-sub-draws CP overhead as the color pass (690k commands, most with instanceCount=0). Once MDI compaction lands, both passes will be fast. For now, net FPS is flat (savings on color ≈ cost of depth pre-pass). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>