-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
should fix Nvidia proprietary driver issues on XWayland
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,6 +5,8 @@ | |||||
using Silk.NET.OpenGL; | ||||||
#endif | ||||||
|
||||||
using BizHawk.Common; | ||||||
|
||||||
using static SDL2.SDL; | ||||||
|
||||||
namespace BizHawk.Bizware.Graphics | ||||||
|
@@ -16,16 +18,59 @@ public class SDL2OpenGLContext : IDisposable | |||||
{ | ||||||
static SDL2OpenGLContext() | ||||||
{ | ||||||
if (OSTailoredCode.IsUnixHost) | ||||||
{ | ||||||
// make sure that Linux uses the x11 video driver | ||||||
// we need this as mono winforms uses x11 | ||||||
// and the user could potentially try to force the wayland video driver via env vars | ||||||
SDL_SetHint("SDL_VIDEODRIVER", "x11"); | ||||||
// try to use EGL if it is available | ||||||
// GLX is the old API, and is the more or less "deprecated" at this point, and potentially more buggy with some drivers | ||||||
// we do need to a bit more work, in case EGL is not actually available or potentially doesn't have desktop GL support | ||||||
SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1"); | ||||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
CasualPokePlayer
Author
Member
|
new ExceptionBox(new Exception($"Initialization of OpenGL Display Method failed; falling back to {name}")).ShowDialog(); |
so
OpenGLVersion.SupportsVersion(3, 2)
is returning false
.
Unfortunately, it seems like removing the bundled copy of SDL2 doesn't help, not even if I apply https://patch-diff.githubusercontent.com/raw/libsdl-org/SDL/pull/10645.patch to the "system" copy.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
CasualPokePlayer
Sep 10, 2024
•
edited
Loading
Author
Member
edited
That's super strange regardless. The EGL context test specifically tries to create an OpenGL 3.2 context. Although it does end up skipping checking the version string to make sure it is actually >=3.2, so perhaps the driver is doing something bad and not creating a compatible context? Could you check what version string is being returned?
var versionString = gl.GetStringS(StringName.Version); |
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This commit broke the OpenGL display method for me. I'm not given a stacktrace, but removing this line
-SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1");
fixes it. edit: pushed 08bd14e
(Also, don't
throw new(...)
, and definitely don't throw in a static ctor.)