shader: lower gfx1013 D16 image stores to RGBA16 FLOAT #2099
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2106"
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 R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T00:26:47Z.
Refs #1545.
Overlap: #1649 and #2056 (open) change the same gfx1013 image rules in
tools/compute_store_aot.pyand the texture-case flags intests/compute_check.cpp. This PR uses flag bit 22, #2056 uses bit 23 and #1649 adds bit 31, so they do not collide. Whichever lands later rebases.Change
Lower gfx1013 full-mask 2D D16
image_storetoRWTexture2D<float4>atu0when the caller declares anR16G16B16A16_FLOATUAV at mip zero. Widen the low and high halves of VDATA followed by the low and high halves of VDATA+1 withf16tof32. The typed UAV narrows the four components back to binary16. RDNA 2 ISA §§8.2.1 and 8.2.5An independent LLVM 15 AMDGPU codegen probe with halves
3c01 c002 4003 b004placedc0023c01andb0044003in the two consecutive store VGPRs. LLVM 15.0.7llvm-mcrejected one-, three- and four-register full-mask D16 stores withimage data size does not match dmask, d16 and tfe.Tests
The source-built compute fixture writes 16 unique texels at mip zero. It compares all 1,344 raw binary16 halves across all three destination mips, including 1,280 untouched sentinels. The written values include positive and negative normals, subnormals of both signs, and both signed zeros. The translation checks pin the view, register, four half conversions and store index. The binary checks reassemble the recorded bytes and verify the synthetic container CLI output for the new and existing float-store fixtures.
3c00, actualc000.3c00, actual0000.D16 image_store requires full DMASK 0xf.D16 image_store requires exactly two consecutive data VGPRs.D16 requires a 2D image_store with full-width coordinates and implicit mip zero.Unsupported compute instructionwith the rejected form.D16 image_store requires a gfx1013 RGBA16 FLOAT UAV.RGBA16 FLOAT image UAV requires a D16 image_store.RGBA16 FLOAT requires a gfx1013 D16 image store UAV.Image store mip does not match the UAV view.Verification
Tested commit
c3ce6f66f59ff87b34eaf81aeee1a4a2574f8870on Windows 10 22H2, build 19045.6456, with DXC 1.9.2602.17. The GTX 1060 6GB used driver 32.0.15.6094. In-box WARP used Microsoft Basic Render Driver 10.0.19041.5794. The D3D12 debug layer was enabled on both adapters and reported zero warnings and errors for the D16 fixture and both controls in Debug and Release.dev)release)Set
VULKAN_SDKto the Vulkan SDK 1.4.363.0 installation. Use a Python environment withrequirements-dev.txtinstalled.The local binary checks used LLVM 15.0.7 for assembly, llvm-objcopy for
.textextraction, and libLLVM 15.0.0 for disassembly and the independent codegen probe. The Windows DLL can be extracted toout/libLLVM-15.dll. LLVMSharp Windows runtime packageLimits
The profile is restricted to full-mask 2D stores at mip zero with full-width coordinates and an RGBA16 FLOAT UAV. The measurements cover selected finite binary16 values and in-bounds addresses on desktop D3D12. NaN payloads, infinities and native console execution are outside the measurement.
I reran it at
c3ce6f66on the same machine: 31/31 in dev and 31/31 in release (GTX 1060 and WARP, debug layer on, no skips), plus the LLVM 15--binarychecks of the D16, 2D and image atomics fixtures.AI-assisted (Codex, driven with Claude Code; Claude Code reviewed the change and reran the checks).