Open theunrealtarik opened 5 months ago
I just tested this with wgpu
v0.20 on a Windows laptop and I had the same exact issue FWIW. Here's my current device info:
device_type: IntegratedGpu
driver: "AMD proprietary driver"
driver_info: "23.11.1 (AMD proprietary shader compiler)"
backend: Vulkan
I'll test later in a different machine (with an NVIDIA card) but what I figured out is that if you do the following:
impl Plugin for GameSetupPlugin {
fn build(&self, app: &mut App) {
app.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
name: Some(String::from("cooktory")),
title: String::from("Cooktory"),
resolution: WindowResolution::new(600.0, 400.0),
present_mode: PresentMode::AutoVsync,
prevent_default_event_handling: false,
// Both Fullscreen and SizedFullscreen crash at startup:
mode: WindowMode::Fullscreen,
..Default::default()
}),
..Default::default()
}));
}
}
The app still crashes... Notice there was no need to toggle anything for the app to panic.
Seems like configure_surface()
in bevy_render
's src/renderer/render_device.rs
is failing and, as far as I could see, this function panics if:
SurfaceTexture
is still alive referencing an old surface.Assuming there's no way a wrong texture format is chosen, and that the Window does have a size, can we narrow this down to the first bullet point?
The issue here is that newer AMD drivers (and newer Nvidia drivers, idk about Intel) are giving us a dxgi flip mode swapchain on Windows, which doesn't support exclusive fullscreen.
Use borderless (there's no additional latency with dxgi flip mode swapchains in borderless fullscreen compared to the old exclusive fullscreen, and they have less latency than the legacy swapchain in windowed mode).
Bevy version
Relevant system information
What you did
All what I've tried to do is set my app's primary window mode to fullscreen as follows:
What went wrong
I was simply expecting to have a fullscreen window but everytime I hit F11 to do so the app crashes entirely spitting the following error:
Additional information
I've tried to run the compiled debug binary on my laptop (hardware information are listed down below) and everything worked flawlessly.
I thought the issue is AMD related but I found an open issue from the official Bevy's repository #3225 and an other one from the gfx-rs/wgpu #2519, the graphics API Bevy renderer uses as far as I know, which both users seamingly have a Nvidia GPU.