fix(shader): give converted image stores the cube-face mode again #22534
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22534"
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 milescoviello on 2026-11-17T19:34:13Z.
What
Crimson Desert (PPSA25286) stops on current
mainwithcompute shader 0x22946ac100: image descriptor is incompatible with the static runtime image interface: descriptor format 71 decodes to {class 2, dim 5, conversion 71, ..., cube 1, ...}. The exception escapes the queue and terminates the title (EXIT-134).The shader does a DIM 2D
image_storeto a cube T# in16_16_16_16_FLOAT. My #6799 change (dbf176f2ef) gave that store a runtime mode for exactly this case: it writes texel (x, y) of the T#'sBASE_ARRAYface, as measured on RDNA2 for 32_UINT, 32_FLOAT and 16_16_16_16_FLOAT. That mode is offered only when the store has no format conversion.Since
9d6b917388(round 16-bit float image stores toward zero), 16-bit float stores go through a conversion mode (conversion 71 for16_16_16_16_FLOAT). So the cube-face mode no longer matches, and the store throws again.The change in
RuntimeImageModes:Accesses that read the image, atomics, mip stores, gathers and the rest still throw, as before.
Tested
11-20, title run past the stop:
main93f62d93f8plus this PR, #22609, #22778, #23864, #23880, #22690 and #22703 (all mine) runs Crimson Desert (PPSA25286) for the whole 602 s and reaches the settings menu over the title screen at about 1.7 fps (shot at 600 s, D#16802 post). All 12 rotation runs onmainsince 11-19 end on the format-71 cube store this PR fixes, 196 to 301 s in. I haven't checked which of the other six PRs that run needed.Linux (Ubuntu 26.04.1, kernel 7.0), GCC 15.2, Ninja, Release,
-DBUILD_TESTING=ON, RTX 4070 Ti on NVIDIA 615.71:agc_driver_image_store_face_on_cubegains32_SINT(format 21) and16_16_16_16_FLOAT(format 71) next to 32_UINT and 32_FLOAT, atBASE_ARRAY0 and 6. For the 8-byte format it checks the whole texel: the stored value rounded toward zero to half precision in the first component, zero in the other three. Every byte outside the face must stay unchanged.agc_driver_image_store_float_rounding,agc_driver_image_store_float_rounding_codegenandagc_shader_memory(whose image-mode refusals still throw) pass, 3 runs.main'sResourceMaterializer.cppand the extended test,agc_driver_image_store_face_on_cubefails.Windows 11 (VM, GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release,
ANYPS5_REQUIRE_VULKAN=1):agc_driver_image_store_face_on_cube,agc_driver_image_store_float_roundingandagc_driver_image_store_float_rounding_codegenpass 3 runs on aa18d259c5, the pre-squash commit with this tree.Crimson Desert (PPSA25286), Linux, RTX 4070 Ti: offline (
APS5_NET_DISCONNECTED=1), 22G cap, 300 s, warm shader cache. Basemainb179497cf5; PR5e54d3fb1e(b179497cf5with this commit cherry-picked).EXIT-134at 224 s,terminateEXIT-134at 73 s,terminateEXIT-134at 172 s on the next stop,AGC graphics: unsupported color format 9 number type 4 component swap 0(a 2_10_10_10 UINT colour target), after a second presentSo with this change the title gets past the cube store and stops later, on an unrelated colour format (#22609 handles that one). The screen is still black after the first present in every run, so I'm not claiming any visible progress.
Still needed on current
main6119c53c4b(11-18, a build with #22778 merged for another test,PLAY=1presses): Crimson Desert stops on this same error (descriptor format 71 decodes to {class 2, dim 5, conversion 71, ..., cube 1}, compute shaders 0x21d4db4100 and 0x21546a4100) at 509 s with a cold shader cache and at 89 s with a warm one. Builds with this PR, #22609, #22690 and #22778 onmain604828bd44ran Crimson Desert past it to the 600 s timeout five times.git merge-treeagainstmainis clean.tools/check_conventions.pypasses on the branch and this body, andtools/debt_fold.py --checkreports nothing for this fragment.be7ab63e59merged ontomain9a50e1014e(Radeon 760M, AMD Software 26.11.2, WinLibs GCC 15.2.0, Khronos validation layer 1.4.363):agc_driver_image_store_face_on_cubepasses 3/3 on both sides with noVUID-lines; with this PR's test onmain's sources it fails withimage descriptor is incompatible with the static runtime image interface.be7ab63e59merged ontomain7c836568c8(Mesa 26.2.6, RX 7900 XT and 7800X3D iGPU, Khronos validation layer 1.4.363.1): no new failures againstmainin the full suite on the 7900 XT or the GPU tests on the iGPU, and noVUID-orSYNC-HAZARDlines.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T14:17:18Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the optional point below is informational.
What I ran
Reviewed head
be7ab63e591fc8d532ad103f7d30b9d453e22059. I read the PR description, commit summary, manifest, diff, and all three changed files. The author reports tests and a clean merge-tree check; I did not run commands or tests.Results
Findings
Blocking
None.
Non-blocking
Wantedhelper derives the expected 16-bit float value from the knownValuebit pattern. The resulting values appear to be exactly representable, so this checks encoding and component layout but does not independently exercise rounding toward zero for an inexact half value. A test with a value between half-precision values would directly cover the rounding behavior described in the PR.Not verified
I did not run tests, inspect CI output, or independently verify the reported GPU and game runs. No changed files were excluded; all changed files listed in the manifest were read.
To get this to a good state
Nothing is required. The rounding test suggestion is optional.