Repository navigation
Conversation
…owering A GCN title routes tessellation as VGT_SHADER_STAGES_EN 0x45 (LS_EN 1, HS_EN 1, VS_EN 1 = VS_STAGE_DS, no ES or GS), which DecodeShaderStages refused. Decode it for GCN guests, read the local, hull and domain programs from the LS, HS and VS registers with their own user data, and give each stage the GCN wave inputs: LS v0 VertexID, v1 RelAutoIndex, v2 and v3 InstanceID; HS v0 PatchID, v1 the packed relative patch and control point, then the off-chip SGPR when OC_LDS_EN is set and the factor SGPR; domain v0 and v1 the tessellation coordinate, v2 the relative patch, v3 PatchID and the off-chip SGPR when OC_LDS_EN is set. The GCN local shader is a whole program ending in s_endpgm and links its fetch shader like a GCN vertex shader. The new TessellationConfiguration.onChip records OC_LDS_EN clear. Hull outputs kept in LDS (on chip) are refused by name and recorded as debt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ip byte Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ring With SPI_SHADER_PGM_RSRC2_HS.OC_LDS_EN clear a GCN hull shader keeps its output control points and patch constants in LDS, and the domain shader reads them there. The offsets come from the tessellation constant buffer, a V# in four user data words laid out as shadPS4's TessellationDataConstantBuffer, so the lowering refused them. The lowering now finds the constant buffer that on-chip LDS addresses read and throws TessellationConstantsRequired naming its user data words when the request carries no values. The driver then reads its nine dwords from guest memory, remembers the words for that program, and prepares the stage again with GraphicsCompileContext.tessellationConstants, which is part of the shader key and the serialized request (version 64). The lowering replaces the buffer's reads with those values, so the addresses become affine. Hull writes and domain reads at or above hs_output_base become off-chip ring accesses rebased by it, and the existing ring lowering places control points and patch constants. A hull with hs_output_base 0 is pass-through: each invocation copies its input control point to its output control point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests The on-chip tessellation byte moved new requests to version 63, but agc_shader_memory still expected 62, kept 63 in its unsupported list and stripped six trailing bytes from a tessellated merged-hull request when making its version 56 fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests The tessellation constants flag moves new requests to version 64, which writes two trailing bytes for a tessellated request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry stage A GCN title routes geometry shaders as VGT_SHADER_STAGES_EN 0xb0 (ES_EN 2 = ES_STAGE_REAL, GS_EN 1, VS_EN 2 = VS_STAGE_COPY_SHADER), which DecodeShaderStages refused. Decode it for GCN guests with VGT_GS_MODE GS_SCENARIO_G off chip and read the export, geometry and copy programs from the ES, GS and VS registers. The ES is compiled as a Vulkan vertex shader whose ESGS ring stores (soffset the ES2GS offset SGPR) become its output record. The GS is compiled as a Vulkan geometry shader: its input VGPRs carry the ES vertex offsets, ESGS ring reads become reads of the input record of that vertex, GSVS ring stores (soffset the GS2VS offset SGPR) go to a per-invocation array of VGT_GS_VERT_ITEMSIZE times VGT_GS_MAX_VERT_OUT dwords, and s_sendmsg GS emit and cut become EmitVertex and EndPrimitive. The copy VS is not compiled: its exports, each component a GSVS ring dword or a constant, define the outputs every emit copies out of that array for the emitted vertex. Request serialization goes to version 63 and the pipeline journal to format 20 for the geometry configuration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Request serialization moves to version 65 and the pipeline journal to format 21, after boykopovar#22251 (63, journal 20) and boykopovar#22328 (64). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…am offsets A copy VS can build a GSVS ring scalar offset with s_addk_i32, s_lshl_b32, s_bfm_b32 or s_mul_i32 rather than one s_movk_i32, as shadPS4 143b58aa48 ParseCopyShader handles. Fold those when their sources are known constants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y GSVS stores apart The copy VS parser read every program as straight-line code. A branch, s_setpc, s_swappc, s_call or a write to EXEC now throws instead of being skipped. A GSVS store at a constant address past VGT_GS_VERT_ITEMSIZE times VGT_GS_MAX_VERT_OUT dwords throws; a computed one past it goes to a spare dword that no output reads instead of the item's last dword. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A PS4 copy VS selects its stream block with s_lshr_b32 of the stream-out configuration SGPR, s_cmpk_eq_u32 and s_cbranch_scc0. With SPI_SHADER_PGM_RSRC2_VS.SO_EN set, that SGPR follows the user SGPRs; it is read as 0, since only stream 0 without stream-out is drawn. Scalar compares now set a known SCC, forward s_branch and s_cbranch_scc0/1 on a known SCC are followed, and any other control flow still throws. The GSVS read address must also come from the incoming v0, not one written earlier in the program. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efore it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Heads-up — this doesn't build on Linux (same class as #22359). On a RADV/Linux box (GCC 13.3, Those are the ( AI-assisted: yes |
|
@PrivacyOnion @MarcZX10 when you have time, could one of you give this a first review? It draws PS4 ES-GS-VS geometry shaders through a Vulkan geometry stage and gets Bloodborne past |
…essellation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ip-tessellation Brings in boykopovar#22251's merge of origin/main (cf2cc25). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…metry configuration ShaderStages gained legacyGeometry, so the Linux x86_64 libstdc++ guards no longer matched and the build failed there. The sizes are read from a GCC 11.4 Linux build. The new GeometryConfiguration and GeometryCopyExport get guards like the mesh and tessellation configurations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@tablefrogpillow thank you, that was a real break, and I could only see it on Linux. Fixed in On WSL the old file fails with exactly your two assertions. The new head builds |
|
Builds clean on Linux now (thanks for the fix,
0 VUID throughout. GCN5 is the native arch for the ES-GS-VS ring (RDNA uses NGG), so good to see the PS4 geometry pipeline — drawn through the Vulkan geometry stage — pass on real GCN hardware as well as RDNA2/RDNA3. AI-assisted: yes |
MarcZX10 change request on 1e74360 asked: Changes are required before merge: make the geometry-ring address calculations overflow-safe before using them as vector sizes, indexes, or offsets. His later review of the current head 84c6ee2 states no blocking findings (Blocking: None identified in the code inspected.) so the request no longer applies.
ligmaSec
left a comment
There was a problem hiding this comment.
The request format collides with two other open branches at version 67. I compiled the exact-head serializers for this PR, #23811, and #23553. They read their own captures. This PR rejected the #23553 capture as truncated and the #23811 capture with an emulated-barycentrics flag error. Both other readers also rejected this PR’s capture. Please reconcile the version assignment as these branches land so a saved request always identifies a single layout.
The trial merge onto a1b75b0947 was clean. The format checks were native standalone tests. Paired Vulkan execution is pending.
AI-assisted: yes.
|
@ligmaSec thanks. 67 is the third number of this stack (#22251 writes 65, #22328 writes 66, this PR 67). Main ends at request version 64 and journal format 19, so the clash is only with the open #23811 and #23553. On the journal, #28488 also takes format 20, the number #22251 uses, and this PR uses 21. The plan is the one on #22251: the first branch to land keeps its number. This PR lands after #22251 and #22328, so when it merges main after any other format change it moves its geometry fields and journal format to the next free numbers. The serializer test will expect the new number and reject the next, the reader will refuse the skipped numbers, and I'll ask for a fresh approval. I also corrected the description, which still listed the older 64-66 numbers. |
Main's boykopovar#28218 took pipeline journal format 20 for its early-Z byte. This branch's journal now carries that byte too, so it moves from 21 to 23: 21 was written only by earlier heads of this branch without the early-Z byte, and 22 is left for boykopovar#22251 and boykopovar#22328, whose tessellation byte also used 20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ones The journal is written as format 23. A journal stamped 19 or 20 (main), 21 (earlier heads of this branch), 22 (left for boykopovar#22251 and boykopovar#22328) or 24 is not replayed; the same bytes stamped 23 are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged main |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
Nothing blocks this; the points below are optional.
What I ran
Reviewed head 681916a0952f1b52bf9e24b9a78758cb808aac8d. I inspected the prepared description, commits, manifest and diff, the full GeometryLowering.cpp text, and targeted diff/source excerpts for State.cpp, DrawDecode.cpp and TessellationLowering.cpp. No tests or builds were run here; test results in the description are author-reported.
cat description.md commits.md manifest.json diff.patch
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp 1410 1558
Results
| Check | Result | Note |
|---|---|---|
| Prepared review artifacts | passed | Read; diff output was truncated |
| Source review | not run | Targeted excerpts only |
| Tests and build | not run | Author-reported results not reproduced |
Negative control
Not run; no tests were executed in this review.
Findings
Blocking
None identified in the inspected excerpts. This is not a full-file review.
Non-blocking
The change spans 61 files. Complete review of the remaining files before treating this as a merge recommendation.
Sources
- Geometry lowering at the reviewed head
- GCN geometry state decode at the reviewed head
- Draw program decode at the reviewed head
Not verified
- Full-file behavior of the 61 changed files; four changed paths received targeted inspection, and the other 57 were not reviewed.
- Full texts unavailable in the review folder:
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp. - Build, tests, Vulkan validation and console behavior on this head.
To get this to a good state
Nothing is required. Optional: complete the remaining source review before making a formal merge decision.
… byte main's boykopovar#28218 took journal format 20 for its pixelEarlyZ byte, the number this branch used for the tessellation onChip byte, so a journal written by main would have been read in this branch's layout. The journal now carries both bytes as format 22; 21 was written only by earlier heads of boykopovar#22439 and is refused like 19 and 20, and 23 belongs to boykopovar#22439. FormatNumberTests checks that the journal is written as 22 and that the same file stamped 19, 20, 21 or 23 is not replayed while 22 is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's 1311794 took request serialization version 65 for its windowSelects byte. This branch keeps the stack's layout after it and writes version 70: windowSelects from 65, the tessellation onChip byte from 68 and its constants from 69 (as boykopovar#22251 and boykopovar#22328 now write them), and the geometry configuration from 70. 66 and 67, written only by earlier heads of this branch and boykopovar#22328, are refused; 71 is refused as unwritten. The pipeline journal stays at format 23. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's 1311794 took request serialization version 65 for its windowSelects byte, the number this branch used for the tessellation onChip byte. Requests are now written as version 68: windowSelects is read from 65 and onChip from 68 after it. 66 and 67 were written only by earlier heads of boykopovar#22328 and boykopovar#22439 in other layouts, so they are refused like 50 and 58 to 61; 69 is refused as unwritten. The pipeline journal stays at format 22 (main still writes 20). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ip-tessellation boykopovar#22251 now writes request serialization version 68 after main's 65 (windowSelects). This branch's tessellation constants follow its onChip byte as version 69. 66 and 67, written only by earlier heads of this branch and boykopovar#22439, are refused; 70 is refused as unwritten. The pipeline journal stays at format 22. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged main Change: requests are now version 70, in the stack's new layout (65 Tested on Windows 11, RTX 4080 SUPER, Khronos layer on: 19/19 (serializer, GCN geometry and tessellation, geometry lowering, journal, tessellation, register key, graphics), 0 |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
Nothing blocks this; the points below are optional.
What I ran
Reviewed the prepared diff at head 6572d764e7443cc9ec10d207aa3d8593396ee60c; I did not run commands that compile or tests. I read the description, commits, manifest, and portions of the diff, plus targeted source excerpts from GeometryLowering.cpp, State.cpp, and DrawDecode.cpp through repo_read.py.
Results
| Check | Result | Note |
|---|---|---|
| Targeted source review | not run | Manual inspection only |
| Tests and build | not run | Author-reported results were not rerun |
| Negative control | not run | No test mutation was made |
Negative control
Not run; no test mutation was made.
Findings
Blocking
No blocking finding is reported from the inspected excerpts. The review is incomplete, so this is not a merge approval.
Non-blocking
No source-level non-blocking finding raised.
Sources
- Geometry stage decode at the reviewed head
- Geometry lowering at the reviewed head
- Geometry program decoding at the reviewed head
Not verified
The review folder excluded ShaderResources.cpp, Graphics.cpp, and ShaderMemory.cpp because they were too large. I did not read those files through the reader or inspect all other changed files and hunks. The author-reported test and hardware results were not independently verified.
To get this to a good state
Nothing is required. Optionally, complete review of the uninspected changed files and rerun relevant checks on this head before making a formal approval decision.
…sembly refusal "unsupported geometry input or output assembly" did not say which of its two conditions failed. The message now carries the input primitive type, VGT_GS_MAX_VERT_OUT and VGT_GS_OUT_PRIM_TYPE, so a title's refusal names the assembly that needs support. PPSA38500 reaches this for 21 NGG geometry pipelines with VGT_SHADER_STAGES_EN 0x2030 (ES_EN 2, GS_EN, PRIMGEN_EN): the merged ES+GS mesh path, not the GCN ES-GS-VS copy-shader routing of open PR boykopovar#22439, nor the tessellation ESGS item size of boykopovar#26630 or the vertex-workgroup line lists of boykopovar#26600, none of which applies to it.
What
A PS4 (GCN) title draws geometry shaders with
VGT_SHADER_STAGES_EN0xb0, whichDecodeShaderStagesrefused (unsupported geometry routing, fast launch or wave-ID state). This PR draws that routing through a Vulkan vertex stage (the ES) and a Vulkan geometry stage (the GS). The VS slot holds the copy shader, which is read but not compiled.Register decode. Mesa
gfx7.json(mesa-25.2.8):VGT_SHADER_STAGES_ENfieldsLS_EN[0,1],HS_EN[2,2],ES_EN[3,4],GS_EN[5,5],VS_EN[6,7]. WithES_STAGE_REAL= 2,GS_STAGE_ON= 1 andVS_STAGE_COPY_SHADER= 2, 0xb0 is ES real, GS on, and the copy shader on the VS stage.VGT_GS_MODE:MODE[0,2] (GS_SCENARIO_G= 3),CUT_MODE[4,5],ES_PASSTHRU[13],COMPUTE_MODE[14],FAST_COMPUTE_MODE[15],ELEMENT_INFO_EN[16],SUPPRESS_CUTS[18],ONCHIP[21,22]. The other four bits are accepted because they only tune VGT scheduling and ring write combining, not what the stages compute:GS_C_PACK_EN[11],PARTIAL_THD_AT_EOI[17],ES_WRITE_OPTIMIZE[19] andGS_WRITE_OPTIMIZE[20]. Mesa'sac_vgt_gs_modesetsES_WRITE_OPTIMIZE(GFX8 and older) andGS_WRITE_OPTIMIZEon every legacy GS draw.VGT_GS_OUT_PRIM_TYPEOUTPRIM_TYPE[0,5]:POINTLIST0,LINESTRIP1,TRISTRIP2.VGT_GS_INSTANCE_CNT:ENABLE[0],CNT[2,8].VGT_GS_MAX_VERT_OUT[0,10].VGT_ESGS_RING_ITEMSIZE,VGT_GSVS_RING_ITEMSIZEandVGT_GS_VERT_ITEMSIZEare each [0,14].SPI_SHADER_PGM_RSRC2_VS:USER_SGPR[1,5],SO_EN[12].shadPS4
143b58aa48decodes this routing the same way.regs_vertex.hhasEsGs = 0xB0u.vk_pipeline_cache.cppbindsHwStage::ExportasSwStage::VertexandHwStage::GeometryasSwStage::Geometry, and skips the draw onregs.vgt_gs_mode.onchip || regs.vgt_strmout_config.raw.Decode (
State.cpp). For a GCN guest, 0xb0 decodes asShaderStages::legacyGeometrywhenVGT_GS_MODEisGS_SCENARIO_G, off chip, with no ES pass-through, compute mode, element info or suppressed cuts. It reads the input vertex count from the primitive type, plus the output topology,VGT_GS_MAX_VERT_OUT, the instance count, and the ESGS and per-vertex GSVS item sizes. These throw by name: stream-out, streams 1-3 (VGT_GS_VERT_ITEMSIZE_1-3), point output, adjacency, rect, quad and patch input, a GSVS ring item smaller than the vertex size times the maximum, and viewport depth remapping through a geometry shader.DrawDecode.cppreads the ES, GS and copy VS from their own program and user-data registers (0xc8,0x88and0x48).ES. The ES is compiled as a Vulkan vertex shader. Its ESGS ring stores (
soffsetthe ES2GS offset SGPR) become its output record ofVGT_ESGS_RING_ITEMSIZEdwords.GS. The GS is compiled as a Vulkan geometry shader with
Invocations= instance count andOutputVertices=VGT_GS_MAX_VERT_OUT. Its input VGPRs carry the ES vertex offsets. An ESGS ring read becomes a read of that input vertex's record: component = (soffset+ offset) / 256, as in shadPS4'sRingAccessElimination(bucket = soffset.U32() / 256u). GSVS ring stores (soffsetthe GS2VS offset SGPR) go to a per-invocation array ofVGT_GS_VERT_ITEMSIZExVGT_GS_MAX_VERT_OUTdwords.s_sendmsgGS emit and cut becomeEmitVertexandEndPrimitive. This follows the way #22251 lowers the tessellation rings (TessellationLowering,TessellationBaseandGet/SetTessellationAttribute).Copy VS defines the outputs.
ParseGeometryCopyProgramreads each export of the copy VS. Each enabled component is either a GSVS ring dword, read atsoffset+ offset = slot xVGT_GS_MAX_VERT_OUTx 64 bytes and addressed by the incomingv0x 4, or a constant. The GS stores slot k of vertex v at byte (k xVGT_GS_MAX_VERT_OUT+ v) x 4, and the copy reads slot k at 16 times that slot base, because the GSVS write descriptor is swizzled with 16-lane groups. Mesa does the same:ac_nir_lower_legacy_gs.cstores atbase = offset * vertices_out(offset 4 per component) plus vertex x 4, andac_nir_create_gs_copy_shader.cloads atoffset * vertices_out * 16; shadPS4'sRingAccessEliminationmaps a store offset to the copy read offset with* 16u. Every emit copies those dwords of the emitted vertex out of the array to the same export targets. shadPS4'sParseCopyShaderderives the same layout (output_vertices = comp_stride / 64) and foldss_movk,s_addk,s_lshlands_bfmscalar offsets. Here, scalar moves, adds, shifts, masks and multiplies with known sources are folded.Copy VS control flow. A PS4 copy VS selects its stream block with
s_lshr_b32 s10, s2, 24,s_cmpk_eq_u32 s10, 0ands_cbranch_scc0to the end.s2is the stream-out configuration SGPR, which follows the user SGPRs whenSO_ENis set. Its stream ID (bits 24-25, as in radeonsi's GS copy shader) is 0, and its buffer bits are 0, because only stream 0 without stream-out is drawn. That SGPR is therefore read as 0. Scalar compares then give a known SCC, and forwards_branchands_cbranch_scc0/1on a known SCC are followed. These throw: any other branch, a backward branch, a write to EXEC, an export of a computed value, and a GSVS read whose address is not the incomingv0x 4.Bounds. A GSVS store at a constant address past the item throws. A store at a computed address past it goes to a spare dword that no output reads.
Configuration in caches and requests. The geometry configuration is in the shader key, the pipeline journal (format 23) and serialized requests (version 70). This PR stacks on #22328, which uses 69 (and #22251, which uses 68). Main ends at request version 65 (
windowSelects) and journal format 20 (#28218's early-Z byte). Request versions 66 and 67 were written only by earlier heads of this PR and #22328, in other layouts, and are refused. Journal format 21 was written only by earlier heads of this PR, without that byte, and is refused; 22 is left for #22251 and #22328, whose tessellation byte also used 20. Shader validation accepts the copied geometry stage's execution modes, clip and cull distances, and itsPrimitiveId/InvocationIdinputs.The gaps are recorded in
docs/dev/debt/changes/claude-gcn-es-gs-copy-vs.md. Nothing is keyed to a title, a shader or a value.Tested
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2, RTX 4080 SUPER, driver 621.14.
tests/execution/GcnGeometry.cpp(agc_driver_gcn_geometry) is new and uses hand-assembled gfx7 programs:s_addk_i32,s_lshl_b32ands_bfm_b32are folded. A stream-select block is followed when the stream-out configuration SGPR is given, and throws when it is not. A takens_cbranch_scc0skips the export it jumps over, and an SCC overwritten bys_add_u32after the compare is not trusted.s_cbranch_execz, an EXEC write, and a movedv0.RequestSerializerTests.cpp: a version 70 geometry round trip; version 69 and older requests still read, 66, 67 and 71 are refused.tests/ShaderMemory.cppexpects version 70 (65 at the time of the run below). Windows Defender quarantinesagc_shader_memory_tests.exehere, so it ran on Linux (WSL, GCC 11.4) at8b64e1c900b:agc_shader_memory,agc_shader_memory_coherent_atomic_loadsandrequest_serializer, 3/3 pass. Later commits do not touch the serializer or that test.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, andctest -Vonrequest_serializer,agc_driver_gcn_geometry,agc_driver_gcn_tessellation,agc_driver_tessellation_geometry,agc_driver_pipeline_journal,agc_pipeline_journal,agc_driver_register_key,agc_graphics_profile_drawandagc_driver_prepared_graphics.8e00caff807;c89e3c5819eonly adds tests, andagc_driver_gcn_geometrywas rerun on it): 9/9 pass, 25Insert instance layer "VK_LAYER_KHRONOS_validation"lines, nowas not found but was requested by env var VK_INSTANCE_LAYERS, noVUID-.main(c8542bb73d5): 7/7 pass, 23 layer inserts, noVUID-.agc_driver_gcn_geometryandagc_driver_gcn_tessellationdo not exist onmain; the new test cannot build there, becausemainhas no GCN geometry decode.c89e3c5819e):PipelineJournal.cpp's Linux x86_64 libstdc++static_asserts still saidState1008 andShaderStages164, so the Linux build failed.258b5932450sets them to 1064 and 224, read from a WSL Ubuntu GCC 11.4 build of this head, and adds guards forGeometryConfiguration(48) andGeometryCopyExport(32). The recipe codec andCanonicalPipelineStatealready carriedlegacyGeometry. On WSL the old file fails with both assertions and the new head buildsagc_driver_gcn_geometry_tests,agc_driver_gcn_tessellation_testsandagc_driver_graphics_tests;agc_pipeline_journalpasses, and the two GCN tests skip there because WSL has no Vulkan loader. The guards are compiled out on Windows, so the Windows binaries and the validation results above are unchanged.61c3102e80dmerges the feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328 heada589520069d; it changes no AGC or shader file.258b5932450, Khronos validation 1.4.363,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1):agc_driver_gcn_geometryandagc_driver_gcn_tessellationpass on RX Vega 56 (RADV gfx900, GCN5), a Ryzen 7000 iGPU (RADV gfx1036, RDNA2), RX 7900 GRE (RADV gfx1100, RDNA3) and lavapipe, with noVUID-.258b5932450merged onto main1adc0e2f4b, Khronos validation 1.4.363.1,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1): the Linux build succeeds, andrequest_serializer,agc_driver_gcn_geometry,agc_driver_gcn_tessellation,agc_driver_tessellation_geometry, the journal, register-key, profile, prepared-graphics, shader-memory andagc_driver_graphicstests pass 12/12 on an RTX 4090 (620.70.06) against 10/10 on main, with noVUID-on either and no missing-layer line.VGT_SHADER_STAGES_EN=0xb0. With the first version of this PR, it stopped on the game's copy VS (control flow in a copy program at pc 0x1c): the stream-select branch above, now handled. Now the 0xb0 draws pass and the game loads toward the world, reaching the item-tip loading screen. It stops about 16 s later, at about 69 s, on an unrelatedEVENT_WRITE event type 56 is not implemented(PIXEL_PIPE_STAT_CONTROL). Gameplay is not reached yet, so these draws' pixels were not checked in the game.check_conventionspasses.pr_overlaplists only PRs that share lines in the same files (the serializer and journal version lines,ShaderMemory.cppL8918,State.hpp,DrawDecode.cpp); none implements GCN geometry shaders. A search of open PRs for geometry shader, copy shader, ESGS and GSVS found none.v0was still taken as the vertex index. Fixed, with a test.8e00caff807: GO. It asked for tests of a taken branch and of an SCC overwritten between the compare and the branch; both were added inc89e3c5819e, andagc_driver_gcn_geometrypasses again with the layer loaded and noVUID-.358fbde4846: merged the updated feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328 branch (current mainc8f72e905cc). The geometry configuration moves to request serialization version 66, still before main's fix(agc): draw a last provoking vertex through the barycentric tessellation stages without VK_EXT_provoking_vertex #21938 barycentrics flag. The positionalGraphicsCompileContextinitializers inDrawCapture.cpp,ShaderRegistry.cppandGcnGeometry.cppgain main's barycentrics flag beforetessellationConstantsandgeometry, and main's barycentrics test drops the geometry byte before reading a request as version 62.358fbde4846gives the geometry program-decode fixture aCB_COLOR0_INFOformat for fix(agc): skip a pixel program whose color masks reach no formatted target #21747. 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):agc_driver_gcn_geometryplus the 10 tests listed on feat(agc): draw PS4 LS-HS-VS tessellation through the off-chip ring lowering #22251 pass 11/11 in 3 of 3 runs;mainpasses its 9. The layer loads in every log, nowas not foundline, noVUID-on either side. WSL Ubuntu, GCC 11.4: theagc_shader_memory_testsctests andrequest_serializerpass 36/36, andPipelineJournal.cppcompiles with its Linux layout guards.debt_fold.py --checkandcheck_conventionspass.0ffacd193bc: merged the updated feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328 branchbb91cb8b2c5(with main56d4f9fe7e0). The only conflict wasRequestSerializerTests.cpp: main's single-sample dithered alpha-to-coverage test now expects this branch's version 66 and treats 67 as the unsupported version. 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_geometry,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_ring9/9;main56d4f9fe7e04/4 on the tessellation and serializer tests. Both logs load the layer, neither haswas not found, 0VUID-in each.check_conventionsanddebt_fold.py --checkpass.8eba1cbb53e: merged the updated feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328 branch86ed1185e95(with main1d1587ced3b), no conflicts. Redwindowson the previous head was main's, not this branch's:guest_freetype_ot_glyph_mutation(_patched)(feat(freetype): implement glyph mutation exports #18482, reverted in revert(libSceFreeType): undo the glyph mutation exports (#18482) #25141),audio_out2_port_layouts(fix(libSceAudioOut): avoid partial output write in sceAudioOut2UserGetSupportedAttributes #25046, reverted in revert(libSceAudioOut2): undo the user atomic attr outputs change (#25046) #25143). 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): the feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328 eight plusagc_driver_gcn_geometry9/9;main786bc3afa1c4/4 on the tessellation and serializer tests. Both logs load the layer, neither haswas not found, 0VUID-in each.check_conventionspasses.73f688b955a: @oneandonlydean's restart finding fixed.restartFinishedDrawnow reads a geometry program'sPA_CL_VS_OUT_CNTLexport layout from the copy program, like the two other decode sites; all three use the newPositionExportProgram, whichGcnGeometry.cppchecks (GS takes the copy program, ES and copy take their own, a GS with no copy program after it takes its own). Merged main1bc92752d23; the only conflict was thecore/shader/recompiler/CMakeLists.txtsymbol list (keptParseGeometryCopyProgramand main's NaN-speculation symbols). 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):agc_driver_gcn_geometrypasses 3/3 andagc_driver_draw_recapture_on_changepasses; the layer loads in every log, nowas not found, 0VUID-. A restarted ES-GS-VS draw with clip distances was not run (no fixture drives the recapture path through a geometry draw).check_conventionspasses.9519fe4d288: CodeRabbit fixesc2ea4d4c0deplus a merge of main6653a47801b. The fixes: restarted draws reread changed copy-program exports; draw keys cover the geometry configuration and every register the GCN geometry decode reads; GCN indirect user-data words use the hidden word count; MSG_GS_DONE keeps emit and cut; a geometry s_barrier emits no Workgroup barrier; the copy parser accepts a load into its own address register; ring address terms refuse on overflow; polygon mode follows the geometry output primitive. Main's split state took request serialization version 64, so this stack's fields move to 65-67 (the conflicts wereRequestSerializer.cpp,RequestSerializerTests.cppandShaderMemory.cpp). New checks are inGcnGeometry.cpp, including SPIR-V emit, cut and barrier counts. 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_geometry,agc_driver_gcn_tessellation, the fouragc_driver_draw_recapture_on_change*,agc_graphics_profile_draw,agc_driver_stencil_ref_export_push_budget,agc_driver_push_constant_assemblyandagc_command_batch_fence_failurepass 10/10; onmain6653a47801bthe 8 that exist there pass 8/8. Both logs load the layer, neither haswas not found, 0VUID-in each.agc_shader_memory_tests(its version fixtures changed in the merge) is not built on Windows, and Linux was not run locally.check_conventionsanddebt_fold.py --checkpass.75aef74e924: merged feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #2232858c5304937a(with mainea49f32e898; versions stay 65/66/67);6bbf38cc2b0collapses a zero-width viewport for GCN geometry only when it outputs triangle strips (GcnGeometry.cppchecks; the line-strip check fails without the fix). 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_gcn_geometry,agc_driver_draw_recapture_on_change_inline,agc_driver_draw_recapture_on_change_finisher,agc_driver_tessellation,agc_driver_tessellation_geometry,agc_driver_graphics,agc_tessellation_lowering10/10. Every log loads the layer, nowas not found, 0VUID-.check_conventionsanddebt_fold.py --checkpass.d4c1ba3a31c: CodeRabbit's copy-program note fixed inbbafa86a109:ParseGeometryCopyProgramnow throws on any buffer, typed buffer, flat, LDS or image access other than the GSVS ring read, where it used to drop it (a copy-program store parsed without error and never ran).GcnGeometry.cppadds a copy program ending inbuffer_store_dword; without the fixagc_driver_gcn_geometryfails witha copy program was accepted. Merged mainc2787d822ad; the only conflict was theUserDataWordsrole line inDrawDecode.cpp(kept this branch'sLinkedOnlyRole, main'shiddenUserWordsterm was already here). Main still ends at request serialization version 64 and has not changed the serializer or journal since the last merge, so 65/66/67 do not collide. 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):agc_driver_gcn_geometry,agc_driver_gcn_indirect_draw_location,agc_driver_gcn_tessellation,agc_driver_tessellation_geometry,agc_driver_draw_recapture_on_change_inlineand_finisher6/6 on the merged head;mainc2787d822ad4/4 on the four that exist there. Every log loads the layer, nowas not found, 0VUID-.check_conventionsanddebt_fold.py --checkpass.dbb26e7a016: following akimfomin's note,2ffa22b8311makes the pixel check catch a duplicated primitive or a twisted strip. Each quad is blended at a quarter of its colour over the clear colour, and five points per quad are sampled. Two temporary controls fail it: drawing twice (red 144, expected 80) and swapping two GS vertex x stores (a sample near an edge keeps the clear colour). Merged feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #223288dd935bb29f(tessellation constants read with the draw's memory), clean, no version change. Same setup as above:agc_driver_gcn_geometry,agc_driver_gcn_indirect_draw_location,agc_driver_gcn_tessellation,agc_driver_tessellation_geometry,agc_driver_draw_recapture_on_change_inlineand_finisher6/6, 10 layer inserts, nowas not found, 0VUID-;mainc2787d822ad4/4, 0VUID-. feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328's newShaderMemory.cppcheck is inagc_shader_memory_tests, which is not built on Windows here; CI runs it.check_conventionsanddebt_fold.py --checkpass.1e7436042b4: CodeRabbit's three notes. (1)Evaluateremembers solved terms and stops at the first operand it cannot solve, so a sharedISub32(a, a)chain is no longer 2^n calls; the newagc_geometry_loweringtest (31 shared steps) passes in 0.07 s and times out at 10 s without the fix. (2) The copy parser refuses GSVS reads through two descriptors, or after the descriptor SGPRs are rewritten; whether the one descriptor is really the GSVS ring is not checked (recorded in debt). (3) It refuses a GSVS read with the LDS modifier. EachGcnGeometry.cpprefusal fails with its fix reverted. Same Windows setup withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer:agc_geometry_lowering,agc_driver_gcn_geometry,agc_driver_gcn_indirect_draw_location,agc_driver_gcn_tessellation,agc_driver_tessellation_geometryand the twoagc_driver_draw_recapture_on_changetests 7/7, 10 layer inserts, nowas not found, 0VUID-;mainc2787d822ad(the main in this head) 4/4, 0VUID-.check_conventions,debt_fold.py --checkandcheck_test_registrationpass.84c6ee2d4bd: MarcZX10's overflow point.GeometryRingDwordscomputes GSVS ring sizes in 64 bits and refuses rings that do not fit 32-bit addresses; the copy parser, lowering and SPIR-V ring use it.agc_geometry_loweringcovers the largest accepted ring (1024 vertices x 32767 dwords) and a wrappingVGT_GS_MAX_VERT_OUT, and fails with the check disabled. Windows RTX 4080 SUPER, LunarG 1.4.363.1 validation: 6/6 focused tests, 0VUID-; main1d9818437fd3/3, 0VUID-.681916a0952: merged mainfb41bd71986. The only conflict was the pipeline journal format line: main's fix(agc): run quad-masked early-Z stores under early fragment tests #28218 took format 20 for its early-Z byte. This head writes format 23 (main's byte plus this stack's fields); 21 was written only by earlier heads of this PR without the early-Z byte, and 22 is left for feat(agc): draw PS4 LS-HS-VS tessellation through the off-chip ring lowering #22251 and feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328, whose tessellation byte also used 20. Request serialization is unchanged (main still ends at 64; this PR writes 67). New check intests/execution/PipelineJournal.cpp: the journal is written as 23, and the same file stamped 19, 20, 21, 22 or 24 is not replayed while 23 is. 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_geometry,agc_driver_gcn_tessellation,agc_driver_tessellation_geometryandagc_geometry_lowering13/13, 34 layer inserts, nowas not found, 0VUID-;mainfb41bd7198610/10 on the ten that exist there, 25 layer inserts, 0VUID-. Linux layout guards:PipelineJournal.cppcompiles under WSL Ubuntu GCC 11.4 (-fsyntax-onlywith the build's flags), soStateis still 1064 there; with the guard changed to 1063 it fails.check_conventionsanddebt_fold.py --checkpass.6572d764e74: merged mainb71ffddc0f1. Main's13117947f91took request serialization version 65 for itswindowSelectsbyte, soRequestSerializer.cpp,RequestSerializerTests.cppandShaderMemory.cppconflicted. Requests are now written as version 70, laid out as the stack now writes them:windowSelectsfrom 65, the on-chip byte from 68 (feat(agc): draw PS4 LS-HS-VS tessellation through the off-chip ring lowering #22251), the tessellation constants from 69 (feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328) and the geometry configuration from 70. 66 and 67, written only by earlier heads of this PR and feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328 in other layouts, are refused; 71 is refused as unwritten. The journal stays at format 23. 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_geometry,agc_geometry_lowering,agc_driver_gcn_tessellation,agc_driver_pipeline_journal(format check),agc_driver_pipeline_journal_undecodable_module, the sixagc_pipeline_journal*tests,agc_driver_tessellation,agc_driver_tessellation_geometry,agc_driver_tessellation_depth_range_remap,agc_tessellation_factor_ring,agc_tessellation_lowering,agc_driver_register_keyandagc_driver_graphics19/19, 37 layer inserts, nowas not found, 0VUID-;mainb71ffddc0f116/16 without the three GCN tests, 28 inserts, 0VUID-.agc_shader_memorywas not run locally (Defender quarantines it on Windows); CI covers it.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