feat(agc): draw point and line polygon modes #7869
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7869"
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 savvaniss on 2026-10-19T11:52:02Z.
What
The AGC driver drew every triangle filled and threw on any
PA_SU_SC_MODE_CNTLwithPOLY_MODEset to a point or line type ("polygon mode, depth bias or nonstandard rasterization is unsupported"). This PR draws those triangles with Vulkan's point and line polygon modes.State.cpp):POLY_MODE = 1takesPOLYMODE_FRONT_PTYPE/POLYMODE_BACK_PTYPE(0 points, 1 lines, 2 filled) from the faces that are not culled, into a newState::polygonMode.POLY_MODE = 0both types are ignored, as the hardware ignores them, and point and line primitives ignore them too.Pipeline.cpp):polygonModegoes into the rasterization state, the pre-rasterization library key and the whole-pipeline key. It is also added to the draw keys and the pipeline journal (format 5).VulkanDevice.cpp):fillModeNonSolidis enabled when the GPU has it.VK_KHR_maintenance5is enabled with the pipeline-library extensions, so an unwrittenPointSizeis 1.0.PA_SU_POINT_SIZE = 0x00080008withinPA_SU_POINT_MINMAX), or with a per-vertex size;PA_SU_LINE_CNTL);POLY_MODEor polygon type.#7275 adds the same
fillModeNonSoliddevice flag, under the same name, for its forced wireframe. Whichever of the two merges second keeps one copy.The first triangle strip Hasbro Family Fun Pack (CUSA03312) draws, through the PS4 path of #6977, sets
PA_SU_SC_MODE_CNTL = 0x8: points for both faces.Tested
Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release. RX 9070 XT (driver 32.0.31041.1004) and UHD 770 (driver 32.0.101.7088).
agc_driver_graphics, decode:POLY_MODE;agc_driver_polygon_mode_draw, on each GPU: a triangle with corners on pixel centres in a 64×16 target.ctest --parallel 4, full suiteVkCacheemptied firsta8dd777a0;9f446e404only shortens the debt entry)agc_driver_image_table_vouched_lookupsandagc_driver_sample_multisample_targetfail, as onmain(#6957)device-faultlinesThe AMD run leaves out the three
APS5_NO_GPLtests. Until #7828 merges, they fault the GPU onmainin a parallel AMD run (#7809).agc_driver_graphics,agc_driver_polygon_mode_draw,agc_driver_conservative_rasterizationandagc_driver_inactive_vertex_point_sizealso pass 3 times in a row on each GPU.Validation: Khronos validation layer 1.4.363 (Vulkan SDK),
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,ctest -R <tests> -V, onmaincded26c68and on this PR merged into it, on both GPUs (AMD driver cache emptied first). Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS. Tests:agc_driver_graphics,agc_driver_conservative_rasterization,agc_driver_inactive_vertex_point_sizeand this PR'sagc_driver_polygon_mode_draw. No validation message at all, onmainor with this PR, on either GPU.Risk (CUSA03312), 20 Oct: its first frame still needs this change. With it in the stack of #7198 (on an RX 9070 XT), Risk goes on to play a local match against the AI.
21 Oct: rebased onto
mainb77bd5880, and the pipeline journalFileFormatset to 6, the next number aftermain's 5. WithANYPS5_GPU=AMD,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1and the validation layer on the RX 9070 XT, these all pass with noVUID-line:agc_driver_graphics,agc_driver_polygon_mode_draw,agc_pipeline_journal,agc_pipeline_journal_long_pathsandagc_pipeline_journal_extended_paths.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T12:00:33Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppL480docs/dev/debt/libSceAgcDriver.mdL19core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppL480core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppL45-47core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppL45-47Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-19T12:29:02Z.
Review: COMMENTED
Verified the diff, conventions, and test coverage in PR #7869:
State.cppcorrectly decodes non-culled face modes whenPOLY_MODE = 1, maps front/back point and line primitives toVK_POLYGON_MODE_POINT/VK_POLYGON_MODE_LINE, and propagatespolygonModethrough pre-rasterization library keys, full-pipeline keys, draw keys, and pipeline journal format 5.fillModeNonSolidinVulkanDevice.cppwhen supported and leveragesVK_KHR_maintenance5to default unwrittenPointSizeto 1.0.docs/dev/debt/libSceAgcDriver.md(differing front/back modes with two-sided rasterization, variable line/point widths, depth bias with non-solid modes).tests/Graphics.cppand execution coverage intests/execution/PolygonModeDraw.cpp.tools/check_conventions.pypasses with 0 findings.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-19T12:33:02Z.
Windows and AMD's own driver. AMD Radeon 860M (RDNA 3.5,
1002:1114), driver 32.0.13058.8001, Windows 11, WinLibs GCC 15.2.0, Release,ANYPS5_NO_SHADER_CACHE=1. Head merged intomainb106f6f8c(clean merge).main'sState.cpp,Pipeline.cppandVulkanDevice.cppagc_driver_polygon_mode_drawpoint polygon mode: pixel (5, 2) is written, expected keptagc_driver_graphicspolygon mode, depth bias or nonstandard rasterization is unsupported (register 0x205 = 0x00000008)The control keeps this PR's headers, since the tests read
State::polygonModeand don't build againstmain's.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T12:33:05Z.
Title data: CUSA03312, through #6977's PS4 path, draws the triangle strip of its first frame with
PA_SU_SC_MODE_CNTL = 0x8, points for both faces. With this PR that draw goes through on an Intel UHD 770, and the title continues to its intro video and the loading of its start menu (#7198).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T21:34:51Z.
@savvaniss one small change before CI: main's
PipelineJournalFileFormatis already 5 (6bfb4c5a63), so this PR's 4 -> 5 bump now merges cleanly without advancing it, while the journal record still changes with the new polygon-mode fields. Could you set it to the next free number (6 on current main)? A few open PRs touch this constant, so the one that merges later takes the next number again at that point.Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T07:15:39Z.
@oneandonlydean done. The journal
FileFormatis now 6. Setting it to 6 made the branch conflict withmain: the branch's own 4 → 5 bump metmain's. So I rebased ontomainb77bd5880; the head is863167d33, and the diff againstmainis 5 → 6 plus the polygon-mode fields.On the RX 9070 XT, with the validation layer, all of these pass with no
VUID-line:agc_driver_graphicsagc_driver_polygon_mode_drawagc_pipeline_journal,_long_pathsand_extended_pathsAI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T07:24:46Z.
@savvaniss thanks,
FileFormat6 on863167d33is one abovemain's 5. Several other open pull requests also write 6, so if one of them lands first, this one will need the next value before merge. We'll check that at merge time.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T10:48:50Z.
Re-checked the new head: the only change is the journal
FileFormatbump to 6 (main is at 5), as @oneandonlydean asked; the rest matches what was reviewed before. Merged.