feat(shader): implement image_bvh64_intersect_ray #524
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/524"
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 boykopovar/AnyPS5. Originally posted by DotDebian on 2026-10-04T14:46:20Z.
What
Implements
IMAGE_BVH64_INTERSECT_RAY(MIMG0xe7): the node test ofimage_bvh_intersect_raywith a 64-bit node pointer.0xe7decodes toImageBvh64IntersectRay. The node pointer takes the first two address dwords (low, high), so the instruction addresses 12 dwords, 9 with A16.ImageBvhIntersectRayIR op, withMemoryInfo::addressIsFullmarking the 64-bit pointer.APS5_RAYTRACING=strictandmissapply as for the 32-bit form.Sources:
0xe7on GFX10 (MIMGInstructions.td); operand order andNumVAddrDwords = IsA16 ? (Is64 ? 9 : 8) : (Is64 ? 12 : 11)(SIISelLowering.cpp).create_bvh_descriptorandbuild_addr_to_node: on RDNA2 it uses this instruction with a T# of base 0 and size 2^42 - 1, and a node pointer of(address >> 3) + node.Tested
Windows 11, MinGW-w64 GCC 15.2.0,
ctest: 184/184 pass. No title run.agc_driver_bvh64_intersect_ray. A compute shader runs four forms on the host Vulkan device over the same nodes:image_bvh64_intersect_ray(contiguous address),image_bvh_intersect_ray(NSA), and both with A16 (NSA).ray_tracing_missnow decodes and translates both opcodes, with and without A16, and checks the address dword count (11, 8, 12, 9). It passes withAPS5_RAYTRACINGunset,missandstrict; the execution test skips itself in the last two.Not verified: behaviour on real hardware, and pointer bits above the 42-bit node index (they make the node fail the T# size check here). The
mmappath of the test was not run (no Linux build here).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T14:46:43Z.
Progress report (
8387b4d→bf635fa)📈 GPU shader instructions: 86.96% (+0.08%, +1 implemented instructions)
✅ 1 implemented
IMAGE_BVH64_INTERSECT_RAYImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:08:15Z.
Thanks, the 64-bit addressing checks out. LLVM's gfx1013 model accepts
image_bvh64_intersect_ray(MIMG 0xe7, 12 address dwords, 9 with A16), and the operand offsets (ray + 1,ray + 4,ray + 7) land on the right dwords for both forms, so the 32-bit layout is unchanged. Not treating a zero T# base as a null BVH for the 64-bit form matches radv, which builds exactly that descriptor (base 0, size 2^42 - 1) with a node pointer of(address >> 3) + nodeon RDNA2.The new test fails on main with
unsupported MIMG opcodeand passes here. Since the shared emitter forimage_bvh_intersect_raychanges as well and PPSA21564 uses that instruction, I'll run it through my PPSA21564 check before merging; ready to merge from my side otherwise.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T05:04:05Z.
Gated on PPSA21564: no visual or FPS change.