bevy/crates/bevy_render
Eero Lehtinen af279073aa
Fix linux nvidia + xwayland freeze at startup (#16123)
# Objective

- Fixes #16122

When the wayland feature is not enabled, xwayland is used on wayland.
Nvidia drivers are somewhat bugged on linux and return outdated surfaces
on xwayland for seemingly no reason. Oftentimes at startup we get into
an infine loop where the surface is permanently outdated and nothing (or
sometimes only the first frame) is drawn on the screen.

## Solution

After experimenting I found that we can safely call configure again and
the issue seems to resolve itsef. After this change I couldn't reproduce
the original issue after many tries. More testing is probably needed
though.

The main issue is that `get_current_texture` fails sometimes because the
surface remains outdated even after configuring. It would be better to
just properly handle and never panic when `get_current_texture` fails.
This way we always call configure when outdated and bail when getting
the swapchain fails instead of crashing. The number of special cases is
also reduced.

## Testing

I tested the example "rotation" manually by trying to move around.

It works with X11 and Xwayland and the non panicing code paths didn't
change so other platforms aren't affected.
2024-10-28 22:17:59 +00:00
..
macros Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
src Fix linux nvidia + xwayland freeze at startup (#16123) 2024-10-28 22:17:59 +00:00
Cargo.toml Move ImageLoader and CompressedImageSaver to bevy_image. (#15812) 2024-10-15 02:18:10 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Render

License Crates.io Downloads Docs Discord