fix(agc): read zero for pixel inputs of parameters the vertex stage does not export #3523
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3523"
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 XairRrR on 2026-10-11T12:18:20Z.
What
Fixes #2975. Same approach as #3336 by @Tamalero, which the intake pause closed. This version also covers FP16 inputs (see below).
A pixel input whose
SPI_PS_INPUT_CNTLoffset names a parameter that the previous stage does not export failed interface validation, so the draw threw:No export writes that parameter slot for the draw. radeonsi programs a pixel input without a matching vertex output as
OFFSET0x20 withDEFAULT_VAL0, so it reads (0, 0, 0, 0) (SI_PS_INPUT_CNTL_UNUSEDinsrc/gallium/drivers/radeonsi/si_shader.h, applied insi_shader.c). Rect-list draws here already pass zero for such inputs.Changes:
Graphics::DefaultUnexportedInputsmakes each input whose parameter the previous stage's program does not export read zero:OFFSETbit 5 set,DEFAULT_VALandFLAT_SHADEcleared.USE_DEFAULT_ATTR1set andDEFAULT_VAL_ATTR1cleared. The recompiler reads the high half's default from those fields (InputHalfIsDefault), so without this the input would still need an interface slot.Test in
tests/Graphics.cpp(UnexportedPixelInputTests):DEFAULT_VAL;Uncharted: Legacy of Thieves Collection (PPSA05684) issues such draws: a pixel shader reads seven parameters after a vertex shader that exports one. With this change, these draws no longer throw.
Tested
BUILD_TESTING=ON.a11c8f7f. Full ctest: 831/832. The one failure,agc_driver_emulated_color_compare, fails the same way on plain main. Conventions check passed.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)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:29:35Z.
Checked the diff against #2975 and radeonsi's
SI_PS_INPUT_CNTL_UNUSED(OFFSET bit 5,DEFAULT_VAL0);agc_driver_graphicspasses, the new test does not build without the change, and the scoped libSceAgcDriver ctest is green (390/390).Added by us: a TechnicalDebt line under "Functional" recording that the zero default follows radeonsi and is not measured on console hardware.
Merging once CI is green.