Froxel light grid: lossless per-cell light masks built from the lights alone #812
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream#812
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The deferred lighting kernels spend ~4,900 of ~16,000 cycles per lit pixel on per-16x16-tile light culling (tile depth min/max from every pixel's depth + a light test per tile). RenderVKLightGrid (default off) moved that same work into its own kernel: no net gain.
Design: extend the existing light pass (clean_lights.comp) to build a finer froxel grid (screen tile x depth slice) with a 256-bit light mask per cell (MAX_VK_LIGHTS = 256, so it can never overflow), marked per light from its sphere / cone with no pixel depth reads. The deferred kernels pick their pixel's cell and walk its mask; the per-tile test, shared-memory mask and barriers go away. The forward consumers (alpha, particles, probe and mirror captures) can switch from the capped 64-light clusters to the same exact masks.
Measure: shader-clock stages, lighting time, image A/B on the ~370-light scene, register / shared-memory counts.
Context: measured on a GTX 1080 (Pascal) at 4K with the test-control channel and the shader clock (RenderVKShaderClockLighting) / pipeline stats (RenderVKPipelineStats). The frame is GPU-bound but not bandwidth-bound (memory controller ~36% busy on the 1080, ~14% on a 5090): it is latency / occupancy bound, so trading a little memory traffic for fewer registers and fewer dependent loads should help every GPU generation.