diff options
-rw-r--r-- | video/out/opengl/common.c | 1 | ||||
-rw-r--r-- | video/out/opengl/common.h | 1 | ||||
-rw-r--r-- | video/out/opengl/context_wayland.c | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index 949c385a61..3d98d39381 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -143,6 +143,7 @@ static const struct gl_functions gl_functions[] = { .ver_core = 210, .provides = MPGL_CAP_ROW_LENGTH | MPGL_CAP_1D_TEX, .functions = (const struct gl_function[]) { + DEF_FN(DrawBuffer), DEF_FN(GetTexLevelParameteriv), DEF_FN(ReadBuffer), DEF_FN(TexImage1D), diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h index 38414fe18b..f89fcc953b 100644 --- a/video/out/opengl/common.h +++ b/video/out/opengl/common.h @@ -111,6 +111,7 @@ struct GL { void (GLAPIENTRY *ReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *); void (GLAPIENTRY *ReadBuffer)(GLenum); + void (GLAPIENTRY *DrawBuffer)(GLenum); void (GLAPIENTRY *DrawArrays)(GLenum, GLint, GLsizei); GLenum (GLAPIENTRY *GetError)(void); void (GLAPIENTRY *GetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint *); diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index e019f5fc8e..a7a8f4f3b4 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -144,6 +144,13 @@ static void egl_create_window(struct ra_ctx *ctx) } eglMakeCurrent(p->egl_display, p->egl_surface, p->egl_surface, p->egl_context); + // eglMakeCurrent may not configure the draw or read buffers if the context + // has been made current previously. On nvidia GL_NONE is bound because EGL_NO_SURFACE + // is used initially and we must bind the read and draw buffers here. + if(!p->gl.es) { + p->gl.ReadBuffer(GL_BACK); + p->gl.DrawBuffer(GL_BACK); + } eglSwapInterval(p->egl_display, 0); } |