Move projector-shadow ray queries out of the main lit shader #849
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.
Depends on
Reference
sky_line/Slipstream#849
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?
Deferred until after 1.3. Tracking only for now.
Problem
With RT on, the main lit fragment shader gets a ray-query variant (lit
rayquery, about 186k SPIR-V words) so it can trace projector shadows (and sun/moon when RT shadows are on) inline. That makes it the most expensive pipeline we compile, by a wide margin, on drivers without hardware BVH traversal:3df839bf30).The variant is also another full specialization set of the biggest shader (plain + ray-query, for the rigged, capture and particle lit pipelines too), which doubles compile time and cache size for those.
Proposal
Trace projector shadows the same way sun/moon RT shadows already work: in a separate compute pass (like the RT shadow mask) that writes per-pixel visibility, which the lit shader then samples. The lit shader then needs no ray-query variant at all.
PartLightRt) and the capture pass (FragCapRt) have their own ray-query variants. Decide whether they read the same mask, keep shadow maps, or keep a small dedicated ray-query path.Measure first
Before designing it, rank pipelines by learned compile cost per driver (
vkpipecachelearned costs, VKPipe batch reports) to confirm the lit ray-query variants dominate on AMD and Mesa, and check the per-frame cost of a separate projector trace pass against the inline trace on NVIDIA and on RDNA2.Now phase 3 of #1039 (shared visibility pass): the lit shaders read visibility from a compute pre-pass instead of tracing inline.