Repository navigation
shader: lower gfx1013 1D float image stores and mip loads - #2056
Conversation
|
Kept in step: Status: still a draft that depends on #1649. I'll rebase it onto |
d9d5ce8 to
0300282
Compare
|
Rebased onto the refreshed #1649 ( One behaviour change from the rebase: Tests on Windows 10 build 19045,
This stays a draft until #1649 merges. |
0300282 to
84e3682
Compare
|
Moved onto the rebased #1649 ( Tests: Still a draft until #1649 merges. Ready for more review. |
Full-mask R32G32B32A32_FLOAT image_store into a 1D UAV view and full-mask image_load_mip from a separate 1D SRV, declared with --image-uav-dimension 1d and --image-srv-dimension 1d, lower to RWTexture1D<float4> and Texture1D<float4>.Load(int2(x, mip)). The same-texel UAV load path stays 2D: a plain image_load of another dimension is refused as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#1649 is merged, so this is rebased onto current Tests on Windows 10 19045, GTX 1060 + WARP:
Ready for more review. |
84e3682 to
ce50e40
Compare
Refs #1545. Stacked on #1649 (at
a9fb1792): this PR also shows #1649’s commits until #1649 merges, and the change here is only3e27abf6. It stays a draft until then; I’ll rebase onto main once #1649 lands.Change
Lower gfx1013 full-mask
R32G32B32A32_FLOAT1D stores toRWTexture1D<float4>atu0. Lower explicit-mip reads from a separate descriptor toTexture1D<float4>att0, withLoad(int2(x, mip)). The caller declares the UAV and SRV dimensions independently. RDNA 2 specifies one address VGPR for the store and two for the load (§8.2.3, Table 42). LLVM 15 accepted both forms and rejected the wrong address widths. AMD RDNA 2 ISAThe compute fixture adds a distinct 1D case flag and uses the existing footprint-based upload and readback path.
Tests
The source-built shader copies all four channels from source mips 1 and 2 into eight unique texels of destination mip 0. The CPU reference compares all 224 destination words across mips of widths 32, 16 and 8, including 192 sentinels. The LLVM check reassembles the recorded bytes, disassembles the MIMG instructions, and compares the container CLI output against the HLSL from the assembly text.
3f100000, actual3f000000.3f100000, actual sentinelbf000000.requires full DMASK 0xfdiagnostic.Unsupported compute instruction, identifying the instruction.image_load, orimage_store_mipimage address size does not match dim and a16.vmcnt(0)Verification
Tested commit
3e27abf675945f30785477f3b457e7f92eabbe87on Windows 10 22H2, build 19045.6456, using 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 reported zero warnings and errors for the 1D fixture and its controls on both adapters.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 to extract
.text, and libLLVM 15.0.0 from the LLVMSharp NuGet runtime for disassembly. The Windows DLL can be extracted toout/libLLVM-15.dll. LLVMSharp Windows runtime packageLimits
The 1D profile requires full masks, full-width addresses and data, and a separate read-only SRV for explicit mips. The fixture exercises in-bounds coordinates and normal binary32 values on desktop D3D12. Console out-of-bounds behavior, special floating-point values, and arbitrary resource formats are outside the measurement.
I reran it at
3e27abf6on 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 1D, 2D and layers fixtures.AI-assisted (Codex, driven with Claude Code; Claude Code reviewed the change and reran the checks).