Skip to content

Wireframe not rendering properly for the example demo #18858

@Alaz-Oz

Description

@Alaz-Oz

Bevy version

0.15.3

[Optional] Relevant system information

System: MacBook Air M1, Sequoia 15.4
Rust: cargo 1.84.1 (66221abde 2024-11-19)
RunMode: Native

Adapter Info:

2025-04-16T05:14:04.727429Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 15.4 ", kernel: "24.4.0", cpu: "Apple M1", core_count: "8", memory: "8.0 GiB" }
2025-04-16T05:14:04.830892Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M1", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }

What you did

I ran the 2d-rendering/2d-shapes example native on my system1.

How

  • I created a cargo project cargo new project
  • I copied the code
  • Pasted it in src/main.rs
  • Ran it using cargo run

Cargo.toml

# Enable a small amount of optimization in the dev profile.
[profile.dev]
opt-level = 1

# Enable a large amount of optimization in the dev profile for dependencies.
[profile.dev.package."*"]
opt-level = 3

# Enable more optimization in the release profile at the cost of compile time.
[profile.release]
# Compile the entire crate as one unit.
# Slows compile times, marginal improvements.
codegen-units = 1
# Do a second optimization pass over the entire program, including dependencies.
# Slows compile times, marginal improvements.
lto = "thin"

# Optimize for size in the wasm-release profile to reduce load times and bandwidth usage on web.
[profile.wasm-release]
# Default to release profile values.
inherits = "release"
# Optimize with size in mind (also try "z", sometimes it is better).
# Slightly slows compile times, great improvements to file size and runtime performance.
opt-level = "s"
# Strip all debugging information from the binary to slightly reduce file size.
strip = "debuginfo"

What went wrong

The example works, But when I press space for enabling wireframe, then for some runs it works correctly other-times it shows only border.

  • I was expecting it to render the same way every time I run that.
  • It renders only as border for some run.

Note

The bug happens for some run, and when it does, it will continue to work like that no matter how much I enable and disable it for that run using space.

Additional information

Maybe parallelism is the culprit here, for some runs, the wireframe renders before the actual shapes, causing the wireframe to go behind the shape, and only border to be visible at the edges.

Without Wireframe
Image

With wireframe: [BUGGED]
Image

With wireframe: Working correctly
Image

Footnotes

  1. System: MacBook Air M1, Sequoia 15.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-BugAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions