Repository navigation
feat(agc): draw line-strip output of NGG geometry programs as mesh lines - #5884
adriadam10 merged 1 commit into
Conversation
|
Resident Evil 4 (PPSA07411), the RE2 engine sibling, stops on
Rebase notes, in case they help. All source files merged automatically except the request serializer:
AI-assisted: yes |
|
Tested on a second RE Engine title: Onimusha: Way of the Sword (PPSA27836). Windows 11, RTX 5070 (NVIDIA 617.42). Base: With this PR that draw passes, and the scene load goes on to a different, unrelated stop (a depth target with fewer samples than the rasterizer, handled by #5915 and #5907). The merge onto current |
A geometry program with VGT_GS_OUT_PRIM_TYPE 1 was refused as an unsupported output assembly. Each primitive export of an NGG line-strip program is one line whose indices are packed like a triangle's, so the mesh module now declares OutputLinesEXT with PrimitiveLineIndicesEXT for it. A subgroup gets VGT_GS_MAX_VERT_OUT - 1 lines per input primitive and at least GE_MAX_OUTPUT_PER_SUBGROUP line slots; fast launch keeps using PRIM_AMP_FACTOR. The output size is part of the cache, draw, validation and pipeline keys, and the request serialization version becomes 31. Triangle-strip geometry is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15b0d03 to
a0347cf
Compare
|
Checked on the PR merged onto current |
The layout guards only build on Linux with libstdc++, so a Windows or macOS build of main after boykopovar#5884 wrote journals whose mesh records lack outputPrimitiveSize under the new shader-cache source version. The journal format is now 3, so such a file is discarded instead of being read with the new codec. MarcZX100 pointed this out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#5884 added MeshConfiguration::outputPrimitiveSize, and #5875's pipeline journal guards the layouts it encodes. The two merged separately, so on Linux with libstdc++ PipelineJournal.cpp no longer compiles: MeshConfiguration is 40 bytes, ShaderStages (which holds an optional one) 112. The guards now name those sizes, and the recipe codec writes and reads the new field, so a replayed line-strip geometry pipeline keeps its two-vertex primitives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#5884 took request version 31 on main for the mesh output primitive size, so a version 31 request from main has no point-list tail. The point fields now come with version 32, and the tests expect 32 and reject 33. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#5884 took request version 31 on main for the mesh output primitive size, so a version 31 request from main has no point-list tail. The point fields now come with version 32, and the tests expect 32 and reject 33. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #5884's request field (output primitive size, read from serialization version 31). This branch's sample order stays at version 32, read after it, so a version-31 request reads as before.
What
A draw whose NGG geometry program outputs line strips (
VGT_GS_OUT_PRIM_TYPE= 1) is refused onmainwithunsupported geometry input or output assembly. Resident Evil 2 (PPSA04288) hits this with point-list input andVGT_GS_MAX_VERT_OUT= 5.On GFX10 NGG the geometry program assembles the strip itself: each primitive export is one line whose two vertex indices are packed the same way as a triangle's three (
ac_nir_lower_ngg_gs.c,ac_nir_pack_ngg_prim_exp_arg). So the host only has to change the output topology:DecodeShaderStagesacceptsVGT_GS_OUT_PRIM_TYPE1 from a geometry program (also with fast launch) and records a two-vertex output primitive in the mesh configuration. The value encoding is from Mesa'sgfx10.json.OutputLinesEXTand aPrimitiveLineIndicesEXTarray of two-component indices; validation and the raster class (Line) follow it.VGT_GS_MAX_VERT_OUT - 1lines, and a subgroup gets at leastGE_MAX_OUTPUT_PER_SUBGROUPline slots, because Mesa's lowering exports one primitive (possibly null) per emitted vertex and RADV programsPRIM_AMP_FACTORasvertices_out. Fast launch keeps taking the count fromPRIM_AMP_FACTOR. Triangle strips keep their current budget.Triangle-strip geometry is unchanged: the 29 triangle mesh modules from
agc_driver_meshare byte-identical before and after. Points, rectangle lists, per-stream output types and line strips from a vertex program still throw. Line width and the console's line rules are not measured;docs/dev/debt/libSceAgcDriver.mdrecords that and the primitive budget.Overlap: this bumps the serialization version from 25 to 26, as #4706 also does. Whichever lands second moves to 27. It also sits near #5604 in
DecodeShaderStages; neither depends on the other.Tested
Windows 11, MinGW-w64 GCC 15.2.0, Release, AMD Radeon RX 9070 XT.
agc_driver_graphics: the title's register state decodes as geometry rasterized as lines, with 255 line slots for 51 points; the same draw with a triangle strip is unchanged; values 0, 3 and per-stream types still throw; a fast-launch line strip takes 64 lines fromPRIM_AMP_FACTOR; triangle input with line output now refuses a triangle-only polygon offset.agc_driver_mesh: a hand-written geometry program draws line strips from points, and pixels are checked on both segments, beside them, inside the strip's triangle and on its closing edge. Onmainit fails because the second line is drawn as a triangle.agc_shader_memoryandrequest_serializer: the output size round-trips at version 26 and changes the cache keys; version 27 is refused.mainwith the title's message, and the mesh test fails onmainas above.spirv-val --target-env vulkan1.3.ctest: 1170 of 1171 pass, 10 expected skips.agc_driver_layered_volume_vertex_no_gplfails on this GPU onmaintoo.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)