fix(wireframes): only set depth bias when topology is triangles#23782
Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom Apr 13, 2026
Merged
Conversation
alice-i-cecile
approved these changes
Apr 13, 2026
lmikoc
approved these changes
Apr 13, 2026
mate-h
pushed a commit
to mate-h/bevy
that referenced
this pull request
Apr 14, 2026
…engine#23782) # Objective - Fixes bevyengine#23772 - Fixes bevyengine#23774 - Fixes wireframe plugins. wgpu added some validation around `DepthBiasState`: ```rust if (ds.bias.is_enabled() || ds.bias.clamp != 0.0) && !desc.primitive.topology.is_triangles() { return Err(pipeline::CreateRenderPipelineError::DepthStencilState( pipeline::DepthStencilStateError::DepthBiasWithIncompatibleTopology( desc.primitive.topology, ), )); } ``` `ds.bias.is_enabled()` returns true if either `constant` and `slope_scale` are non zero values. This was causing the following error message when running the `2d_shapes` and `3d_shapes` examples (the following msg is for `3d_shapes`) ``` 2026-04-13T05:14:12.638678Z ERROR bevy_render::error_handler: Caught rendering error: Validation Error Caused by: In Device::create_render_pipeline, label = 'wireframe_3d_pipeline' Depth/stencil state is invalid Depth bias is not compatible with non-triangle topology LineList ``` ## Solution - Wireframe plugins should only set the depth bias’ `slope_scale` to a non-zero value if the topology *is* triangles. This complies with the validation done in wgpu. ## Testing - I can now turn on the wireframes in `cargo run --example 2d_shapes` and `cargo run --example 3d_shapes`
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
DepthBiasState:ds.bias.is_enabled()returns true if eitherconstantandslope_scaleare non zero values.This was causing the following error message when running the
2d_shapesand3d_shapesexamples (the following msg is for3d_shapes)Solution
slope_scaleto a non-zero value if the topology is triangles. This complies with the validation done in wgpu.Testing
cargo run --example 2d_shapesandcargo run --example 3d_shapes