Repository navigation
Conversation
|
I found a result-semantics mismatch at RDNA2 MIMG opcode 128 retrieves up to four samples of a single component. LLVM also documents a gfx10 limitation that makes a single-channel texture the appropriate control. A 4× MSAA R32_FLOAT texel with distinct red values in samples 0–3, identity component mapping, and fragment ID 0 separates these behaviors: a single RGBA fetch cannot recover the other three red values. Please cover that case separately from ordinary I also scanned all 26,503 retail DXBC listings on my 1.0.2.1 copy. None used |
Kam471
left a comment
There was a problem hiding this comment.
Ran this at d2dec3d39 on Windows 11 (the repo's no--I invocation, since the test imports support): tests/semantic/test_image_msaa_load.py -> 6 tests, OK; git diff --check clean.
image_msaa_load (MIMG 0x80) is now implemented for 2D_MSAA and 2D_MSAA_ARRAY, with the sample coordinate/a16 path and the decoder/wave64 bookkeeping updated; the new 264-line test covers the operand forms, the sample selection and the rejected shapes through the translator and the interpreter. The PR adds no GPU fixture, so this is CPU evidence only. No blocking issue.
|
Tested
No game files, no GPU. AI-assisted (Devin). |
|
Tested
AI-assisted (Claude Code). Hand-written shaders only, no game files. |
|
Retested the sample-selection issue on In each float, uint and sint branch, AI-assisted. Synthetic translation and inspection of emitted SPIR-V on CachyOS; texture readback was outside this run. |
|
Regression check of e0c0930 on AMD Radeon RX 9070 (RDNA4, subgroup 32..64), AMD driver 26.11.2 (LLPC), Windows 11 Pro 26300, Vulkan SDK 1.4.363,
AI-assisted (Claude Code). |
|
Tested This branch already contains
AI-assisted (Claude Code). |
|
Reviewed head e0c0930, applied to One issue: the uint/sint MSAA bindings may not exist. The module declares and statically uses all three classes ( Not checked: the semantics (dmask bit k → sample |
e0c0930 to
9a0015c
Compare
|
Tested 9a0015c on Windows 11: the translator checks and the GPU descriptor checks pass.
The descriptor test uses its own GLSL shader. Direct GPU execution of the new translated instruction remains unverified by this run. AI-assisted. |
|
Tested 9a0015c, merged onto
No game files. AI-assisted (Claude Code). |
|
Tested 9a0015c merged with main 561b65a on Linux (WSL2), Python 3.12.16: pass
Not checked: the hardware meaning of |
|
Tested 9a0015c on AMD gfx1036 (26.11.2) and RTX 4070 Ti SUPER (621.14), Windows 11: pass.
Setup: Windows 11. GPUs are an AMD Ryzen 7 9800X3D iGPU (RDNA2 gfx1036, driver 26.11.2, subgroup 32..64) and an RTX 4070 Ti SUPER (NVIDIA 621.14, subgroup 32). Each PR was tested in its own worktree with:
Baseline is main
The NVIDIA failure is |
Summary
Implements RDNA2
image_msaa_load(MIMG 0x80) — and shares the same lowering forimage_loadonSQ_RSRC_IMG_2D_MSAA/SQ_RSRC_IMG_2D_MSAA_ARRAY— intools/rdna2spirv.py.Claim: #5032 (comment)
Changes
tools/rdna2spirv.py:MSAA_DIMS(SQ_RSRC_IMG_2D_MSAA-> index 0,SQ_RSRC_IMG_2D_MSAA_ARRAY-> index 1) andGen.uses_ms_fetch.%msv{0,1,2}_{0,1}(OpTypeImage %float/%uint/%int 2D 0 <arrayed> 1 1 Unknown,MS=1,Sampled=1) at set 0 bindings 20/22/24 (2D_MSAA) and 21/23/25 (2D_MSAA_ARRAY), matchingruntime/src/vulkan_bindless.h.Gen.image_msaa_load: unpacks(x, y, sample_index)for2D_MSAAand(x, y, slice, sample_index)for2D_MSAA_ARRAY(includinga1616-bit packed unsigned integer coords and NSA lists), emitsOpImageFetch ... Sample <sample_idx>, and delegates numeric-class dispatch (float/uint/sintfrom T# FORMAT, with miss fallback to index 0 float view),dmask, andd16packing toimage_read_typed.glc,tfe/lwe, non-MSAA dims, non-VGPR destination, short address).image_msaa_loadtox_memory_order.tools/rdna2_decode.py:image_msaa_loadto the_mimg_addr_countload prefix check so_lin_loaddoes not add a spurious LOD address VGPR (verified againstllvm-mc -arch=amdgcn -mcpu=gfx1030 -show-encodingfor2D_MSAA,2D_MSAA_ARRAY,d16,a16, and NSA).tools/wave64_halves.py&tools/wave64_emulate_opt.py:image_msaa_loadalongsideimage_loadinLOADSand_x_memory_order_access.tests/semantic/test_image_msaa_load.py:rdna2_decode.decode_bytes+ round-trip translate), unsupported-form, andspirv-as/spirv-val(vulkan1.2) tests across 11image_msaa_load/ MSAAimage_loadvariants.Verification
python -m unittest discover -s tests/semantic -p test_image_msaa_load.py -v: 6/6 OK (includingspirv-as+spirv-valC:\VulkanSDK\1.4.363.0\Bin\spirv-val.exe --target-env vulkan1.2across all 11 MSAA variants)python -I tests/test_image_load_typed.py: 23 tests OK (2 skipped)python -m unittest discover -s tests/semantic -p test_image_coherent.py -v: 10 tests OK (1 skipped)python -I tests/test_isa_coverage.py: 20 tests OK (4 skipped)python -m pytest -W ignore tests/test_image_load_d16_typed.py tests/semantic/test_mem_crash_forms.py -q: 1 passed, 6 skippedpython -I tests/test_text_write_line_endings.py: 3/3 OKgit diff --check: cleanAI-assisted (Gemini 4 Neon).