Skip to content

Fix debug_assert in dx12 indirect multi draw - #9332

Merged
ErichDonGubler merged 1 commit into
gfx-rs:trunkfrom
kristoff3r:ks/indirect_stride
Mar 31, 2026
Merged

Fix debug_assert in dx12 indirect multi draw#9332
ErichDonGubler merged 1 commit into
gfx-rs:trunkfrom
kristoff3r:ks/indirect_stride

Conversation

@kristoff3r

@kristoff3r kristoff3r commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Connections
Fixes #7955 (and bevyengine/bevy#23220)

Description
The stride validation was calculated incorrectly in dx12. I fixed it by refactoring a bit to make it more clear that the strides can differ, and that the destination stride is backend dependent.

Testing
I refactored the existing draw_indirect test to also cover multi draw, and I tested it without the fix on my Windows and could reproduce the issue. I'm not sure if this is the testing you had in mind.

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@ErichDonGubler ErichDonGubler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@ErichDonGubler ErichDonGubler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we merge, will you please add a CHANGELOG entry? 🙏🏻

@kristoff3r

Copy link
Copy Markdown
Contributor Author

Before we merge, will you please add a CHANGELOG entry? 🙏🏻

Done!

@ErichDonGubler ErichDonGubler self-assigned this Mar 31, 2026
@ErichDonGubler ErichDonGubler added backend: dx12 Issues with DX12 or DXGI type: bug Something isn't working area: correctness We're behaving incorrectly labels Mar 31, 2026
@ErichDonGubler
ErichDonGubler merged commit fd04edc into gfx-rs:trunk Mar 31, 2026
59 of 62 checks passed
@cwfitzgerald cwfitzgerald added the PR: needs back-porting PR with a fix that needs to land on crates label Apr 1, 2026
cwfitzgerald pushed a commit to cwfitzgerald/wgpu that referenced this pull request May 1, 2026
@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label May 1, 2026
slyedoc pushed a commit to slyedoc/wgpu that referenced this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: correctness We're behaving incorrectly backend: dx12 Issues with DX12 or DXGI type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debug assertion fail on DX12 due to miscalculated indirect draw arg stride

3 participants