Skip to content

DXMT: forward D3D10 start instance location#761

Open
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/dxmt-d3d10-start-instance-fix
Open

DXMT: forward D3D10 start instance location#761
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/dxmt-d3d10-start-instance-fix

Conversation

@moreaki

@moreaki moreaki commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Forward the D3D10 DrawIndexedInstanced start-instance argument to the underlying D3D11 context.

The patch changes one argument at the wrapper boundary: the final D3D11 parameter now uses the incoming StartInstanceLocation rather than repeating StartIndexLocation.

Deterministic reproduction

Call the D3D10 wrapper with distinct values, for example:

StartIndexLocation    = 6
StartInstanceLocation = 2

Current code calls the D3D11 context with final argument 6; the D3D10 and D3D11 method declarations both specify that the final argument is the start-instance location, so the forwarded value must be 2. The one-line patch makes that mapping exact.

Impact

D3D10 indexed instanced draws with a non-zero start instance can otherwise use the start-index value as the base instance, selecting incorrect instance IDs or per-instance vertex data.

Validation

  • Rebased independently on current origin/main (5ac81eda).
  • git diff --check passes.
  • Applied on top of the LLVM 15 build prerequisite from DXMT: fix the supported LLVM 15 build #748 and built kmk VBoxDxMt on macOS/Arm with LLVM 15.0.7.
  • Included in the clean integrated macOS/Arm full build, which completed with exit 0 and produced VBoxDxMt.dylib.

Closes #760.

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

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jul 8, 2026
@moreaki

moreaki commented Jul 9, 2026

Copy link
Copy Markdown
Author

DXMT v0.80 audit update:

Updating the vendored DXMT tree to v0.80 would not address this. DXMT v0.80 and current DXMT main still pass StartIndexLocation as the final D3D11 DrawIndexedInstanced argument from the D3D10 wrapper.

I opened the equivalent upstream DXMT issue and PR:

Signed-off-by: Roberto Nibali <rnibali@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DXMT D3D10 DrawIndexedInstanced forwards StartIndexLocation as StartInstanceLocation

1 participant