Skip to content

winemetal: validate render draw state before encoding #756

Description

@moreaki

Problem

The winemetal render encoder can currently reach Metal draw calls after earlier state setup failed or when indexed draw buffers/ranges are invalid.

On macOS/Arm this matters while working on the DXMT path because shader or pipeline creation failures can leave the command stream without a valid render pipeline state. Sending such commands to Metal turns a recoverable guest rendering problem into an Objective-C Metal validation exception and VM process crash. Invalid indexed draw buffer state has the same shape: the encoder should reject the draw before calling into Metal.

Proposed fix

Add defensive validation at the winemetal render command boundary:

  • track whether the encoder currently has a valid render pipeline state
  • skip draw calls when no valid pipeline state is active
  • validate indexed draw index buffer presence, type, offset, count, and total range
  • validate indirect indexed draw argument buffer offset and size before encoding

Validation

Signed-off-by: Roberto Nibali rnibali@gmail.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions