Repository navigation
Conversation
The typed-buffer load path applied the V#'s DST_SEL (dword3 [11:0]) to every format load, tbuffer_load_format_* (MTBUF) included. The RDNA2 ISA's "Buffer Data" table gives the DST_SEL source per instruction: buffer_load_format_* / buffer_store_format_* use the resource's, tbuffer_*_format_* take FORMAT from the instruction and use the identity select (X, Y, Z, W), as do the raw and atomic forms. With a V# whose DST_SEL is not identity (a swizzled or all-SEL_0 word3, as on a raw buffer descriptor), tbuffer loads came out reordered or zero. MTBUF format loads (and their d16 forms) now take the converted components in order; missing components still get the format fill (0, 0, 0, 1). buffer_load_format_* is unchanged. Tests: tbuffer_load_ignores_vsharp_dst_sel checks the emitted HLSL (buffer_load_format keeps dst_sel(), the tbuffer xyzw and d16_xyz forms read t_c.x.. in order) and compiles it when DXC is present; gpu_tbuffer_load_identity_dst_sel loads through a V# with DST_SEL (z, y, x, w) and one with SEL_0 everywhere: buffer_load_format_xyzw returns (3, 2, 1, 4), tbuffer xyzw (1, 2, 3, 4), tbuffer 16_16_FLOAT (1.0, -2.0, 0, 1.0) and its d16_xyzw / d16_xy forms packed in order. Checked off-tree: a Python port of fmt_comp / dst_sel / the d16 packing (check_formats.py) gives the expected test vectors; the same script compares fmt_comp with an independent decoder over all 77 formats (random elements plus 0, 1, max and sign-boundary components) and round-trips decode/encode for every representable element. Not built or run on Windows. Assisted-by: Claude Code (Claude Opus 5.5)
Owner
Author
|
Upstream PR xcl-dev#875 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
FormatLoadincrates/xcl/src/gpu/recomp/emit.rssotbuffer_load_format_*(ENC_MTBUF) uses the identity component select(x, y, z, w)instead of applying the V#sDST_SELfield (dword3[11:0]`):buffer_*_formattakes both its format andDST_SELfrom the V#, whereastbuffer_*_formattakes its format from the instruction and uses the identity select.tbuffer_load_format_*through a V# with a swizzledDST_SELreturned reordered components, and aSEL_0V# returned all zeros.buffer_load_format_*continues to applydst_sel(); stores and(0, 0, 0, 1)missing-component fill are unchanged.tbuffer_load_ignores_vsharp_dst_seland GPU testgpu_tbuffer_load_identity_dst_selverifying both swizzled8_8_8_8_UINTandSEL_016_16_FLOATV#s.Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC debug, DXC Windows SDK10.0.26100.0,d3d12SDKLayers.dllinstalled54ed7eb4bdbd9e205612e807e9b05f0c450ef2accargo build --workspace: clean (no new warnings; only pre-existingfetch_updatedeprecation warning)cargo test --workspace -- --test-threads=4: 715 passed, 0 failed, 41 ignored (tbuffer_load_ignores_vsharp_dst_selok,gpu_tbuffer_load_identity_dst_selok)SKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64Not tested
scripts/smoke.ps1) not yet run (no retail title available in this clean-room environment); opened as Draft pending a smoke run.AI use
Mirror of xcl-dev#875 (auto-synced, do not edit).