feat(agc): draw PS4 LS-HS-VS tessellation through the off-chip ring lowering #22251
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22251"
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 B-Howell on 2026-11-17T10:03:28Z.
What
A PS4 (GCN) title routes tessellation as
VGT_SHADER_STAGES_EN0x45, whichDecodeShaderStagesrefused (unsupported tessellation routing). Per Mesagfx7.json(mesa-25.2.8), 0x45 is LS_EN 1 (LS_STAGE_ON), HS_EN 1, ES_EN 0 (ES_STAGE_OFF), GS_EN 0 and VS_EN 1 (VS_STAGE_DS): the domain shader runs on the VS stage, with no ES, GS or primitive generator. This PR draws that routing through the existing off-chip ring lowering.State.cpp: for GCN guests, accept 0x45 and 0x145 (DYNAMIC_HS). Allow the gfx7VGT_TF_PARAMfieldsNUM_DS_WAVES_PER_SIMDandRDREQ_POLICY. Throw on LS+HS+ES+GS routing,SPI_SHADER_PGM_RSRC2_HS.TG_SIZE_EN, domain stream-out, hull and domain shaders that disagree onOC_LDS_EN, and an LS that loads InstanceID /VGT_INSTANCE_STEP_RATE_0other than 1. RecordOC_LDS_ENclear as the newTessellationConfiguration::onChip; it is carried through the shader key, request serializer (version 65, trailing byte), pipeline journal (format 22) and draw register key.DrawDecode.cpp: read the local, hull and domain programs fromSPI_SHADER_PGM_*_LS(0x148, RSRC2 0x14b, user data 0x14c),_HS(0x108, 0x10b, 0x10c) and_VS(0x048, 0x04b, 0x04c), with user data from SGPR 0.DrawKeyRegistersnow covers the LS RSRC1, RSRC2 and user words. In GCN mode no graphics program gets the 8 hidden user words (the PS4 ABI starts every stage's user data at SGPR 0); plain GCN VS and pixel draws already got 0, so they are unchanged.InstructionTranslator.cpp: GCN wave inputs. LS: v0 VertexID, v1 RelAutoIndex (the LDS slot), v2 InstanceID / step rate 0 and v3 InstanceID. HS: v0 PatchID, v1 the relative patch and control point (InvocationID << 8 | rel), then after the user SGPRs the off-chip offset whenOC_LDS_ENis set and the tessellation factor offset. Domain: v0/v1 the tessellation coordinate, v2 the relative patch, v3 PatchID, then the off-chip offset whenOC_LDS_ENis set. These follow radeonsi's GFX6-8 VS-as-LS layout ("VGPR0-3: (VertexID, RelAutoindex, InstanceID / StepRate0, InstanceID)") and shadPS4143b58aa48translate.cpp(TessellationControl: V0 PrimitiveId, V1 packed hull invocation info, then the factor-buffer SGPR;TessellationEval: V0/V1 the evaluation point, V3 PrimitiveId).Recompiler.cpp: a GCN local shader is a whole program ending ins_endpgm, not a PS5 front program ending ins_setpc_b64.ShaderRegistry.cppandDrawRelocate.cpplink and relocate itss_swappcfetch shader like a GCN vertex shader.TessellationLowering.cpp: withOC_LDS_ENclear, the hull keeps its outputs in LDS and the domain shader reads them there. The LDS offsets come from a tessellation constant buffer the title binds, read at run time, so they cannot be lowered to attributes yet. A hull LDS write and a domain LDS read are refused by name and recorded as debt. An on-chip hull that writes only factors is drawn.Tested
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2, RTX 4080 SUPER, driver 621.14.
tests/execution/GcnTessellation.cpp(ctestagc_driver_gcn_tessellation), with hand-assembled gfx7 LS, HS and domain shaders:onChipare refused by name.tests/Graphics.cpp: GCNDecodeShaderStagescases (0x45 on chip, 0x145 off chip, refused routings,VGT_TF_PARAMbits,OC_LDS_ENmismatch, stream-out,TG_SIZE_EN, step rate) andDrawKeyCoversfor every register read.RequestSerializerTests.cpp:onChipround trip, and version 62 reads as off chip.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_ADD_LAYER_PATHset to the 1.4.363.1 SDK,VK_LOADER_DEBUG=layer, ctest-Vonrequest_serializer,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometry,agc_tessellation_lowering,agc_tessellation_pipeline_cache,agc_driver_prepared_graphics,agc_driver_prepared_unregistered_graphics,agc_driver_pipeline_journal,agc_pipeline_journal,agc_driver_register_keyandagc_graphics_profile_draw:mainwith a copy of the new test that uses no new fields: onlyagc_driver_gcn_tessellationfails, 3/3 runs (front program reached s_endpgm before s_setpc_b64).Insert instance layer "VK_LAYER_KHRONOS_validation"lines, nowas not found but was requested by env var VK_INSTANCE_LAYERS, and noVUID-in either arm.agc_driver_gcn_tessellationpassed again (7/7, 0VUID-).0x2d56e0100is refused at pc 0xdc,the tessellation ring or LDS address is not affine in the control point and relative patch: its factor offset is built withv_add_i32(carry out). After that the title's hull writes patch constants to LDS on chip and its domain shader reads passthrough control points from LDS, which this PR refuses. Those are follow-ups.check_conventionspasses anddebt_fold.py --checkpasses.pr_overlapfailed closed (GitHub connection errors during the scan) and listed file-level overlaps only. I checked each listed open PR by title: none touches GCN tessellation routing.33f8d6a5a87, test only):agc_shader_memorystill expected serialization version 62 (new requests did not use serialization version 62). It now expects 63, rejects 64, and strips the on-chip byte from the tessellated merged-hull fixture. Linux (GCC 11.4): all 35 ctests that runagc_shader_memory_testsplusrequest_serializerpass. Windows: Defender quarantines the localagc_shader_memory_tests.exe, so it ran on Linux only;request_serializer,agc_driver_gcn_tessellationandagc_driver_graphicspass with validation on (1 layer insert, 0VUID-),main2/2 (no GCN test there), 0VUID-.check_conventionspasses.33f8d6a5(merged onto mainf0c01bc69d): Arch Linux, GCC 16.2.1, RTX 4090 (Ada), driver 620.70.06, Khronos layer 1.4.363.1,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. Tessellation, pipeline journal, shader memory,request_serializerand graphics tests: 18 of 19 pass;agc_driver_gcn_tessellationpasses.agc_driver_graphicsfailed once in the CPU-onlyCoveredMipBytescase oftests/TextureTiling.cpp(not changed here) and passed both reruns. Nowas not found, 0VUID-on both main and this PR.a5e2d3ee26merged onto main3c07e1d05e: Windows 11 25H2, WinLibs GCC 15.2.0, AMD Radeon 760M iGPU, AMD Software 26.11.2, Khronos layer 1.4.363.agc_driver_gcn_tessellation(new, not on main) passes 3 of 3 runs, the layer loads in every run, and no log has aVUID-line. No negative control: the test does not build on main.a5e2d3ee26merged onto main26604382a5: Linux 7.3.4, GCC 16.2.1, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036), Khronos layer 1.4.363.1. Full suite and-R '^agc'with the layer: no new failures against main on either GPU, the layer loads in every run, and there are 0VUID-and 0SYNC-HAZARDlines.b2129045df6: merged mainc8f72e905cc. Main's #21938 had taken request serialization version 63 for its trailing emulated-barycentrics flag, so the on-chip flag moves to version 64 and is written before that flag; the serializer,RequestSerializerTests.cppandShaderMemory.cppwere updated to match (version 63 requests from main still read the same way). Main's #21747 now skips a pixel program unless a color target has a format, sob2129045df6gives the program-decode fixture aCB_COLOR0_INFOformat, as #21747 did for main's own fixtures. Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER, driver 621.14, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_geometry,agc_driver_tessellation_depth_range_remap, both journal tests,agc_driver_register_key,agc_graphics_profile_drawandagc_driver_prepared_graphicspass 10/10 in 3 of 3 runs;mainpasses its 9 of them. Every log loads the layer, none haswas not found but was requested by env var VK_INSTANCE_LAYERS, and neither side has aVUID-line. WSL Ubuntu, GCC 11.4: the 35 ctests that runagc_shader_memory_testsandrequest_serializerpass 36/36.debt_fold.py --checkandcheck_conventionspass; the debt files match main.963751c48c2: merged main56d4f9fe7e0. The only conflict wasRequestSerializerTests.cpp: main's single-sample dithered alpha-to-coverage test (a98f6fe1822) assumed version 63 was current, so it now expects 64 and treats 65 as the unsupported version; both test functions run. Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometryandagc_driver_graphics6/6;main56d4f9fe7e04/4 on the same set without the GCN and graphics tests. Both logs load the layer, neither haswas not found, 0VUID-in each.check_conventionsanddebt_fold.py --checkpass.38769b3646a: ordinary merge of main1d1587ced3b, no conflicts. Redwindowson the previous head came from tests this branch does not touch:guest_appcontent_download_0and aguest_libressl_tls_engine_transporttimeout (the next two branches in the stack instead hit main'sguest_freetype_ot_glyph_mutationandaudio_out2_port_layoutsbreaks, since reverted in #25141 and #25143), so this merge starts a fresh run on current main. Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometryandagc_driver_graphics6/6;main786bc3afa1c4/4 on the tessellation and serializer tests. Both logs load the layer, neither haswas not found, 0VUID-in each.check_conventionspasses.38769b3646merged onto main61f7f5925c: Windows 11 Pro 10.0.26100, WinLibs GCC 15.2.0 r7, NVIDIA GeForce RTX 3070 (Ampere), driver 616.56, Khronos layer 1.4.363,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, the validation-line tests, 3 runs each: main 20 of 20, this PR 21 of 21 (the extra one isagc_driver_gcn_tessellation, which drew rather than skipped). The layer loads in every run and neither side has aVUID-line.agc_shader_memory_testswas not run (Defender quarantines it there), so the version 64 on-chip flag in theagc_shader_memoryfixture is not covered by this run.e62a8c279af: merged main twice (ab34471c84dwith61426d5bf1d, thenea49f32e898). Main's split state took request serialization version 64, so the on-chip flag is now version 65, written after it; the serializer tests and theagc_shader_memoryfixture helpers moved with it. For MarcZX10's review,a1503285b91addsVerifyTessellationOnChipWithBarycentrics: a version 64 tessellated request ending in the emulated barycentrics flag reads with barycentrics set and on chip clear. Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometry,agc_driver_graphics,agc_tessellation_loweringandagc_tessellation_factor_ring8/8 onab34471c84dand again one62a8c279af;main61426d5bf1d7/7 on the same set without the GCN test. Every log loads the layer, none haswas not found, 0VUID-on either side.check_conventionsanddebt_fold.py --checkpass.agc_shader_memory(version fixture updates) was not run locally: Defender quarantines it on Windows; CI covers it.66a4b647e79:42e81a08835refuses a merged hull that keeps its outputs on chip (newTessellationLowering.cppcase);8c5d5183d27maps user data registers through each program's hidden word count (UserDataWords), with LS/HS/domain word checks inGcnTessellation.cpp;66a4b647e79uses the stored hidden word count at the four vertex-stage decode sites and keys LS user words 0x14c-0x16b (RegisterKey.cppchanges each word). Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_register_key,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometry,agc_driver_graphics,agc_tessellation_lowering,agc_tessellation_factor_ring9/9. Every log loads the layer, nowas not found, 0VUID-.check_conventionsanddebt_fold.py --checkpass.52d24faa56b: ordinary merge of main9a1d772cf16, no conflicts. Main now has #27860, which fixes the macOSframe_capture_minimize_replayfailure on the previous run, so this push starts a fresh run. Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_register_key,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometry,agc_driver_graphics,agc_tessellation_lowering,agc_tessellation_factor_ring9/9;main9a1d772cf168/8 on the same set without the GCN test. Every log that creates a device loads the layer, nowas not found, 0VUID-on either side.check_conventionsanddebt_fold.py --checkpass.066594b729b: CodeRabbit (#22328 review, 17:35Z): a local shader that loads v3 now also needsVGT_INSTANCE_STEP_RATE_11.agc_driver_graphicscovers it; with the old check it fails (expected graphics rejection: GCN local shader instance step rates other than 1). Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_register_key,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometry,agc_driver_graphics,agc_tessellation_lowering,agc_tessellation_factor_ring9/9 on #25489's merge of this head (6ab0c65dc21), 7 layer inserts, nowas not found, 0VUID-;main9a1d772cf168/8 on the same set earlier today.check_conventionsanddebt_fold.py --checkpass.a373e8b6f88: merged maind9a511f9323(no conflicts). Main's #28218 took pipeline journal format 20 for its early-Z byte, the number this PR used for the on-chip byte, so a journal written by main would have been read in this PR's layout. The journal now carries both bytes as format 22; 21 was written only by earlier heads of #22439 and is refused, and 23 is #22439's. Request serialization is unchanged (main ends at 64, this PR writes 65). New check intests/execution/PipelineJournal.cpp: the journal is written as 22, and the same file stamped 19, 20, 21 or 23 is not replayed while 22 is; withFileFormatset back to 20 it fails (the journal is written as format 20, expected 22). Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 SUPER,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(LunarG 1.4.363.1):request_serializer,agc_driver_pipeline_journal(with the new check),agc_driver_pipeline_journal_undecodable_module, the sixagc_pipeline_journal*tests,agc_driver_gcn_tessellation,agc_driver_tessellation,agc_driver_tessellation_depth_range_remap,agc_driver_tessellation_geometry,agc_tessellation_lowering,agc_tessellation_factor_ring,agc_driver_register_keyandagc_driver_graphics17/17, 35 layer inserts, nowas not found, 0VUID-;maind9a511f932316/16 on the same set without the GCN test, 28 layer inserts, 0VUID-. Linux layout guards:PipelineJournal.cppcompiles under WSL Ubuntu GCC 11.4 (-fsyntax-onlywith the build's flags), soStateis still 1008 there; with the guard changed to 1007 it fails.check_conventionsanddebt_fold.py --checkpass.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)Summary by CodeRabbit
New Features
Bug Fixes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T13:29:01Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
33f8d6a5a87988ad0ba63e376225f5cbbf6be328, basemain.Results
Findings
Blocking
None verified.
Non-blocking
None verified.
Not verified
gfx7.jsonand shadPS4 (RSRC2bits 7, 8 and 12, theVGT_TF_PARAMmasks,VGT_INSTANCE_STEP_RATE_0at 0x2a8,RSRC1VGPR_COMP_CNTat bits 24 to 25). These sources are not in the repository.sizeof(TessellationConfiguration)is still 40 after theonChipbool was added (thestatic_assertatcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:53). I did not compute the layout.core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere read through their diff hunks only; their full text is too large for the review folder.To get this to a good state
Nothing is required.
Optional: the build will confirm the
static_assertatcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:53, and the author's test runs should be rerun on the final head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T17:27:04Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional, and I am not giving a formal approval because the hardware mapping and the test results were not checked here.
What I ran
a5e2d3ee26a9f74660b6a2ed21fd4366866d7487, basemain.diff.patch(828 lines, 21 changed files).No build and no ctest run.
Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cpp:125: the hidden user words are now 0 for every GCN program, not only for the new tessellation routing. That condition also covers GCN vertex and fragment-side draws, which the description does not mention. Either state the intent in the description or limit the condition to the new path.core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp:397: the comment above the register table (lines 394–396) still describes only the local program address. The range now also covers the LS RSRC1, RSRC2 and user words. Update the comment.Not verified
VGT_INSTANCE_STEP_RATE_0offset0x2a8. These come from the description's citations; I did not check them against the Mesa or shadPS4 sources.tests/Graphics.cppandtests/ShaderMemory.cpp: only their diff hunks were read. The manifest marks both as too large for the review folder, so their full text was not read.files.jsonand thefiles/folder were not read.tessellationbinding in theTessellationLowering.cpphunk (line 1018), and theinputInfo.vertexpresence on the hull and domain paths inInstructionTranslator.cpp: checked only in part.To get this to a good state
Nothing is required.
Optional: the two non-blocking points above, and a confirmation from the author that the hidden-word change is intended for all GCN programs.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T18:52:39Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code and reported checks support merging.
What I ran
Reviewed head
b2129045df62c40b0a4a11ce77d74cfdc42e9b30usingrepo_read.pyto inspect the prepared description, commit list, diff, manifest, and changed source ranges. No tests were run in this review; test results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The complete contents of
Graphics.cppandShaderMemory.cppwere excluded by the review bundle size limit; only the changed ranges were read. The addedGcnTessellation.cpptest was reviewed as included. No independent test execution or physical console run was performed. Other unchanged repository code was not read.Files read:
description.md,commits.md,manifest.json,diff.patch; changed filesDrawDecode.cpp,DrawLookup.cpp,DrawRegisterKey.cpp,DrawRelocate.cpp,ShaderRegistry.cpp,State.hpp,PipelineJournal.cpp,State.cpp,Graphics.cpp(changed range),ShaderMemory.cpp(changed range),GcnTessellation.cpp,CacheKey.hpp,RequestSerializer.cpp,ShaderStageInputInfo.hpp,TessellationLowering.cpp,Recompiler.cpp,Recompiler.hpp,InstructionTranslator.cpp,ShaderInputInfoBuilder.cpp,RequestSerializerTests.cpp, and the technical debt note.files.jsonwas not available in the review folder; the reader’s file listing identified the two changed files excluded by size.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T04:40:33Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the code inspected; the PR’s test results are author reported and were not run in this review environment.
What I ran
Reviewed head
38769b3646af01b74b96d02f045db9619275bfb4using the prepared diff andrepo_read.pyreader. No executable test commands were available in this review.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
None.
Not verified
Tests were not run. The changed files
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp,core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp, and repository files outside the targeted call paths were not read. The PR description’s test results and physical console behavior were not independently verified. Other changed files read:DrawDecode.cpp,State.cpp,InstructionTranslator.cpp,TessellationLowering.cpp,RequestSerializer.cpp,State.hpp,ShaderRegistry.cpp,Recompiler.cpp, andDeserialize.cpp. Other files listed as reviewed inmanifest.jsonwere not read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-23T11:36:35Z.
Review: APPROVED
Windows check of head
38769b3646with GCC 16 on an NVIDIA and an AMD GPU, merged ontomainf5b7e1d1ac(clean merge). The AMD runs in the thread are of older heads, so this covers the current head on both vendors.Setup: Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (
x86_64-ucrt-posix-seh, r3), Release full build, run from PowerShell withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. GPUs, each picked withANYPS5_GPU: NVIDIA GeForce RTX 5070 Ti (621.01) and the Ryzen 7 7700X's integrated AMD Radeon (1002:164e, Adrenalin 26.10.2). The GPU set was built together with #25557, #26098 and #24781, which touch other files.^(.*tessellation.*|.*pipeline_journal.*|request_serializer|request_serializer_.*)$):main13 of 13, and with this PR 14 of 14 in 2 of 2 runs, on both GPUs. The new one isagc_driver_gcn_tessellation. The only skip isagc_driver_tessellation_geometryon the Radeon, on both sides. NoVUID-lines.agc_driver_graphics, which holds the new routing decode checks: passes onmainplus this PR alone (d1bbfca065).TessellationLowering.cpp,agc_driver_gcn_tessellationfails on the Radeon withthe refusal named another reason: ... unsupported LDS access in a tessellation stage at pc 0x34, so it pins the specific message.tess.onChip = falseinDecodeShaderStages,agc_driver_graphicsfails withthe GCN LS, HS and VS-stage domain routing 0x45 with OC_LDS_EN clear did not decode as on-chip GCN tessellation.agc_driver_gcn_tessellationbuilds its configuration directly, so the decode is guarded only there.The request serializer's version 64 is also taken by #25010, #24906 and #23818, so whichever of these lands later needs the next number.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T19:29:07Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: fix version-64 request decoding so its emulated-barycentrics trailer is not consumed as the new tessellation on-chip flag.
What I ran
Reviewed head
ab34471c84d0c8de9906f98573f384b9d4a0538cusing the prepared diff andrepo_read.pyto inspect changed code and related serialization paths. No commands or tests were run; test results in the PR description are author-reported.Results
Findings
Blocking
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp:637appends the newonChipflag after the serialized request body, whilecore/shader/recompiler/ControlFlow/src/RequestSerializer.cpp:654reads it for every version-65 tessellated request before processing the optional barycentrics trailer. A version-64 tessellated request with emulated barycentrics already ends with atruebyte. When decoded as version 65, that byte is consumed asonChip; the barycentrics trailer is then absent, so the request silently replays with the wrong tessellation mode. Store the flag in the tessellation configuration encoding or otherwise distinguish the trailers, and add a version-64 compatibility test for a tessellated request with emulated barycentrics.Non-blocking
None.
Not verified
DrawDecode.cpp,State.cpp,InstructionTranslator.cpp,RequestSerializer.cpp,TessellationLowering.cpp,CacheKey.hpp, andShaderInputInfoBuilder.cpp, plus relevant test references inRequestSerializerTests.cpp.To get this to a good state
Fix the versioned serialization layout and add the combined compatibility test, then rerun the request serializer tests.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T20:31:44Z.
Review: COMMENTED
cdbd52e6-d8ea-4692-9651-db4ea83a72dbReviewing files that changed from the base of the PR and between
ab34471c84ande62a8c279a.core/shader/recompiler/CacheKey.hppcore/shader/recompiler/Optimization/src/TessellationLowering.cppcore/shader/recompiler/tests/RequestSerializerTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T20:39:45Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: include the GCN LS user data registers in the draw register key so their values cannot reuse a stale decoded draw.
What I ran
Reviewed head
e62a8c279af62a1cb14c747d2e96162a9e18e667using the prepared diff and the pinnedrepo_read.pyreader. No commands or tests were run; the reported test results below are author-supplied.Results
Findings
Blocking
0x14c, but the draw register key only hashes user words from0x00c,0x04c,0x08c, and0x10c. The LS words are also absent from the runtime-register exclusions, so they are folded into the shape fingerprint only if present inDrawKeyRegisters; however,runtimeRegistermarks the0x148..0x15brange as runtime and thus excludes them. Consequently, changing an LS user-data value can leave the draw key unchanged and reuse a decoded draw with stale LS inputs. Add the LS user-data base and count to the keyed-user-word enumeration. Changed lines:core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cpp:160andcore/libs/prx/libSceAgcDriver/Graphics/include/State.hpp:106.Non-blocking
None.
Sources
0x14c:core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cpp:160.0x148through0x15b:core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp:106.runtimeRegisterexcludes0x14c-range words from the ordinary fingerprint, whileforEachKeyedUserWorddoes not enumerate the LS base:core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cpp:14andcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cpp:41.Not verified
No tests or builds were run. The author reports Windows validation and serializer tests passing, and reports that
agc_shader_memorywas covered by CI.core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere excluded from the prepared review folder due to size; targeted lines were read through the pinned reader. Every other changed file listed in the manifest was included and reviewed.To get this to a good state
Include the LS user-data words beginning at
0x14cin the draw register key, respecting the count from LS RSRC2. Re-run the draw register-key tests and the GCN tessellation draw test on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T21:46:49Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: fix version-65 deserialization so tessellation requests with emulated barycentrics round-trip correctly.
What I ran
Reviewed head
8c5d5183d273604c3c35ce56a4e508b3ff501ce0using the prepared diff andrepo_read.py. No build or tests were run.Results
Findings
Blocking
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp:984: Serialization appends the tessellationonChipbyte before the optional emulated-barycentrics byte, but deserialization treats the first remaining byte as the barycentrics flag at line 1076 after consumingonChipat line 1074. For a version-65 tessellation request withemulateBarycentrics=true, the remaining barycentrics byte is therefore consumed asonChip; deserialization then has no barycentrics byte to read. This loses the barycentrics setting, and whenonChip=trueit also fails theonChipbyte check. Keep the read order consistent with the write order and cover both flags together.Non-blocking
None.
Sources
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp:984andcore/shader/recompiler/ControlFlow/src/RequestSerializer.cpp:1074.core/shader/recompiler/tests/RequestSerializerTests.cpp:247, but their assertions conflict with the serializer's actual ordering described above.Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere excluded from the review folder because they were too large. Their relevant hunks were inspected inreview/diff.patch; the complete files were not read.To get this to a good state
Fix the version-65 read order and rerun the serializer tests, including tessellation requests with emulated barycentrics enabled for both
onChipvalues.Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T21:47:11Z.
Review: COMMENTED
Actionable comments posted: 1
1fb7a1eb-7a94-47db-9333-47f3cad9a39aReviewing files that changed from the base of the PR and between
e62a8c279aand8c5d5183d2.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppcore/libs/prx/libSceAgcDriver/tests/RegisterKey.cppcore/libs/prx/libSceAgcDriver/tests/TessellationLowering.cppcore/libs/prx/libSceAgcDriver/tests/execution/GcnTessellation.cppcore/shader/recompiler/Optimization/src/TessellationLowering.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T23:07:33Z.
Review: COMMENTED
ff6b9dee-ddf2-4701-b49e-bb55c9e58395Reviewing files that changed from the base of the PR and between
8c5d5183d2and66a4b647e7.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/tests/RegisterKey.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T06:31:04Z.
Review: COMMENTED
Reviewed — no blocking findings
This review checked the prepared diff and selected source paths at head
66a4b647e7988a2571648717df32b32c7b22d700; no checks were run, and the review is incomplete.What I ran
No commands or tests were run. I read the prepared description, commits, manifest and diff, then inspected selected source ranges through
repo_read.py.Results
Negative control
Not run during this review.
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Sources
Reviewed diff and selected head source ranges for stage decoding, draw program decoding, tessellation lowering, instruction translation, request serialization, cache keys and draw register keys.
Not verified
The review was not complete: I did not read every file listed as
reviewedin the manifest, and did not inspect the full changed files. In particular,Graphics.cppandShaderMemory.cppwere excluded from the prepared file bundle because they were too large; they were not inspected through the reader. Tests, builds, and author or CI logs were not independently verified.To get this to a good state
Nothing is required. Optional: complete review of the changed files and run the relevant checks before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T17:12:18Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional. I inspected the prepared diff for head
52d24faa56bcabda72147a55538e2c0ec430b7b9; the targeted source contexts I read support the described GCN tessellation routing and explicit refusal of unsupported on-chip LDS accesses.What I ran
description.md,commits.md,manifest.json,files.json, anddiff.patch; no files were excluded by rule.python3 repo_read.py catfor targeted contexts inState.cpp,DrawDecode.cpp,InstructionTranslator.cpp, andTessellationLowering.cpp. No tests or builds were run.Results
Findings
Blocking
None found in the code inspected.
Non-blocking
None.
Not verified
The full text of the 24 changed files listed under
reviewedinfiles.jsonwas not read; inspection covered the prepared diff and targeted source contexts only. No excluded files were listed. Tests, negative controls, hardware behavior, and author-reported validation results were not independently verified.To get this to a good state
Nothing is required. Optional: complete a full source audit and run the relevant checks before relying on this review as a merge approval.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T17:20:27Z.
Review: COMMENTED
Architecture findings (1)
Advisory architecture findings (1)
16aec4a7-13c5-4678-acf8-51eaaaa5844eReviewing files that changed from the base of the PR and between
66a4b647e7and52d24faa56.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.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/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Optimization/src/TessellationLowering.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T18:43:46Z.
Review: APPROVED
Reviewed — looks good
The changed routing, decoding, shader inputs, cache keys, and serialization were reviewed at head
066594b729bb0d911001696d4ae2958a5306f258; no blocking defect was found.What I ran
Reviewed the prepared diff against base
mainand inspected changed code and relevant context using the pinnedrepo_read.pyreader. No merged preview, build, or test was run by me.Results
Negative control
Not run by me. The description reports a main-branch control for an earlier test revision; it does not report a control for this exact head.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No tests were run by me, and physical PS4 console behavior was not verified. The prepared bundle omitted full text for
core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppdue to size; I inspected their changed ranges through the pinned reader.files.jsonlists no rule-excluded files. Unchanged portions of large files were not read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T12:38:11Z.
Review: APPROVED
I read the diff at
066594b729. Windows 11, GCC 15.2, merged intomainatdaa61711afetogether with other open PRs (so not an isolated build), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validationon an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).agc_driver_gcn_tessellation,agc_tessellation_loweringandagc_shader_memory: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.agc_shader_memoryran with one other PR of the tree taken out, because that one fails it.Not checked: a PS4 title that tessellates.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:13:29Z.
Review: COMMENTED
I compiled the exact serializer for this PR. It reads its own version 65 capture and rejects a version 65 mesh capture from #23818 as truncated. #23243 also writes version 65 with a different window-select payload. Please reconcile request format versions before these branches land so saved captures identify one layout.
The trial merge onto
a1b75b0947was clean. I checked that the GCN path retains off-chip routing in the source. Paired Vulkan controls are pending.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T03:40:45Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes at
a373e8b6f8859bcea737a45ff88273650a9ad07econsistently carry the GCN on-chip tessellation state through decoding, shader translation, cache keys, serialization, and pipeline journaling; I found no blocking defects.What I ran
Read the prepared description, commit list, manifest, diff, and targeted source ranges at the pinned head. Commands included
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp 1430 1520, targetedrepo_read.py catcalls for the serializer, tessellation lowering, translator, and the changed ranges inGraphics.cppandShaderMemory.cpp, plussed/rgon the prepared diff and included files. No tests or builds were run.Results
Negative control
Not run; I did not run or modify a test.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No tests, builds, or physical-console behavior were independently verified. Changed hunks in all 25 reviewed files were inspected; the full text of
core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas not bundled, so their changed ranges were read throughrepo_read.py. No changed files were excluded from review.To get this to a good state
Nothing is required.
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.