Skip to content

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

Closed

Description

@queeeef

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions