feat(agc): implement 1D array textures #931
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/931"
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 CnRJay on 2026-10-06T18:46:56Z.
What
A T# of type 12 (1D array) threw while it was decoded. Now:
VK_IMAGE_VIEW_TYPE_1D_ARRAYfor both sampling and storage.Tested
Windows 11, MinGW GCC Release build, ctest
agc_driver_graphicsandagc_driver_image_one_dimensional_arraypass.agc_driver_graphics(tests/GuestTextureResource.cpp): a type 12 T# decodes to a 1D array whose surface holds every array slice. A base array past the last slice, and a nonzero height, are rejected. Z_X and R_X decode, and SW_4KB_S and SW_64KB_S_X are rejected.agc_driver_image_one_dimensional_array(new, on the GPU):image_sample_lzon a 3-layer 1D array returns each layer's texels, including fractional and out-of-range layer coordinates, which round and clamp to the first or last layer.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T09:22:33Z.
Review: CHANGES_REQUESTED
Checked on hardware (gfx1035 HW oracle):
image_loadwithdim:SQ_RSRC_IMG_1D_ARRAYagainst the same T# as a height-1 2D array, 32_UINT, widths 8 and 100, 3 layers, 1 and 4 mips, every tile moderesolveTileModeaccepts. Build and ctest pass here (RADV, the new test runs), and the new tests need the change.64KB_Z_X(0x18) and64KB_R_X(0x1b): the 1D array reads exactly the bytes of the height-1 2D array, so the layout inTextureTiling.cpp:386/TextureCache.cpp:42is right for them.256B_S(0x01),4KB_S(0x05),64KB_S(0x09),64KB_S_X(0x19),64KB_D_X(0x1a): the hardware does not address a 1D array like that. Layer 0, width 8, 0x01: x=7 reads byte 12 (the texel of x=3), the height-1 2D array reads byte 140; x=5 reads byte 4. 0x05, width 100: layer stride 4096 bytes, the 2D array's is 16384. addrlib doesn't allow these modes for 1D resources at all (Gfx10Rsrc1dSwModeMask= linear | Z | R ingfx10addrlib.h, checked inValidateSwModeParams).GuestTextureResource.cpp:154: the decoder accepts them and the driver then samples a 2D-array layout, a plausible but wrong result. Please reject 1D arrays whose tile mode is not linear, Z or R (aRequirelike the other cases) and add a reject row for one S mode totests/GuestTextureResource.cpp.k1Donmainhas the same gap (GuestTextureResource.cpp:141).Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-07T17:56:24Z.
should be good now
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T20:43:40Z.
Review: APPROVED
Rechecked
eb30830: build + ctest green on RADV, and the new tests need the change. Checked on the gfx1035 HW oracle (linear and 64KB_Z_X): theimage_sample_lz1D_ARRAY layer is round-to-nearest-even and clamped (ties 0.5/1.5/2.5, ±inf and huge values included), the same as for 2D arrays, which matches the test's expectations. Thanks for restricting the tile modes; merging.