fix(shader): store to converted three-channel images whose DST_SEL names W last #23111
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23111"
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 boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-11-18T18:46:29Z.
What
image_storeto an 11_11_10 or 10_11_11 image (UNORM or FLOAT) threwselects a channel the converted image format does not havewhen the T#'s fourth DST_SEL was W, as in the identity swizzle0xfac.These formats have no fourth channel, so a store has nothing to write there. RDNA2 writes the same bits whatever the fourth select is.
ResourceMaterializernow skips the W check for the fourth channel of a storage image. A W select in another channel still throws, as does any W select on a load, sample or gather of these formats.Measurement:
tools/hw-oracleon gfx1036 with coarse-grained memory:image_storedmask 0xf of 32 texels (values 0, 0.5, 1, 2.5, 100, 1e-3, 65000, 3.25 across the channels), read back withbuffer_load_dwordthrough a raw V#. These DST_SELs all give identical results, 32/32 texels against X,Y,Z,1:That holds for formats 30 (11_11_10_UNORM), 36 (11_11_10_FLOAT), 37 (10_11_11_UNORM) and 43 (10_11_11_FLOAT).
Tested
Windows 11 Pro 10.0.26200, MinGW Release build.
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, on an NVIDIA GeForce RTX 5080 (610.74) and an AMD Radeon(TM) Graphics iGPU (gfx1036, 32.0.21045.16010):agc_driver_image_converted_unorm: the store with DST_SEL X,Y,Z,W, which the test previously required to be refused, now goes throughCheckStoreand must write the same packed 11/11/10 texels as X,Y,Z,1. The load with X,Y,Z,W must still be refused. Passes on both GPUs, with no validation messages; onmainthe test asserted the refusal.agc_driver_image*tests andagc_shader_memoryon NVIDIA: 111 of 114 pass. The three failures are the known NVIDIA baseline failures onmain(agc_driver_image_plane_address_on_line,agc_driver_image_sample_lod_clamp,agc_driver_image_sample_lod_clamp_shader_lane).Not tested on a PS5.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T08:09:11Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and added regression test support the stated behavior.
What I ran
Reviewed head
724511ce9de00a91305c0eb55effe83a5c799f7a. I read the prepared description, commit summary, manifest, diff, and every changed line in the three reviewed files, then inspected the changed function and test context throughrepo_read.py. No build or runtime checks were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported hardware measurements and test runs were not independently verified. PS5 behavior, builds, and runtime tests were not run. The prepared
files.jsonwas unavailable; the review folder’s README and manifest identify all three changed files as included, and all their added lines were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T23:23:54Z.
Review: COMMENTED
Actionable comments posted: 1
ca0ae791-235f-4511-9967-b2091fb4d4cdReviewing files that changed from the base of the PR and between
1f27e2abfaandc7b49d867c.core/libs/prx/libSceAgcDriver/tests/execution/ImageConvertedUnorm.cppcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppdocs/dev/debt/changes/fix-shader-converted-store-w-select.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T23:32:39Z.
Review: COMMENTED
Reviewed — comments
The review covers head
c7b49d867ca50d02e653281ab0b5aea5e28c594b; I found no verified blocking defect and have one optional test coverage point.What I ran
Read the prepared diff and all three changed files through
repo_read.py. No build or test command was run.Results
Negative control
Not run; no test execution was performed.
Findings
Blocking
None.
Non-blocking
Wselector with dmask0x7, so it does not check the PR description’s stated dmask0xfbehavior. Consider adding a case that enables the fourth store channel to pin down the no-op behavior. Changed line:core/libs/prx/libSceAgcDriver/tests/execution/ImageConvertedUnorm.cpp:1072.Sources
The code path allows the fourth selector only for storage descriptors while retaining the missing-channel rejection for the other selectors:
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp:392. The test keeps the load rejection and adds the store case:core/libs/prx/libSceAgcDriver/tests/execution/ImageConvertedUnorm.cpp:1071andcore/libs/prx/libSceAgcDriver/tests/execution/ImageConvertedUnorm.cpp:1072.Not verified
No build or tests were run, and PS5 behavior was not verified. All three changed files listed in the manifest were read; no changed files were excluded.
To get this to a good state
Nothing is required. Optionally add a dmask
0xftest for the fourth-channel selector.