Skip to content

bevy_render: Do not remove VALIDATION_INDIRECT_CALL if Backends contains DX12#24129

Merged
alice-i-cecile merged 6 commits intobevyengine:mainfrom
kfc35:24117_validation_redux_2
May 6, 2026
Merged

bevy_render: Do not remove VALIDATION_INDIRECT_CALL if Backends contains DX12#24129
alice-i-cecile merged 6 commits intobevyengine:mainfrom
kfc35:24117_validation_redux_2

Conversation

@kfc35
Copy link
Copy Markdown
Contributor

@kfc35 kfc35 commented May 4, 2026

Objective

Solution

  • The flag is supposedly necessary for DX12 in wgpu. Add some additional conditions for removing VALIDATION_INDIRECT_CALL, and add a comment about it.

Testing

(Just decided to remake the PR after main was force pushed)

@kfc35 kfc35 requested a review from JMS55 May 4, 2026 23:47
@kfc35 kfc35 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen O-DX12 Specific to the DX12 render API D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 4, 2026
@kfc35 kfc35 added this to the 0.19 milestone May 4, 2026
@cart cart closed this May 5, 2026
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering May 5, 2026
@cart cart reopened this May 5, 2026
@github-project-automation github-project-automation Bot moved this from Done to Needs SME Triage in Rendering May 5, 2026
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Terrible stuff. Good fix though! Thanks for the clear comment and sleuthing.

@JMS55
Copy link
Copy Markdown
Contributor

JMS55 commented May 5, 2026

This is unfortunate in that even if you use Vulkan and not DirectX, it still does the validation :/. Oh well though.

Comment thread crates/bevy_render/src/settings.rs Outdated
@djeedai
Copy link
Copy Markdown
Contributor

djeedai commented May 5, 2026

Please add a flag to remove the validation. I'd gladly lose any feature over having that nonsense. I've argued countless times with the wgpu team, they ignored or closed my issues. Please let the user access the flags and let them disable that validation layer, it absolutely destroys any attempt at optimizing compute workloads. I know it breaks some DX12 feature and again I'd gladly lose that feature (which can be worked around) rather than have wgpu inject useless compute dispatches which mess with bound resources, not even in a clever way (they let you bind your resources, they overwrite the bindings, inject the dispatch, and rebind your resources a second time).

@beicause
Copy link
Copy Markdown
Member

beicause commented May 5, 2026

Can DX12 only be used on Windows? If so we can always remove the validation on non-windows platforms.

@mockersf
Copy link
Copy Markdown
Member

mockersf commented May 5, 2026

I'd gladly lose any feature over having that nonsense.

The feature lost here is... transforms

@kfc35
Copy link
Copy Markdown
Contributor Author

kfc35 commented May 5, 2026

Can DX12 only be used on Windows? If so we can always remove the validation on non-windows platforms.

I was not sure about this, but since the problem is specific to DX-12, I don’t want to encode that assumption unless we are in general OK with tying those two together.

@djeedai
Copy link
Copy Markdown
Contributor

djeedai commented May 5, 2026

I'd gladly lose any feature over having that nonsense.

The feature lost here is... transforms

It's relatively easy to work around the limitations of firstInstance with push constants (immediate constants) on DX12. And you don't need it on other backends. Unless there's another limitation?

@JMS55
Copy link
Copy Markdown
Contributor

JMS55 commented May 6, 2026

Good enough for now.

@JMS55 JMS55 requested a review from alice-i-cecile May 6, 2026 01:11
Copy link
Copy Markdown
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

I'm not a fan of the unwrap in the if. Also, please use DX12 not dx-12 in the comments.

@kfc35 kfc35 changed the title bevy_render: Do not remove VALIDATION_INDIRECT_CALL if Backends contains DX-12 bevy_render: Do not remove VALIDATION_INDIRECT_CALL if Backends contains DX12 May 6, 2026
@kfc35 kfc35 requested a review from IceSentry May 6, 2026 01:45
@alice-i-cecile
Copy link
Copy Markdown
Member

@kfc35 says that these flags should be configurable by the user already, which matches my read of the code. I don't think any extra configuration logic is warranted as a result.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 6, 2026
@alice-i-cecile alice-i-cecile removed this pull request from the merge queue due to a manual request May 6, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 6, 2026
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 6, 2026
Merged via the queue into bevyengine:main with commit 53f1bce May 6, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples O-DX12 Specific to the DX12 render API S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Windows Examples have misplaced transforms

8 participants