Skip to content
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

Bevy render seems to be getting stuck on wgpu::SurfaceError::Outdated on linux while using glfw windowing backend #15312

Closed
Jakkestt opened this issue Sep 19, 2024 · 3 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@Jakkestt
Copy link

Bevy version

0.15.0-dev

Operating System: Arch Linux
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060/PCIe/SSE2
Manufacturer: ASUS

`AdapterInfo { name: "NVIDIA GeForce RTX 3060", vendor: 4318, device: 9476, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "560.35.03", backend: Vulkan }`

What you did

I am writing a custom windowing backend so that I could replace winit with glfw.

What went wrong

The window gets created and stuff gets rendered onto the window at the start, but after about 3 presents from the renderer, they just stop and the frame stays the same.

Additional information

The program does not hang. I found out that trigger_screenshots gets called pretty often (why?) and it still gets called just fine even though nothing new gets rendered onto the window. I also tested this on my M2 macbook air and the problem does not present itself. After I commented out the wgpu::SurfaceError::Outdated block that just warns the user once about the swap chain, the window started receiving new frames. What seems to be happening is that wgpu returns the SurfaceError::Outdated error and, because I am using an nvidia graphics card, bevy gets stuck in the branch where I get warned once about the swap chain and the surface never gets reconfigured for some reason. It could also be that the glfw window is just configured wrong, because this problem does not seem to occur while using winit.

@Jakkestt Jakkestt added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 19, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen O-Linux Specific to the Linux desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Sep 20, 2024
@alice-i-cecile
Copy link
Member

Can you reproduce this with wgpu alone? This is likely their bug :)

@Jakkestt
Copy link
Author

No, I cannot reproduce with wgpu. It could be that I am missing something, because the bevy_renderer code is so hard to follow, but it doesn't seem to be a problem in wgpu. I even updated wgpu from version 0.20 to 22.

@Jakkestt
Copy link
Author

Apparently I'm dumb. The problem goes away if I enable the wayland feature in glfw. The window is now getting new frames and you can resize the window without anything going wrong. Apparently the window is using XWayland or whatever. What is really strange though is that this wasn't an issue while using wgpu directly with glfw. The window was still using XWayland and it still was working properly.

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 C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

2 participants