Shaders: guard BVH node loads and split box/triangle intersection by node type #3806
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3806"
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 Marvisak/VIctory. Originally posted by Vemast on 2026-11-28T23:33:35Z.
Summary
Lower::bvh_lanes(crates/victory-shader/src/emit/lower/bvh.rs) behindty < 6, returning zeros when a node pointer isINVALID(0xFFFF_FFFF) or hasty >= 6instead of reading from bogus title-memory addresses and risking false miss-bitmap bits.ty < 4(triangle intersection) vsty >= 4(box intersection + conditionalbox32tail load) so valid nodes only run the relevant intersection path and box-tail memory reads.emit::bvh_tests::invalid_and_non_box_nodes_skip_title_memory_loadsverifyingINVALID/ty >= 6and non-box32nodes return expected results without performing bogus title-memory loads.Verification
cargo test -p victory-shader --lib bvh_tests— 15/15 passed (validated bydxil.dll, ran on hardware D3D12 + WARP)cargo clippy -p victory-shader --all-targetscargo run -p xtask -- policyImported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-28T23:33:44Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T23:51:33Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
98cd1e341f191c57101631d37dc770c01f5a088f, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-shader --lib -- emit::bvh_tests::invalid_and_non_box_nodes_skip_title_memory_loads --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 305 filtered, exit 0.git grep -Ffor the test name on the base returned no match (test is new on this PR);git diff --check HEAD^ HEADclean (2 files, +126/-17).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.