Skip to content

DXMT D3D10 DrawIndexedInstanced forwards StartIndexLocation as StartInstanceLocation #760

Description

@moreaki

Problem

The bundled DXMT D3D10 wrapper forwards the wrong final argument when mapping MTLD3D10Device::DrawIndexedInstanced to the underlying D3D11 context.

Current code passes StartIndexLocation twice:

d3d11_context_->DrawIndexedInstanced(
    IndexCountPerInstance, InstanceCount, StartIndexLocation, BaseVertexLocation, StartIndexLocation
);

The D3D10 and D3D11 declarations both define the final argument as StartInstanceLocation.

Deterministic reproduction

Call the wrapper with distinct values:

StartIndexLocation    = 6
StartInstanceLocation = 2

Current source forwards 6 as the D3D11 base instance. The required value is 2.

Minimal fix

Replace only the final forwarded argument with StartInstanceLocation. PR: #761.

Impact

A D3D10 indexed instanced draw can otherwise select incorrect instance IDs or per-instance vertex data whenever the start index and start instance differ.

Validation

  • Reproduced directly 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.

The corresponding DXMT upstream report/fix was tracked as 3Shain/dxmt#188 and 3Shain/dxmt#189; this issue tracks VirtualBox's bundled copy.

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