Disable VALIDATION_INDIRECT_CALL by default in release builds for wgpu#23879
Merged
mockersf merged 2 commits intobevyengine:mainfrom Apr 19, 2026
Merged
Conversation
JMS55
approved these changes
Apr 18, 2026
This comment was marked as resolved.
This comment was marked as resolved.
mockersf
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Improves performance in release builds by disabling
VALIDATION_INDIRECT_CALLwgpu instance default flag. Currently, even release builds have this validation enabled (link), causing unnecessary compute passes that add sometimes~13%CPU overhead in stress tests.Solution
Modified
crates/bevy_render/src/settings.rsto explicitly removeVALIDATION_INDIRECT_CALLin release builds. Users can still apply environment variable overrides by usingWGPU_VALIDATION_INDIRECT_CALL(link).This ensures:
WGPU_VALIDATION_INDIRECT_CALL=1environment variable.Testing
Tested on macOS with stress test scene:
cargo run --profile profiling --example many_materialsandcargo run --profile profiling --example many_shadow_lights -- -m 50 -l 50The improvement is visible when comparing release build with vs without
WGPU_VALIDATION_INDIRECT_CALL=1. The fix aligns the default with the expected behavior - validation enabled in debug, disabled in release.Tested on:
Profiling results before fix
It's clearly visible that
inject_validation_pass takes~13% CPU time.