AGC: a rect-list draw whose vertex count is not a multiple of 3 aborts with "incomplete rect-list primitive" (Palworld, PPSA23126) #3832

Closed
opened 2026-10-11 17:19:43 +00:00 by queeeef · 0 comments
queeeef commented 2026-10-11 17:19:43 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-11T17:19:43Z.


Palworld (PPSA23126, 01.102.999): a rect-list draw of 4 vertices aborts with incomplete rect-list primitive

When character creation opens (after "Finish setting up world and start the game? → Yes"), presentation fails and the title terminates:

[videoout] presentation failed: AGC graphics: incomplete rect-list primitive
terminate called after throwing an instance of 'std::runtime_error'

The check is Draw.cpp prepareDrawInputs: if (state.rectList) Require(draw.indexCount % 3 == 0, "incomplete rect-list primitive");.

The draw (local diagnostic that prints the parameters before the throw, 917fd308):

count 4 indexed 0 indexSize 0 indexAddress 0x0 instances 9 firstVertex 0 firstInstance 0 flags 0x0 color 1 0x3031e40000 2048x2048 render 2048x2048

A direct, non-indexed draw of 4 vertices × 9 instances (10 instances on another run), rect-list topology, into a 2048x2048 color target.

What the host already does without the check. Rect lists are recorded as VK_PRIMITIVE_TOPOLOGY_PATCH_LIST with 3 control points, and Vulkan generates ⌊vertexCount/3⌋ patches, so the trailing vertex forms no rectangle. The three draw forms reach the same rule:

  • direct non-indexed: vkCmdDraw with the count;
  • direct indexed: vkCmdDrawIndexed on the same patch list, ⌊indexCount/3⌋ patches;
  • indirect: ClassifyIndirectDraw sends every rect-list indirect draw to the CPU path (NonVertexPath); each record becomes a direct Pm4::DrawParameters and goes through the same prepareDrawInputs check.

Hardware. Not measured. The hardware oracle (tools/hw-oracle) runs compute kernels on Linux with an AMD GPU, so it cannot observe primitive assembly, and I have no AMD GPU here. I found no public statement for gfx10 rect lists. A retail title issuing this draw shows that the console accepts it; it does not show what the console rasterizes for the leftover vertex.

Local check: dropping the vertices past the last complete rectangle gets the title past this point: character creation renders and the title runs on to a later, unrelated stop (reported in #2648).

Fix: #3835.

Setup

  • Windows 11 Pro 26300, RTX 2080 Ti (NVIDIA 610.74), i5-13600K
  • MinGW-w64 GCC 15.2.0 (WinLibs r7), RelWithDebInfo
  • main a11c8f7f7 plus the open PRs Palworld needs to get this far: palworld/integration (#3461 branch, #3739, #3633, #1077, #2904, #425, #3546 and local workarounds listed in #2648)
  • Relinked with --windows --to-intel --registry

No game files are shared, only log lines and draw parameters. AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5803356846 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3832). Originally posted by [queeeef](https://github.com/queeeef) on 2026-10-11T17:19:43Z. --- **Palworld (PPSA23126, 01.102.999): a rect-list draw of 4 vertices aborts with `incomplete rect-list primitive`** When character creation opens (after "Finish setting up world and start the game? → Yes"), presentation fails and the title terminates: ``` [videoout] presentation failed: AGC graphics: incomplete rect-list primitive terminate called after throwing an instance of 'std::runtime_error' ``` The check is `Draw.cpp` `prepareDrawInputs`: `if (state.rectList) Require(draw.indexCount % 3 == 0, "incomplete rect-list primitive");`. **The draw** (local diagnostic that prints the parameters before the throw, [`917fd308`](https://github.com/queeeef/AnyPS5/commit/917fd308e8b801c8f52fdd4214c5849c580c741b)): ``` count 4 indexed 0 indexSize 0 indexAddress 0x0 instances 9 firstVertex 0 firstInstance 0 flags 0x0 color 1 0x3031e40000 2048x2048 render 2048x2048 ``` A direct, non-indexed draw of 4 vertices × 9 instances (10 instances on another run), rect-list topology, into a 2048x2048 color target. **What the host already does without the check.** Rect lists are recorded as `VK_PRIMITIVE_TOPOLOGY_PATCH_LIST` with 3 control points, and Vulkan generates [⌊vertexCount/3⌋ patches](https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#drawing-patch-lists), so the trailing vertex forms no rectangle. The three draw forms reach the same rule: - direct non-indexed: `vkCmdDraw` with the count; - direct indexed: `vkCmdDrawIndexed` on the same patch list, ⌊indexCount/3⌋ patches; - indirect: `ClassifyIndirectDraw` sends every rect-list indirect draw to the CPU path (`NonVertexPath`); each record becomes a direct `Pm4::DrawParameters` and goes through the same `prepareDrawInputs` check. **Hardware.** Not measured. The hardware oracle (`tools/hw-oracle`) runs compute kernels on Linux with an AMD GPU, so it cannot observe primitive assembly, and I have no AMD GPU here. I found no public statement for gfx10 rect lists. A retail title issuing this draw shows that the console accepts it; it does not show what the console rasterizes for the leftover vertex. **Local check:** dropping the vertices past the last complete rectangle gets the title past this point: character creation renders and the title runs on to a later, unrelated stop (reported in #2648). Fix: #3835. **Setup** - Windows 11 Pro 26300, RTX 2080 Ti (NVIDIA 610.74), i5-13600K - MinGW-w64 GCC 15.2.0 (WinLibs r7), RelWithDebInfo - `main` `a11c8f7f7` plus the open PRs Palworld needs to get this far: [`palworld/integration`](https://github.com/queeeef/AnyPS5/tree/palworld/integration) (#3461 branch, #3739, #3633, #1077, #2904, #425, #3546 and local workarounds listed in #2648) - Relinked with `--windows --to-intel --registry` No game files are shared, only log lines and draw parameters. AI-assisted (Claude Code).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#3832
No description provided.