Repository navigation
fix(agc): decode primitive type 3 as a line strip - #4584
Conversation
|
Correction to my comment above (I overstated it): the test run of Record of Lodoss War -Deedlit in Wonder Labyrinth- (PPSA05347) with a local build of AI-assisted (Claude Code). |
|
The Written with AI assistance. |
|
Windows test of the LineStrip change ( Control on plain AI-assisted (Claude Code). |
|
Correction to the flake note above: the AI-assisted (Claude Code). |
1858502 to
a9df8fd
Compare
|
One place is missed: #4587 is the duplicate; this is the one to keep. |
DecodeState mapped points, lists, strips, fans, rect lists and patches but threw "unsupported primitive type 3" for VGT_PRIMITIVE_TYPE 3, the line strip (DI_PT_LINESTRIP in Mesa's r600d.h). Record of Lodoss War (PPSA05347) stops on it after a few minutes. Vulkan allows primitive restart for line strips without the list restart extension, and the precheck, the pipeline and the provoking vertex check already treat the strip class that way; only the decode lacked the case. The point and line depth bias enable stays rejected on line strips like on line lists, and a line strip gets the line primitive class for a pixel shader that reads the ancillary word. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
a9df8fd to
67e7a30
Compare
|
Done: AI-assisted (Claude Code). |
What
DecodeStatemappedVGT_PRIMITIVE_TYPE1, 2, 4, 5, 6, 7, 9 and 17 and threwAGC graphics: unsupported primitive type 3for 3, the line strip (V_008958_DI_PT_LINESTRIP 0x3in Mesa'sr600d.h, the same enum that gives 2 = line list and 4 = triangle list). Type 3 now decodes asVK_PRIMITIVE_TOPOLOGY_LINE_STRIP.RasterPrimitiveOfinState.cpp(the primitive class a pixel shader sees when it reads the ancillary word) maps the line strip toRasterPrimitive::Lineas well, so a strip no longer falls to the triangle default (review of this PR).The other places that depend on the topology already handled the strip class and needed no change:
Primitive restart:
Draw.cpp,Pipeline.cppand the draw precheck treat type 3 as a strip (restart allowed withoutVK_EXT_primitive_topology_list_restart), and Vulkan allows restart forLINE_STRIP.ValidateProvokingVertexalready acceptsLINE_STRIP.The conservative-rasterization and single-sample MSAA checks already name type 3 as lines and refuse it.
One change beside the case: the point and line depth bias enable (
PA_SU_SC_MODE_CNTLbit 13) is rejected on point and line draws because Vulkan applies depth bias to polygons only (af9e60b).pointsOrLinesinState.cppnow includes the line strip so the bit is still rejected there.Tests (
agc_driver_graphics):LineStripTests: type 3 decodes toLINE_STRIP; with primitive restart enabled (user config register0x24b) and reset index0xffffffff(context register0x103) the restart is kept and the draw precheck accepts an indexed draw.The provoking-vertex loop now includes type 3.
The depth bias test refuses the point and line enable bit on type 3 like on type 2.
Without the
State.cppchange the test fails withunsupported primitive type 3.Tested
Windows 10, MinGW,
agc_driver_graphicspasses with the change and fails without it as above (checked before the last rebase). After the rebase onto main2a5eca11cit passed in 8 of 10 runs; of the two failures I saw the message of one:host import of ... failed at vkAllocateMemory (-2)followed bywrite-watched arena contained no host exclusion to test, which is unrelated to line strips. I did not check whether the test fails the same way on plainmainunder load.tools/check_conventions.py --base upstream/mainpasses.Branch rebased onto
mainc13dc7e6b, built there (Windows 10, MinGW, Release):agc_driver_graphicspasses 10 of 10 runs with the change; with theRasterPrimitiveOfpart taken out the test fails (a line strip draw did not get the line primitive class, 2 of 2 runs).After the rebase onto main
0c3dc9ca2(a conflict intests/Graphics.cppwith the newaliasedBufferViewTests; both tests kept) the branch was built on that main andagc_driver_graphicspassed 10 of 10 runs on Windows 10. Then rebased once more onto37dd48308without a conflict (not rebuilt).Not tested: no game run, no Vulkan draw of a line strip. Record of Lodoss War -Deedlit in Wonder Labyrinth- (PPSA05347) stopped on
unsupported primitive type 3in two user runs (after about 270 s and about 73 s); whether it runs on past this stop is untested. The enum source is the older-generationr600d.h; I did not check the value against a GFX10 header.Overlap: #4587 made the same
case 3change inState.cpp; it was closed in favour of this PR.Checklist
Based on current
main(last build on0c3dc9ca2, later rebases not rebuilt); no other open PR makes the same change (feat(libSceAgcDriver): support primitive type 3 (line strip) #4587 was closed)One topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw; no silent stubs added
No notes, investigation
.mdfiles or images added to the repositoryNew third-party code is a submodule built from source (none added)
Generic behaviour, not specific to one title
Depends on: none
Unblocks: none
AI-assisted: yes
AI-assisted (Claude Code).
🤖 Generated with Claude Code