feat(agc): replace point sprite inputs with the point coordinate #19821
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19821"
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 c1b3r-p3d1a on 2026-11-14T00:28:31Z.
What
A point draw whose pixel input sets
SPI_PS_INPUT_CNTL.PT_SPRITE_TEXwhileSPI_INTERP_CONTROL_0.PNT_SPRITE_ENAis on stopped withpoint sprite texture coordinates (SPI_PS_INPUT_CNTL PT_SPRITE_TEX) are not implemented. Such an input now reads the point coordinate instead of the interpolated attribute.decodePointSize(State.cpp) keepsSPI_INTERP_CONTROL_0bits 1-14 (PNT_SPRITE_ENA,PNT_SPRITE_OVRD_X/Y/Z/W,PNT_SPRITE_TOP_1) inState::pointSpriteControlwhen an input hasPT_SPRITE_TEX.DrawDecodecopies the value intoShaderPixelStageInfo::pointSpriteControl, and the draw cache key and lookup include it.SEL_SandSEL_Tcome from Vulkan'sPointCoord, with T flipped to1 - TunderPNT_SPRITE_TOP_1.SEL_0andSEL_1give 0.0 and 1.0, andSEL_NONEkeeps the interpolated attribute. The input is declared only when an S or T select is read. This works on both paths: host interpolation, and explicit P0/P10/P20, where P0 is the coordinate and P10/P20 are 0, sov_interp_p1/p2gives the coordinate at every pixel.ShaderValidationaccepts aPointCoordfragment input (f32x2).u32at the end of the request (version 65, after main's version 64 split state; 0 without pixel info), and older requests decode it as 0.The register fields and their values are taken from Mesa's gfx10 register database and radeonsi, which programs them for GL point sprites. They are not measured on a console; the debt entry says so. Still throwing:
PT_SPRITE_TEX_ATTR1(the second half of a 16-bit input);Tested
Windows 11, AMD Radeon RX 7700 XT (driver 32.0.32015.7029), WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh r7), Release, on
main9dd31cc1f5(headd71f2a6b31).New
agc_driver_point_sprite_coordinates: draws a 16-pixel point and checks every pixel of the 64x64 float target. It covers three cases (S, T, 0, 1; T, S, attribute, 0 withPNT_SPRITE_TOP_1; point sprites off), in wave32 and wave64, through both the barycentric and the host-interpolation path: 12 runs, 256 point pixels each, nothing written outside the point.Mutations: the test catches four planted bugs: no
TOP_1flip, S and T swapped,SEL_1giving 0, and keeping theFLAT_SHADE_ENAbit. Keeping the control word without a sprite input is caught byagc_driver_graphics. A nonzero P10/P20 survives: a point's barycentrics are (1, 0, 0), so P10/P20 are never weighted.Updated tests:
agc_driver_graphicsnow checks the decoded control word, thePT_SPRITE_TEX_ATTR1throw, and that nothing is kept withPNT_SPRITE_ENAclear.request_serializerround-trips the field and checks that version 57 decodes it as 0. The version-62 fixtures inRequestSerializerTests.cppandShaderMemory.cppmove to 63.Validation layer:
ctest -R 'point|interpolation|barycentric|provoking|^agc_driver_graphics$|pixel_|serializ|draw_cache' -VwithVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(1.4.368),VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1.mainpasses 77 of 77 and this branch 78 of 78 (80 of 80 withagc_shader_memoryandrequest_serializerafter the rebase). The loader inserts the layer in both, with nowas not foundline and 0VUID-lines.Broad run:
ctest -R '^(agc_|shader|vector_|request_)' -j 4passes 1,665 of 1,678. Eleven failures also fail onmainon this GPU: the f16 and ldexp_f16 checks,vop2_modifier_forms, bothgcn_display_presenttests andsample_order_grid_reference.agc_driver_unregistered_label_on_gpuis the known race;agc_driver_draw_shader_failurefailed once under-j 4and passes 3 of 3 on its own.After merging
main0694c4cbd6(head9d63593330):request_serializer,agc_driver_graphicsandagc_driver_point_sprite_coordinatespass on Windows;agc_shader_memory,agc_shader_memory_coherent_atomic_loadsandrequest_serializerpass on WSL Ubuntu 24.04 (GCC 13.3), because Windows Defender quarantines the freshly linkedagc_shader_memory_tests.exeon this machine. A planted bug reading the point sprite control from version 62 failsrequest_serializer.Conventions:
python tools/check_conventions.py --base origin/mainpasses.Staged copies: a rebuilt
libSceAgcDriver.prxis not copied over the copies staged inbuild/testson Windows (#17895), so I copied it before each run.Not run: Linux, other vendors, and a title with point sprites.
6000988dc4: main's newverifyEmulatedBarycentricRequestsbuilt its version 62 fixture from version 64 bytes, which still held the 4-byte point sprite word, soagc_shader_memoryfailed with "unexpected trailing data" on the Windows CI run. The fixture now drops that word.agc_shader_memory,agc_shader_memory_coherent_atomic_loads,request_serializerandagc_driver_point_sprite_coordinatespass on WSL Ubuntu 24.04 (GCC 13.3); on Windows this PC's antivirus quarantinesagc_shader_memory_tests.exe, so CI's Windows job is the Windows check for it.6b366e65d9: mergedmain959d9cbb99. Main's #14561 took serialization version 63, so its new single-sample dither test and the version-62 fixture now drop the 4-byte point sprite word before relabelling, and version 64 is no longer an invalid version there.request_serializer,agc_driver_point_sprite_coordinatesand the 56agc_driver_graphicstests pass on Windows 11; the 53agc_shader_*tests pass on WSL Ubuntu 24.04. Conventions pass.93533dd908: mergedmain6f6f6c8e6b. Main took serialization version 64 for the split state, so the point sprite word moved to version 65, after it. The tests turn version 65 bytes into 64 by dropping that word (it must be 0) before main's own version 64 -> 63 step, and 66 is now the first invalid version.request_serializer,agc_driver_point_sprite_coordinates, theagc_driver_graphicstests and theagc_shader_*tests (74 in all) pass on Windows 11. Conventions pass.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)Note: main now writes version 64 (split state) and rejects 58-61; this PR writes 65, as does #20010 (mine). #14561, #15343 and #9508 also change the request serialization, and #14561 edits the same
DrawRegisterKeycomparison line. Whichever lands second renumbers its version; I will do that here if this one is second. Merge previews are clean with the other 179 open PRs that touch these files and merge cleanly withmain.Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T16:54:26Z.
Review: COMMENTED
Reviewed — comments
The implementation appears consistent in the inspected paths, but I did not complete review of every changed file or run the checks, so a formal approval is not justified.
What I ran
Reviewed head
9d6359333000a3d9f9d57f30fbfe250b272e8696. No commands or tests were run; reported test results in the PR description are author supplied.Read the description, commit list, manifest, and diff, plus targeted ranges from changed shader and driver files.
Graphics.cppandShaderMemory.cppwere excluded from the review folder and were not read. I also did not read every line of the other changed files.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
Not verified
Graphics.cpp,ShaderMemory.cpp, and uninspected portions of the other changed files. Test results and runtime behavior were not independently verified.To get this to a good state
Nothing is required. Optional: complete review of the excluded and uninspected changed code and run the relevant tests at this head before treating the review as complete.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T13:21:18Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and targeted tests support merging, with console and other-vendor behavior still unverified.
What I ran
Reviewed head
009a36caae8375f62eb8875d7a3a6a604c5c9087usingrepo_read.pythrough the pinned reader. No tests were run in this review; the test results below are author-reported. The base ismain; no merged-preview check was run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of
Graphics.cppandShaderMemory.cppwas excluded from the review bundle; I read their relevant changed ranges through the pinned reader. Two other changed files,PointSpriteCoordinates.cppandShaderInfoCollector.cpp, were read in full only for the relevant changed ranges; remaining lines were not inspected. The other 12 changed files were reviewed in full or at the relevant changed ranges. I did not run tests or verify the reported Windows results. Linux, other GPU vendors, console behavior, and a title using point sprites remain unverified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T15:28:49Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review found no verified defects in the inspected code.
What I ran
Reviewed head
6000988dc4668065e060fa69a56ac64559c5f817usingrepo_read.py. I read the prepared description, commits, manifest, and diff, then inspected the changed shader input collection, SPIR-V emission, point size decode, cache key, serializer, and new point sprite execution test. No checks were run in this session.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Full text was available and read for 15 changed files;
Graphics.cppandShaderMemory.cppwere excluded from the review folder because they were too large, and their relevant changes were inspected indiff.patchonly. I did not inspect their full source context or run tests. I also did not independently verify the author-reported test results, target hardware behavior, or compatibility with concurrent serialization changes mentioned in the description.Files read:
DrawDecode.cpp,DrawLookup.cpp,DrawRegisterKey.cpp,State.hpp,ShaderValidation.cpp,State.cpp,PointSpriteCoordinates.cpp,CacheKey.hpp,RequestSerializer.cpp,StageIO.hpp,ShaderStageInputInfo.hpp,ShaderInfoCollector.cpp,Recompiler.hpp,SpirvEmitterHelpers.cpp,SpirvModuleEmitter.cpp,ShaderInputInfoBuilder.cpp,RequestSerializerTests.cpp, andlibSceAgcDriver.md. Files excluded from full text:Graphics.cpp,ShaderMemory.cpp.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T10:42:35Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
6b366e65d92496265fa920f07d41dc818148a3c1. No commands or tests were run. Read the prepared description, commits, manifest, and diff, plus relevant source ranges viarepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Full text was not available in the review folder for
core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp; targeted changed ranges were read throughrepo_read.py. The full text of the former is 16,153 lines and the latter is 13,860 lines. The newPointSpriteCoordinates.cppand the other changed files marked included in the manifest were read. No tests were run; platform and console behavior were not independently confirmed. Author-reported runs are recorded in the PR description.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T10:29:38Z.
Review: DISMISSED
Reviewed — changes requested
Changes are required before merge: reject point-sprite inputs marked as default before the collector skips them.
What I ran
Reviewed head
6dc1eb823b7b38723923dc1b08dbfe288e26c8fdusingrepo_read.pyto read the prepared diff and targeted code. No tests were run.Results
Findings
Blocking
core/shader/recompiler/Optimization/src/ShaderInfoCollector.cpp:350: the default-input check is unreachable for a default sprite input. The earlier loop skips such inputs at line 336, and the sprite validation loop then skips them becauseread[input]is false.EmitAttributeValuechecksPixelParameterIsDefaultbefore point-sprite handling, so the input silently uses the default value instead of throwing as the description and debt note say unsupported inputs should. Reject default point-sprite inputs before the earlier skip, or otherwise ensure the validation runs for them.Non-blocking
None.
Not verified
Tests were not run. The full changed text for
core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded from the review folder; targeted relevant ranges were read throughrepo_read.py. No other excluded files were listed in the manifest.To get this to a good state
Reject default point-sprite inputs before they are skipped, then rerun the relevant tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T16:07:44Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the available evidence supports merging, with the excluded test file limiting verification of some test updates.
What I ran
Reviewed head
93533dd9082b280ccd34b89df60e7b9022e33bba. No commands or tests were run; the change description reports author-run tests.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere excluded fromfiles/because they were too large. I inspected relevant ranges of both through the repository reader, including the graphics test updates, but did not review their full contents. The remaining changed files listed in the manifest were included and their relevant implementation hunks were inspected. Tests and physical-console behavior were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:29:14Z.
Review: COMMENTED
I compiled the exact serializers for this PR and #20010. Both emit version 65 and can read their own pixel captures. This PR rejected the blend-constant capture as truncated, and #20010 rejected the point-sprite capture at the emulated-barycentrics field. This reader also rejected version 65 captures from #23243 and #22251 as truncated. Please assign the point-sprite payload a distinct version or coordinate one version bump for the combined layout.
The trial merge onto
c1601e56d5was clean. Paired point-sprite execution is pending.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.