Repository navigation
fix(shader): store through DIM 2D image_store to a cube T#'s BASE_ARRAY face - #6799
Conversation
|
The regression proves the emulator’s selected Vulkan view writes the requested face, but the PR explicitly says the corresponding guest |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
That's fair: the test only shows that the Vulkan view I chose writes the face I expect, not what the hardware writes. I don't have an RDNA GPU here, so I can't run the oracle myself, and this PR shouldn't merge on the analogy to #4139 alone. I'll leave it waiting for a measurement rather than add an opt-in gate, since a gate that stays off would leave the title stopping either way. To make the measurement quick for anyone with an RDNA2 card (or @billythemenace2, who measured #4139), here is an oracle kernel and runner. Each of 64 lanes stores its value at (x, y) = (lane & 7, lane >> 3) through a DIM 2D
|
|
Measured the requested DIM 2D Hardware/toolchain: AMD gfx1036, PCI I ran your posted assembly without syntax changes, with 64 rows and the 64 KiB pattern-filled
For every dispatch, all 64 texels on the selected face equal the input bits I also checked the backing memory independently of the image-load descriptor: after the store/wait/barrier/cache invalidation, replace the image reads with Exact rows to pin ( These controls rule out a missing store, a BASE_ARRAY-ignored store and an apparent result caused only by the readback view. Assembly SHA-256: Limits: the supplied 8x8, 12-slice, mip-less descriptors, formats 20/22 and the finite value bits above. No atomics, other formats (including the title's 16_16_16_16_FLOAT), mip behavior, PS5 measurement, emulator build or Crimson Desert replay. This establishes the requested face-selection/store behavior on gfx1036; it does not validate those other paths. |
4ffb8bc to
d697c92
Compare
|
Thank you @simonbbby, that is exactly the measurement this needed, and the raw-buffer check that only the 64 target dwords change rules out more than I asked for. @MarcZX100: with that, the store path is no longer unmeasured for the case the test pins. On RDNA2 (gfx1036, not the PS5's gfx1013), a DIM 2D AI-assisted: yes |
|
Adding FORMAT 71 / 16_16_16_16_FLOAT to the gfx1036 measurement, since the current description explicitly leaves the title's format unmeasured. Head refreshed: Same native RDNA2 oracle setup as the earlier result: gfx1036, Ubuntu 24.04, kernel 7.0.0-38, ROCr 5.7.1, clang/LLD 18.1.3. Controls: Kept the supplied 8×8 mip-less cube-array descriptors, TYPE 11, DEPTH 11, BASE_ARRAY 0 or 6, and the 64 KiB patterned backing. Changed FORMAT_BITS to v_mov_b32 v40, v4
v_mov_b32 v41, 0xc0000000
v_mov_b32 v42, 0x40800000
v_mov_b32 v43, 0x3e800000
image_store v[40:43], v[5:6], s[16:23] dmask:0xf dim:SQ_RSRC_IMG_2D unormRows use
The generated store-prefix assembly SHA-256 is Scope: this adds the four-channel half-float format with these finite, exactly representable values and this linear-aligned geometry. It does not measure the title's full 256×256 tiled descriptor, exceptional/rounding-edge values, mips, atomics, PS5/gfx1013 or an emulator/title run. No repository source changed. |
|
Added this to the description and to the debt entry (273675b): the debt entry no longer lists 16_16_16_16_FLOAT as unmeasured, and still names the title's 256x256 tiled descriptor as unmeasured. AI-assisted: yes |
…AY face A DIM 2D image_load through a cube T# already reads texel (x, y) of the T#'s BASE_ARRAY face (boykopovar#4139, measured on RDNA1). A DIM 2D image_store to a cube T# had no matching runtime mode and threw "image descriptor is incompatible with the static runtime image interface". Crimson Desert writes a 16_16_16_16_FLOAT cube this way from a compute shader. A mip-less image_store to an image the program only stores to now takes the same face mode, writing texel (x, y) of the BASE_ARRAY face, the face the measured load reads. Stores were not measured on hardware; the debt entry says so. Formats that store through a conversion (SINT) keep throwing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonbbby measured DIM 2D image_store through 8x8 cube arrays on RDNA2 (gfx1036): 32_UINT and 32_FLOAT stores with BASE_ARRAY 0 and 6 write that face and nothing else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonbbby measured four-channel 16_16_16_16_FLOAT stores through the same 8x8 cube arrays on gfx1036: they land on the BASE_ARRAY face and leave the rest of the backing unchanged, so the debt entry no longer lists the title's format as unmeasured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
273675b to
c3a7e4f
Compare
|
Checked the diff: the tracker only keeps the cube-face mode for mip-less |
What
A compute shader in Crimson Desert (PPSA25286, 01.000.568) writes a cube map through DIM 2D
image_stores and stops recompiling:The T# is a 256x256 16_16_16_16_FLOAT cube (
TYPE11,DEPTH5,BASE_ARRAY0) with one level. The program runs 8x8 threads per group, reads 2D images and writes its results withimage_store(0xf0200f08and0xf0200108, DIM 2D, no mip). #4139 already reads a cube T# through a DIM 2Dimage_loador sample as theBASE_ARRAYface, measured on RDNA1. A store had no such mode.How
ResourceTracker: a mip-lessImageWritekeepscubeFaceCompatible.ResourceMaterializer: the face mode (the 2D-array cube view) is added for an image the program only stores to, as well as for reads. Its integer coordinates are (x, y, 0), and the storage view starts atBASE_ARRAY, so the store writes texel (x, y) of theBASE_ARRAYface, the face the measured load reads.DEPTH11) withBASE_ARRAY0 and 6, in wave32 and wave64, write texel (x, y) of that face and leave every other byte of the 64 KiB backing unchanged. That is the same layout and the same every-other-byte checkagc_driver_image_store_face_on_cubemakes. simonbbby then measured this title's 16_16_16_16_FLOAT the same way. Four-channel stores of exactly representable half values pass 20 of 20 dispatches (BASE_ARRAY0 and 6, wave32 and wave64), and only the 64 stored eight-byte texels change in the backing. The debt entry records both measurements (273675b), says that other formats and the title's own 256x256 tiled descriptor are not measured, and lists what still throws: atomics, an image the program also reads, formats written through a conversion such as 32_SINT, and mip loads and stores.Tested
Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99.
agc_driver_image_store_face_on_cube(new, GPU): 64 threads store their value at (tid & 7, tid >> 3) into an 8x8 cube array T# (DEPTH11) withBASE_ARRAY0 and 6, for 32_UINT and 32_FLOAT. Every texel of that face must hold its thread's value, and every other byte of the 12 faces must be unchanged. Withmain'sResourceTracker.cppandResourceMaterializer.cppit fails 3 of 3 with the error above (descriptor format 20 decodes to {class 2, dim 5, ..., cube 1, ...}). With this change it passes 3 of 3.agc_driver_image_plane_address_on_cube,agc_driver_image_store_line_through_plane,agc_driver_image_store_array_through_volume: 3 of 3.^agc_driver_|^agc_vertex_barrier|recompiler|shader_cache|request_serializer|spirv|^agc_shader|bda|journal, 502 tests) onmaineb901bc: 500 pass.agc_driver_store_over_untrackedfails the same way onmain(test(agc): keep waiting for the neighbour copy case's result #6385 addresses it), and so doesagc_driver_graphicsin a case fix(agc): stop pixel invocations on BDA faults when supported #5804 added (test(agc): keep the vertex terminate case's code in static storage #6789 fixes it).Crimson Desert (PPSA25286, 01.000.568), 900 s limit, 16 GiB cap, scripted pad input. On
mainthe title stops 14 s in (#6612), so these runs use my test stack: #6612, #6613, #6706, #6708, #6748, #6178 and #6785.SrtWalker::EvaluateRuntimeSourcesrefusal in another compute shaderRebased onto
main82ddae7 (d697c92): the four cube and volume store tests pass 3 of 3, and the 502 area tests pass exceptmain'sagc_driver_graphics(#6792) andagc_driver_store_over_untracked(#6385).Not checked on Windows or on a console. On AMD, only the oracle measurement above was run, not this emulator build.
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