xshader: lower inline BVH32 ray-query loops to native TraceRayInline #477
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/477"
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 brcly/TuxBox. Originally posted by glovepost on 2026-11-29T13:42:29Z.
Summary
Extends
tools/shader-compiler/src/hlsl/ray_query/(splittingray_query.rsintoray_query/mod.rsandray_query/bvh32.rs) to recognise and lower inline RDNA2 BVH32 (image_bvh_intersect_ray) ray-query loops to native HLSLRayQuery/TraceRayInline, alongside the existing BVH64 (image_bvh64_intersect_ray) lowering.The BVH32 planner recovers the scene descriptor capture, root-node load, ray operands, instance mask (constant or dynamic SGPR), triangle cull mode, and closest-hit or first-hit outputs, and leaves walks with external memory traffic or external loop entries untouched. Synthetic instruction rewrites in
ray_query/mod.rs(s_nop,tb_bvh64_ray_query,tb_bvh64_ray_attr, androot_loadss_mov_b32) now normalisedwords,raw, andaux, andwave_loops::full_mask_programallowliststb_bvh64_ray_queryandtb_bvh64_ray_attr, so inline ray queries inside mixed-lane Wave32 compute programs preserve whole-wave uniform dispatch.Adds six unit tests covering BVH32 lowering, non-acceleration-structure refusal, external-memory and external-entry rejection, instance-mask/cull-mode/hit variants, mixed-lane Wave32 uniform dispatch, and a GPU capture test, and registers
bvh32-queryintools/check_translator_gpu.py.Lanes does not build a raytracing acceleration structure or dispatch inline RDNA2
image_bvh_intersect_raywalks;bvh32-queryintools/check_translator_gpu.pyexecutes the translatedRayQueryshader against a real D3D12 acceleration structure on both GPUs and verifies the hit distance readback.Prepared with AI coding assistance and verified by the checks below.
Tested
Run the checks relevant to this change.
GPU, driver and backend:
10de:1e84), driver620.73.04, GE-Proton11-14 (proton)1002:13c0, RADV RAPHAEL_MENDOCINO), Mesa26.3.1-arch3.5, GE-Proton11-14 (proton)Commands run and their results:
Checks
CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of
tuxbox-d3d12.If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files: