compute: keep MIMG sampler index bit 4 out of the reserved-bit check #3146
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3146"
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 Leyukaka on 2026-11-27T18:20:48Z.
Part of #2935. Target branch
main.Bug. MIMG word 1 holds SSAMP in bits 25:21. The direct path (
image_ioinsrc/gfx1013_direct_compute.inl) and the HLSL compute emitter (imageinsrc/gfx1013_compute_native.cpp) treated bits 29:25 as reserved withi.b & 0x3e000000u. Any sample or gather whose sampler quad starts at s64 or above was therefore refused with "direct image opcode or descriptor modifiers" (or "unsupported image flags"). The sampler index itself is already decoded with five bits,((i.b >> 21) & 31) * 4. The checks now test bits 29:26 (0x3c000000u).Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, on
main80668b97plus this commit.native_sample_ssamp_hardwarepassed. The sameimage_sample_lzprogram runs with its sampler in s4..s7 and in s68..s71, and both match the CPU reference over 320 readback words. A third case sets bit 26 and stays refused.native_sample_ssamp_warpskips (77), likenative_gather_lod_cs_warp.native_gather*,startup_compute_gather*andnative_direct_containertests pass, 15 in all, two of them WARP skips.0x3e000000uinimage_iomakes the s68 case fail with the old refusal. The test covers only theimage_iocopy. The HLSL emitter copy ingfx1013_compute_native.cpp, reached through thegfx1013-compute-wave32@profile, received the same one-bit change and has no test of its own.Measured on a local capture (counts and instruction shape only) with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests, onmain80668b97.image_storewith a partial mask, which is unrelated.s_or_saveexec_b32and 1 ats_bfm_b64.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T21:02:20Z.
Review: COMMENTED
Review of
d719ab8e65(updated with main). Comment only.The MIMG reserved-bit mask for the second dword drops bit 25 (
0x3e000000to0x3c000000) in both the direct frontend (gfx1013_direct_compute.inl) and the native analysis (gfx1013_compute_native.cpp), so the two stay in step. Bit 25 is the top bit of the 5-bit SSAMP field (bits 21-25), so a sampler in s64 and above was refused before. Bits 26-29 stay reserved, and the new check keeps a bit-26 case refused. Both test legs need a wave32 adapter and skip on our WARP host (77), so the readback for s4..s7 and s68..s71 rests on the RTX 5080 run in the description; the change itself is a one-bit mask in two mirrored places.src/gfx1013_direct_compute.inlis also changed oncpp-migration; this merges cleanly there and the native sweep passes on that merge (comment below).Commands:
git diff origin/main...pull/3146/head(read),git merge-tree --write-tree origin/cpp-migration pull/3146/head, plus the Windows commands in the comment below.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T21:02:21Z.
Windows Server 2025 verification of
d719ab8e6596d7d99b1a8fafa8be3f65f7409e4a(D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target compile_dxil native_store_replay native_compute_ir_dump;ctest --preset dev -R <native sweep>: 100% tests passed out of 145 (84 passed, 61 skipped;native_sample_ssamp_warpand_hardwareskip here, as they need a wave32 adapter)--preset release;ctest --preset release -R <native sweep>: 100% tests passed out of 145 (84 passed, 61 skipped)cpp-migration(a0f67731): 100% tests passed out of 145 in both presets<native sweep>= everynative_*test exceptnative_startup_request_cache_hardware, which fails on WARP-only hosts with or without this PR.AI-assisted; commands listed were executed locally.