BVH: keep absent children behind real hits #230
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/230"
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?
Imported from fxceless/victory-fork. Originally posted by space-de on 2026-11-24T22:50:46Z.
Fixes #173.
When a BVH child pointer is
NONE, its stored bounds can still intersect the ray. The current slab test then gives that absent child a finite distance, so the sorting network can place theNONEsentinel ahead of a real hit. Traversal that stops at the first absent child can miss valid geometry.Require a present child in both implementations: the CPU reference and the matching DXIL emitter. Absent children now remain misses with infinite distance, so sorting keeps valid intersections ahead of them.
Checks
cargo check -p victory-shader --lockedcargo clippy -p victory-shader --locked -- -D warningsrustfmt --edition 2024 --check crates/victory-shader/src/bvh.rs crates/victory-shader/src/emit/intersect.rsgit diff --checkNo in-game run was performed. This is a BVH traversal correctness fix; no frame-rate improvement is claimed.
Imported from fxceless/victory-fork. Originally posted by towiice on 2026-11-24T23:28:12Z.
Review: COMMENTED
Tested:
610.88), Windows 11 x64 (26H2 / build26300), DXCv1.9.2609,rustc 1.100.0(stable-x86_64-pc-windows-gnullvm,llvm-mingw23.1.6).cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader --lib bvh: 15 passed, 0 failed (0.06 s).cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader --lib intersect: 6 passed, 0 failed (5.77 s) on hardware GPU and WARP.Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T01:23:12Z.
Duplicate of #213?
Pull request closed