feat(agc): centroid pixel inputs and NoPerspective by I/J pair #136
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/136"
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 oneandonlydean on 2026-09-29T00:33:26Z.
What
DecodePixelStageInforejectedSPI_PS_INPUT_ENA/ADDRwith PERSP_CENTROID (bit 2) or LINEAR_CENTROID (bit 6). PPSA21564 binds 0x326 (perspective center and centroid, linear center, POS_X/Y). Both bits are now accepted.SPI_PS_INPUT_ADDRplaces every input it names in SPI order (2 VGPRs per I/J pair, 3 for the pull model, 1 otherwise), loaded or not, and ENA & ADDR selects the loaded ones.ShaderPixelStageInfocarriesinputAddr(replacingperspectiveCenterVgpr) plusperspectiveCentroidandlinearCentroid.PixelInputVgpr(inputAddr, input).psSystemInputBasewas never set, so POS_X overwrote the center I whenever barycentrics were enabled.BaryCoordKHRfor perspective,BaryCoordNoPerspKHRfor the linear center and centroid pairs.psNoPerspectiveflag). Now:v_interp_p2records, per parameter, whether its J operand is the J of a loaded linear pair or a perspective pair (IrProgramMetadata::pixelLinearInputs/pixelPerspectiveInputs).RequestSerializermoves to version 5 (main is at 4 since #133 addedMeshConfiguration::esgsItemSize). The new pixel fields are gated on>= 5, and requests before version 5 read back with their loaded inputs as the layout. The recompile cache key and the driver's draw key compare and hash the new fields.The TechnicalDebt entry about skipped barycentrics is unchanged. This PR does not change how
fragmentShaderBarycentricEnabledreaches the recompiler.No overlap with #101 or #83: both touch
TranslationContext.hppnext to the image op declarations, and this PR addsSetPixelInputand a member elsewhere in the class.Tested
agc_shader_memorygainsverifyPixelInputs:PixelInputVgprlayouts (0x326, and ADDR-only inputs reserving VGPRs),inputAddrand the centroid flags survive serialization and change the cache key and the context hash.agc_driver_graphics_testsPixelInputLayoutTests:On main, 0x326 is rejected.
main.ctest: 79/79 pass;agc_driver_graphics_testsandagc_shader_memory_testspass.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 repositoryImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-09-30T21:01:08Z.
On the overlap note: the shared part with #167 is the pixel system input base. On main
psSystemInputBaseis never set, so the system inputs are written from v0 over the interpolants; #167 fixes that by counting the VGPRs thatSPI_PS_INPUT_ADDRnames and passing the sum as the base. This PR fixes the same bug as part of the full layout (every inputSPI_PS_INPUT_ADDRnames is placed at its own VGPRs in SPI order, andENA & ADDRselects the loaded ones), so it covers that piece of #167. The rest of each PR is independent.If #167 merges first, I'll rebase this PR onto it straight away. #137 is stacked on this one and only shows the overlap through this commit.