shader: lower gfx1013 1D float image stores and mip loads #2049
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2056"
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-24T23:44:13Z.
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).
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T05:10:51Z.
Kept in step:
d9d5ce8bmerges the new #1649 head, which already includes currentmain. The CLI'slower()call forwards bothimage_srv_dimensionand main'sload_format_constant. On GTX 1060 + WARP: 12 passed, 0 failed, 0 skipped. LLVM 15 fixture checks, docs links and bidi also pass.Status: still a draft that depends on #1649. I'll rebase it onto
mainand mark it ready once #1649 merges.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T17:09:22Z.
Rebased onto the refreshed #1649 (
9ae3d2ed, onmain7092683a) and force-pushed: head is now03002826.One behaviour change from the rebase:
main's same-texel UAV load path (#2136) now applies only to 2D views. Before, a plain 1Dimage_loadwould enter it and be refused later, as an unverified descriptor. Now it gets the existing full-width refusal, which is what this PR's control expects. The UAV-load docs already describe that path as 2D-only.Tests on Windows 10 build 19045,
devpreset, GTX 1060 6GB (driver 32.0.15.6094) and in-box WARP 10.0.19041.compute_store_aot_gfx1013_image_: 12 of 12.This stays a draft until #1649 merges.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T20:41:19Z.
Moved onto the rebased #1649 (
fab79c8e, onmain5123cc6d) and force-pushed: head is now84e36821. There were no conflicts.Tests:
ctest -R "mimg|image_store|image_load|1d"on GTX 1060 + WARP: 45 of 46 pass. The one failure,startup_image_load_d16_warp, fails onmainon this host too.Still a draft until #1649 merges. Ready for more review.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T21:52:04Z.
#1649 is merged, so this is rebased onto current
main(0104f763) as one commit and force-pushed: head is nowce50e406. There were no conflicts. It now contains only the 1D change, and I'm marking it ready for review.Tests on Windows 10 19045, GTX 1060 + WARP:
ctest -R "mimg|image_store|image_load|1d": 48 of 49 pass.startup_image_load_d16_warp, fails onmainon this host too.*_controlsintests/compute_store_check.pypass, and so do the 1D translation controls.Ready for more review.