Skip to content

DXMT: keep indexed draw base vertex signed #754

Description

@moreaki

Problem

The bundled DXMT indexed-draw path carries the signed D3D base vertex through two unsigned command fields:

  • DXMT_DRAW_INDEXED_ARGUMENTS::BaseVertex
  • wmtcmd_render_draw_indexed::base_vertex

D3D11's BaseVertexLocation and Metal's indexed-draw baseVertex argument are both signed; negative base vertices are valid.

Deterministic reproduction

Use BaseVertexLocation = -1 in DrawIndexed or DrawIndexedInstanced.

The D3D11 entry point receives signed -1, but the current intermediate fields store 0xffffffff. When the winemetal field is passed to Metal's signed baseVertex parameter, it is promoted as positive 4294967295 rather than -1.

Minimal fix

Change only the two intermediate fields from uint32_t to int32_t. Both types are 32 bits, so the command layout is unchanged while signed promotion is restored.

PR: #758

Validation

  • Reproduced by following the exact source path on current origin/main (5ac81eda).
  • git diff --check passes.
  • kmk VBoxDxMt succeeds with LLVM 15.0.7 on top of the build prerequisite in DXMT: fix the supported LLVM 15 build #748.
  • The clean integrated macOS/Arm full build completes and produces VBoxDxMt.dylib.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions