Repository navigation
feat(agc): accept 8_8_8_8 UINT color targets - #1736
Conversation
…gets SPI_SHADER_COL_FORMAT 7 (UINT16_ABGR) was rejected by DecodeState, though the recompiler already handles it: a pixel shader's MRT output under mode 7 is a uvec4, and a compressed export's 16-bit halves are taken with OpBitFieldUExtract. The format is now accepted when the target's CB_COLOR_INFO number type is UINT; into any other target it still throws, as does SINT16_ABGR (8), whose halves would need sign extension. The target records the export (ColorTarget::uintExport). Shader validation then requires a uint4 output at its location instead of a float4 one, and blending into it is refused (Vulkan has no blending of integer attachments). PPSA14632 (LEGO Horizon Adventures) writes a 2848x1600 R8_UINT target this way; those draws were dropped. agc_driver_pixel_uint16_export draws compressed MRT0 exports under mode 7 into a linear 16_16_16_16 UINT target, one row per pair of packed words (0x0000ffff/0xffff0000, 0x00010002/0xffffffff and four distinct halves), and reads every 16-bit component back under the identity, STD_REV and ALT_REV export mappings. agc_driver_graphics covers the decode and the blend refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Linux run, since the description lists AMD and Linux as not tested: Ubuntu 24.04.5 (kernel 6.8), GCC 13.3, Release, AMD Radeon RX 7600 (RADV NAVI33, Mesa 25.2.8). This PR's head Full ctest: 481/481 pass, with the GPU tests running on the RX 7600 (none skipped). That includes the new |
|
Checked on RADV (Radeon 660M): |
…uint feat(agc): accept 8_8_8_8 UINT color targets
What
COLOR_8_8_8_8with number type UINT threwunsupported color format 10 number type 4 component swap 0. RADV renders intoR8G8B8A8_UINTimages through it. With #1073, ccleste (PPSA59322) writes such a target with aUINT16_ABGRexport, and it was the last draw ccleste dropped.This builds on #1073, which accepts that export and validates the
uvec4output. Its first commit is #1073's and drops out once that merges.COLOR_8_8_8_8UINT decodes toVK_FORMAT_R8G8B8A8_UINTfor component swaps 0, 2 and 3, with the same reversed export mappings as the other 8_8_8_8 types.B8G8R8A8_UINT, which Vulkan does not require as a color attachment, unlikeR8G8B8A8_UINT.agc_driver_graphics(uint8x4TargetTests): the target decodes asR8G8B8A8_UINTwithuintExportset, swaps 2 and 3 decode, and swap 1 throws.agc_driver_uint8x4_color_targetdraws a compressedUINT16_ABGRexport into a linear 256x648_8_8_8_UINTtarget. It requires every channel's byte inside the scissor and the untouched bytes outside it. It fails withunsupported color format 10 number type 4 component swap 0without this change.Tested
Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti.
agc_driver_pixel_uint16_export) passes on this branch. It was run from the generatedCTestTestfile.cmakecommands because antivirus blocksctest.exeon this machine.RADV_DEBUG=nonggcset. I found feat(agc): accept UINT16_ABGR color exports into unsigned integer targets #1073 only afterwards, so this is now based on it.Not tested on AMD, Intel or Linux.
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