Shaders: emulate image_bvh intersect instructions as miss to enable lighting compute shaders #2191
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2191
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2191/head"
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?
@Xvania7 on GitHub · 2026-11-25 07:21 UTC · original
Xvania7:feat/bvh-raytracing-fallback→main· +199 −9 · 3 files · 1 commits · closed without mergingCloses #1533 (related to #876, #71, #274).
Summary
Emulates RDNA2 MIMG BVH traversal instructions image_bvh_intersect_ray (x0e6) and image_bvh64_intersect_ray (x0e7) as a clean miss so lighting/RTGI/shadow compute shaders (CS_RaytracingResolve,
tdirectionalshadows) translate and execute instead of failing with ShaderError::Unsupported:
Verification
@r4tedx on GitHub · 2026-11-25 07:42 UTC · original
A note for the triage, from reading this PR against
main940d32f:mainalready lowers both instructions for real, so this would replace a working lowering with a miss.crates/victory-shader/src/emit/lower.rs:7661:if name.starts_with("image_bvh") { return self.bvh(inst, b, i); }crates/victory-shader/src/emit/lower/bvh.rs: the ray against one box or triangle node, with the result in the hardware's encoding, so the program's own traversal runs (it came in with0b35b7f, and #1198 was closed for it).A miss for every ray was a reasonable way to get the lighting programs to translate while nothing lowered these instructions. On current
mainit would turn the real result into "nothing hit" for every program that traces. The PR also conflicts withmainin the same function.What still stops ray-tracing programs on
mainis elsewhere: in an offline count of940d32f, the 40 compute programs that useimage_bvh_intersect_rayare refused fora register joining a lane mask and data, read as data, which #1883 addresses (all 40 emit with it; with #2027 as well, all 40 validate). So my suggestion is to close this one in favour of what is inmain, and if #1533 is still open, to point it at #1883.Local title data was used for the count only (offline, CPU only, counts and reasons). Nothing was run for this comment beyond reading the code.
AI-assisted (Claude Code).
@Xvania7 on GitHub · 2026-11-25 07:44 UTC · original
Thanks @r4tedx for checking against \
940d32f! Confirmed \main\ now includes full BVH intersection lowering (\␀b35b7f\ / \lower/bvh.rs), so this miss fallback is superseded. Closing in favor of \main\ (and #1883 / #2027 for the remaining register-join validation on the 40 RT programs).Pull request closed