jakobhellermann / bevy_editor_pls

In-App editor tools for bevy applications
Other
758 stars 78 forks source link

Panic when trying to place the editor in a separate window #114

Open maxdeviant opened 1 month ago

maxdeviant commented 1 month ago

I am seeing a panic when trying to run the editor in a separate window:

2024-10-06T15:32:20.193418Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 14.4 ", kernel: "23.4.0", cpu: "Apple M3 Max", core_count: "16", memory: "128.0 GiB" }
2024-10-06T15:32:20.243780Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M3 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2024-10-06T15:32:20.351458Z  INFO bevy_winit::system: Creating new window "Editor" (Entity { index: 1, generation: 1 })
2024-10-06T15:32:20.381769Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-10-06T15:32:20.389226Z  INFO bevy_editor_pls_default_windows::cameras: Spawning editor cameras
2024-10-06T15:32:20.494418Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread '<unnamed>' panicked at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(2, 1, Metal)>`
    In a set_viewport command
    Viewport has invalid rect Rect { x: 1501.0, y: 92.0, w: 5120.0, h: 2880.0 }; origin and/or size is less than or equal to 0, and/or is not contained in the render target (5120, 2880, 1)

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::renderer::render_system`!

I then tried to run the separate window example and received a panic (albeit with a slightly different error):

2024-10-06T15:33:50.037678Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M3 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2024-10-06T15:33:50.105786Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 1, generation: 1 })
2024-10-06T15:33:50.124070Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-10-06T15:33:50.128001Z  INFO bevy_editor_pls_default_windows::cameras: Spawning editor cameras
2024-10-06T15:33:50.654086Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread 'main' panicked at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(2, 1, Metal)>`
    In a set_viewport command
    Viewport has invalid rect Rect { x: 1501.0, y: 92.0, w: 2560.0, h: 1440.0 }; origin and/or size is less than or equal to 0, and/or is not contained in the render target (2560, 1440, 1)

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::renderer::render_system`!

This is on macOS Sonoma 14.4 (23E214), Rust 1.81.0, with bevy_editor_pls at 62cc9aa5b55e6c6050911f0a61fce567617ad78a.