Skip to content

feat(gpu): VICTORY_RAY_SKIP=shadow leaves out local-light shadow rays while the BVH builder is held back - #660

Merged
pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
Zeyphers:feat/ray-skip-shadow
Nov 28, 2026
Merged

pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
Zeyphers:feat/ray-skip-shadow

Conversation

@Zeyphers

Copy link
Copy Markdown
Contributor

Summary

VICTORY_RAY_SKIP=shadow (off by default) leaves out the local lights' shadow-ray dispatches (CS_RaytraceShadows_Mixed, CS_TraceShadowRays_*) in frames where the BVH builder is held back, like the existing resolve and activate parts.

Since #591 holds the builder back, those programs trace against structures nothing built. Every so often they mark whole light tiles fully lit for one frame. In the cell this shows as white radial rays and tile-shaped blocks, then a bleached frame or two.

How it was found (M1 Max, 32 GB, macOS 15.7.3, D3DMetal 4.0b3)

7-minute recordings in the world, turning and walking, scored for brightness jumps (more than 25 over the median of the previous 10 frames):

build / switches flashes per 100 frames
main + #593 #605, estimate 9.7
same, VICTORY_GPU_TIMING=1 (every list alone) 6.5 (not a race between lists)
same, VICTORY_LITERAL_HALVES=0 6.8 (not the halves translation)
same, VICTORY_SKIP_PIPELINES = the light loop 0, but the cell loses its local lights
same, VICTORY_SKIP_PIPELINES = the two shadow-ray programs 1.6, all in the opening cutscene; ceiling lights stay
this switch, VICTORY_RAY_SKIP=1,shadow, normal build 0.6, gameplay clean

With 1,shadow the median world frame was 538 ms against 822 ms without VICTORY_RAY_SKIP, mostly because about 660 CS_RaytracingResolve dispatches a frame are left out.

Change

  • ray_skip.rs: a third part, SHADOW, named by CS_RaytraceShadows_Mixed and CS_TraceShadowRays. 1/on/all keep their meaning (resolves and activation); shadow is opt-in and combines with commas.
  • The counts, the start line and the frame line carry the third part.
  • Tests: the part parses and combines; the two programs are known by name, and CS_RTDistantShadowTrace* is not; the lines name it.

Local lights cast no ray-traced shadows with it on.

🤖 Generated with Claude Code

… while the BVH builder is held back

Traced against structures nothing built, CS_RaytraceShadows_Mixed and
CS_TraceShadowRays_* mark whole light tiles lit for a frame now and then:
the cell flashed white in radial rays and tiles 6.5-9.7 times per 100
frames on an M1 Max, 1.6 with them left out, and the ceiling lights stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants