Repository navigation
fix(agc): read zero for pixel inputs of parameters the vertex stage does not export - #3523
Merged
adriadam10 merged 2 commits intoOct 11, 2026
Conversation
…oes not export
A pixel input whose SPI_PS_INPUT_CNTL offset names a parameter the
previous stage does not export failed validation ("graphics interfaces
disagree"), so the draw threw. No export writes that parameter slot for
the draw. radeonsi programs a pixel input without a matching vertex
output as OFFSET 0x20 with DEFAULT_VAL 0, so that it reads (0, 0, 0, 0)
(SI_PS_INPUT_CNTL_UNUSED in si_shader.h, applied in si_shader.c), and
rect-list draws already pass zero for such inputs.
Before the pixel stage of a draw is prepared, inputs that read a
parameter the previous stage's program does not export now read zero:
OFFSET bit 5 is set, DEFAULT_VAL and FLAT_SHADE are cleared, and an FP16
input also reads zero in its high half (USE_DEFAULT_ATTR1 set,
DEFAULT_VAL_ATTR1 cleared). Inputs that already read a default value
are unchanged.
Fixes boykopovar#2975.
XairRrR
force-pushed
the
fix/agc-default-unexported-pixel-inputs
branch
from
October 11, 2026 14:16
7820f73 to
2f140cb
Compare
9 tasks done
Collaborator
|
Checked the diff against #2975 and radeonsi's 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. |
10 tasks done
This was referenced Oct 12, 2026
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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)