opengl: explicitly set EGL_SURFACE_TYPE

Co-authored-by: Daniel Kinzler <kinzler.daniel@gmail.com>
This commit is contained in:
Leah Amelia Chen
2026-09-17 22:07:14 +08:00
parent f9a3f24a56
commit ab34b8b131

View File

@@ -59,6 +59,11 @@ pub fn init(alloc: Allocator, opts: rendererpkg.Options) !OpenGL {
// Choose a config. We need a config that is renderable with
// OpenGL and a RGBA8 color buffer.
const config = egl.Config.choose(display, &.{
// EGL_SURFACE_TYPE defaults to EGL_WINDOW_BIT even though
// we are rendering exclusively through surfaceless mode.
// This is no problem on Mesa but we need to specify this
// explicitly for proprietary Nvidia drivers.
egl.c.EGL_SURFACE_TYPE, 0,
egl.c.EGL_RENDERABLE_TYPE, egl.c.EGL_OPENGL_BIT,
egl.c.EGL_RED_SIZE, 8,
egl.c.EGL_GREEN_SIZE, 8,