Skip to content

Use surface.get_preferred_format() to prevent crashes on wayland with nvidia cards. #4995

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 Jun 12, 2022 · 2 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

Comments

@heavyrain266
Copy link

What problem does this solve or what need does it fill?

Currently bevy usee hardcoded sRGB surface format which is not (yet) supported by nvidia on linux.

What solution would you like?

Straight forward solution is to request GPUs' prefered surface format which will use best available on each platform.

What alternative(s) have you considered?

Perhaps we could wait months or even years until nvidia decides on adding sRGB support on Wayland.

Additional context

None.

@heavyrain266 heavyrain266 added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jun 12, 2022
@bjorn3
Copy link
Contributor

bjorn3 commented Jun 12, 2022

Straight forward solution is to request GPUs' prefered surface format which will use best available on each platform.

Doing so correctly will require adding code to convert from sRGB to whichever colorspace said surface format uses, which isn't straight forward in the general case.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen O-Linux Specific to the Linux desktop operating system and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jun 12, 2022
@heavyrain266 heavyrain266 changed the title Use surface.get_preferrred_format() to prevent crashes on wayland with nvidia cards. Use surface.get_preferred_format() to prevent crashes on wayland with nvidia cards. Jun 13, 2022
@johanhelsing
Copy link
Contributor

We no longer crash, but randomly choose the first available format the compositor reports. Explained in f5322cd. On proprietary nvidia drivers on wayland, this results in ARGB8888, which means all the colors are too dark, see #7318

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
Projects
None yet
Development

No branches or pull requests

4 participants