Skip to content

Setting fullscreen mode at runtime leads to crash in 0.7 and main #4671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
heavyrain266 opened this issue May 5, 2022 · 5 comments
Closed
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash P-Regression Functionality that used to work but no longer does. Add a test for this!

Comments

@heavyrain266
Copy link

heavyrain266 commented May 5, 2022

Bevy version

0.7 and main branch with latest commit

Operating system & version

Windows 11,
Arch Linux,
macOS 12 Stopped crashing after reboot

What you did

Moved to bevy 0.7 to create new game and wanted to use fullscreen system from 0.6

fn fullscreeen(
    input: Res<Input<KeyCode>>,
    mut windows: ResMut<Windows>,
) {
    let window = windows
        .get_primary_mut()
        .unwrap();

    if input.pressed(KeyCode::LAlt) && input.just_pressed(KeyCode::Return) {
        if window.mode() == WindowMode::Windowed {
            window.set_mode(WindowMode::Fullscreen);
        } else {
            window.set_mode(WindowMode::Windowed);
        }
    }
}

What you expected to happen

Bevy should set fullscreen mode properly instead of crashing

What actually happened

When you press LAlt + Enter, bevy tries to set fullscreen and crashes like on included GIF from Windows 11

Additional information

None

@heavyrain266 heavyrain266 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 5, 2022
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in P-Regression Functionality that used to work but no longer does. Add a test for this! P-Crash A sudden unexpected crash and removed S-Needs-Triage This issue needs to be labelled labels May 5, 2022
@alice-i-cecile alice-i-cecile added this to the Bevy 0.8 milestone May 5, 2022
@alice-i-cecile
Copy link
Member

We should have a test like in #3597 to avoid regressions of this sort.

@DJMcNab
Copy link
Member

DJMcNab commented May 5, 2022

Cannot reproduce on Windows 10. You might need to install the vulkan validations layers - the exit code in your gif looks similar to other vulkan issues I've seen.

Can you reproduce this in wgpu's examples?

@rparrett
Copy link
Contributor

rparrett commented May 5, 2022

I am unable to reproduce on MacOS 12.2/m1. Although I did get to witness rust-windowing/winit#2050 or something very similar when switching back to windowed mode.

@heavyrain266
Copy link
Author

heavyrain266 commented May 5, 2022

Can you reproduce this in wgpu's examples?

Nope, I have installed full Vulkan 1.3 SDK which I'm using daily and wgpu examples works fine

After switching backends to DirectX 12 with WgpuSettings works fine, seems to be Vulkan specific, mayby too new SDK version and bevy uses some features through wgpu which were deprecated/changed between 1.1 (used by wgpu) and 1.3

However I'm unable to downgrade Vulkan SDK because one of my programs uses dynamic rendering and other 1.3 specific features

@alice-i-cecile alice-i-cecile removed this from the Bevy 0.8 milestone May 6, 2022
@heavyrain266
Copy link
Author

So, Im closing it as bug caused by upstream Vulka SDK version regression between wgpu and local one, I think we should put note somewhere about required SDK version to prevent future bug reports like this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash P-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

No branches or pull requests

4 participants