Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Wrong Instanced call used for DrawInstanced in CommandList.Direct3D.cs #2482

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

kopffarben
Copy link
Contributor

PR Details

Small fix in CommandList.Direct3D.cs

CommandList.DrawInstanced(Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0) call DrawIndexedInstancedIndirect instead of DrawInstancedIndirect

public void DrawInstanced(Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0)
{
    if (argumentsBuffer == null) throw new ArgumentNullException("argumentsBuffer");

    PrepareDraw();

    // was DrawIndexedInstancedIndirect( ... ) but should be DrawInstancedIndirect( ... )
    NativeDeviceContext.DrawInstancedIndirect(argumentsBuffer.NativeBuffer, alignedByteOffsetForArgs);

    GraphicsDevice.FrameDrawCalls++;
}

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

CommandList.DrawInstanced(Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0)
NativeDeviceContext was DrawIndexedInstancedIndirec but should be DrawInstancedIndirect
@kopffarben
Copy link
Contributor Author

@dotnet-policy-service agree

@Eideren Eideren merged commit 4c46fdc into stride3d:master Oct 9, 2024
2 checks passed
@Eideren
Copy link
Collaborator

Eideren commented Oct 9, 2024

Makes sense, thanks for the contribution @kopffarben !

@Eideren Eideren changed the title Small fix in CommandList.Direct3D.cs fix: Wrong Instanced call used for DrawInstanced in CommandList.Direct3D.cs Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants