fix(shader): pass pass-through pixel inputs through rect-list draws #22052
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22052"
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 milescoviello on 2026-11-17T03:08:55Z.
What
Update 11-18: since #20827 merged, Borderlands 4 and MXGP 26 no longer reach this refusal on
main(7a46b9fef): their draws now log only "preparing it at draw", and both run past their old stops without this PR (BL4, MXGP). The refusal itself is unchanged onmain, so this change still matters for any draw that reaches it, such as PPSA28099 (edubox, below). The BL4 and MXGP results under Tested are from before #20827.BuildRectListShadersrefused every pixel input with custom (pass-through) interpolation (SPI_PS_INPUT_CNTLOFFSETbit 5 withFLAT_SHADE,0x420) withRect-list SPIR-V: custom per-vertex interpolation is unsupported. A rect-list draw whose pixel shader reads one ends the title. Onmainthis is how MXGP 26 (PPSA30839) and Borderlands 4 (PPSA01494) stop (see Tested). Forspoken (PPSA03984) defers 11 pixel shaders at pipeline creation for the same reason.f5ae0b8106kept the refusal for these inputs because "their fourth vertex has no value of its own". The generated stages already give each kind of read what it needs:flat+custom, after host interpolation): the input is flat, and the control stage passes the first vertex's value to all four corners. That is the rectangle's vertex 0 over the whole rectangle. The pipeline still refuses the last provoking vertex for these inputs (Pipeline.cpp), solastVertexControlnever serves them.emulation.perVertex. Every corner carries the rectangle's three vertices, and the barycentrics are relative to them, so the reads see the three original vertices beyond the diagonal too.What this changes
require(!input.custom, ...)inBuildRectListShadersis removed. Custom inputs take the existing flat, emulated and native paths unchanged.APS5_NO_FRAGMENT_SHADER_BARYCENTRIC(new,VulkanDevice.cpp, listed indocs/dev/ENVIRONMENT.md) leaves VK_KHR_fragment_shader_barycentric unused, as on a device without it.agc_driver_prepared_shaders --abi-deferred-rectangle-pairsused the removed refusal as its pair that the pipeline ABI cannot build. It now reads an unexported parameter per vertex and sets the switch, so the emulated path refuses it (an emulated per-vertex parameter is not exported by the vertex shader) on every device. The switch can also put a title on the emulated path to compare the two.Tested
Linux (Ubuntu 26.04.1), GCC 15.2, Release, RTX 4070 Ti (NVIDIA 615.71.09).
agc_driver_pixel_barycentric_emulation, new rect-list pass-through cases, checked pixel by pixel over the whole rectangle including past its diagonal:agc_driver_graphicsrectListTests: a pass-through input read per vertex builds the same control and evaluation SPIR-V as an explicitly interpolated one.agc_driver_prepared_shaders --abi-deferred-rectangle-pairsdefers its pair once with the builder's reason, as before.main'sRectListShaders.cppwith the new tests fails both (Rect-list SPIR-V: custom per-vertex interpolation is unsupported).:0, 360 s per run:main8332b52dbfagainst this branch 3c1d4b7863 (mainplus this commit).main8332b52dbf(1 run)APS5_NET_DISCONNECTED=1Earlier
mainruns stopped the same way: BL4 at 81 s on459f4f8c22, MXGP at 24 s on133feb30f0.MXGP's screens are upside down on this branch, as its loading screen is on
mainbefore the stop. That is the #16053 start-value regression #20827 addresses, and it is unrelated to this change. For MXGP, #20827 alone ran 180 s to the gamma-calibration menu without reaching a refused draw; why the start values change that is not known.BL4 with #20827 as well (added 11-16, 8:40 PM PT):
mainb412486d3e(47aed6fbad), BL4 reaches its first-run Accessibility screen fully drawn in 2 of 3 runs; the other ended at UE's RenderThread watchdog during the logo (196 s).Contact sheets: release rectlist-passthrough-ab-8332b52dbf.
3c1d4b7863 is this PR's code before the debt fragment was added; the pushed head differs from it only in
docs/dev/debt/changes.maskym's Windows + NVIDIA run of
58250e9185merged intomaine069a7562f(Windows 11, i7-12700K, RTX 2070 SUPER, WinLibs GCC 15.2.0, Release, Khronos validation layer 1.4.366): theagc,guest_video_out,video_outandpad_sdltests pass 2050 of 2054 on bothmainand this PR with the same set ofVUID-messages, the tests this PR adds or changes pass, and the three failures also fail onmainthere.git merge-treeagainstmainis clean. #17022 (rect-list layer forwarding) merges with this branch without conflicts.tools/check_conventions.pypasses on the branch and this body.tools/debt_fold.py --checkreports nothing for this fragment.main(edb21febfa) itself fails the check on two LibreSSL3 fragments that change the same entry (libressl3-20171-inventory.md,feat-libressl3-evp-pkey-new-mac-key-v2.md); with that pair set aside, the check passes.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)main8332b52dbfwith this PR (see Tested), but since #20827 they no longer reach it onmain.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T05:15:11Z.
Review: COMMENTED
Reviewed — comments
The core change removes the rect-list shader builder’s unconditional refusal of custom pixel inputs, and the inspected code supports the claimed pass-through paths; native per-vertex behavior remains documented as unverified on console hardware.
What I ran
No commands or tests were run. I inspected the prepared diff at head
58250e9185665251797bc3718dc5da494c9ce07eand read the full text of the changed files marked included in the manifest, plus relevant ranges in the two excluded files. I did not read a ruling file or use repo_read.py.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
None.
Not verified
The full contents of
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Graphics.cppwere excluded from the prepared review folder; only the changed Vulkan feature-selection line and changed graphics-test range were read. The behavior of native per-vertex inputs on console hardware was not measured. Reported tests, title runs, and Windows results were not independently run or confirmed.To get this to a good state
Nothing is required.