Deferred lighting: cheap tile classification (subgroup reductions, fold into the shadow pass) #831
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#831
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?
Follow-up to #827. The feature split's tile-classify pass (
g_defer_classify) measures 0.8-1.2 ms on a GTX 1080 at 4K. The work it decides is cheap; the way it is computed is not:deferPosition), which the shadow / reflection passes have just done.atomicMin(s_zmin),atomicMax(s_zmax)andatomicOr(s_zbins)on single shared addresses. These serialize on Pascal: three 256-long chains per tile, 32,400 tiles.Plan
subgroupMin/subgroupMax/subgroupOr, then one atomic per subgroup (32x fewer). Respect the full-subgroups requirement (cross-subgroup scans need REQUIRE_FULL_SUBGROUPS even on NVIDIA; see the Beta 5 crash fix).lgClusterScan, diagnostic) only on sampled frames.Measure
Serial on the GTX 1080 at 4K (Firestorm-equivalent and high): classify + shadow + reflect + base vs current; registers of the changed kernels; also the RTX 5090. Expected 0.5-0.9 ms on Pascal.
Merged (
370bf9e20a,067f690a9d). Classification folded into the SHADOW pass (pass 10,RenderVKDeferClassifyFused, default on), subgroup reductions before the shared atomics, tile builds 256x1 with REQUIRE_FULL_SUBGROUPS, lit-guard cluster scan every 64th frame, newg_defer_prepmark.GTX 1080, 4K, serial, interleaved on/off:
g_defer_prepshows 0.34 ms of barrier drain that the old classify mark absorbed.Finding: the atomic-contention theory was wrong. With subgroup reductions and the drain split out, classify still costs ~0.6-0.8 ms on Pascal; the cost is the per-tile light testing (32,400 tiles at 4K x every light). The RTX 5090 does it in 0.058 ms. Next lever if wanted: 32x32 classification tiles, or narrowing per tile against the light-cluster lists instead of all lights.
Still to do: tile-list parity across RenderVKLightCulling 1 / 2 and the uber / plain-split grid path; live toggle; devices without computeFullSubgroups.
Fixed in Slipstream 1.3.0 (stable): https://git.slipstreamviewer.org/sky_line/Slipstream/releases/tag/v1.3.0
If you still see this on 1.3.0, reply here and we'll reopen it.