From 21d7a83bfc1215c38827b003ac53f1abdf68f76f Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 29 Mar 2023 16:33:33 +0200 Subject: [PATCH] egldisplay: Fix GL_INVALID_OPERATION with headless pbuffer --- panda/src/egldisplay/eglGraphicsBuffer.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/panda/src/egldisplay/eglGraphicsBuffer.cxx b/panda/src/egldisplay/eglGraphicsBuffer.cxx index 2cfbff83b4..e1293fd52e 100644 --- a/panda/src/egldisplay/eglGraphicsBuffer.cxx +++ b/panda/src/egldisplay/eglGraphicsBuffer.cxx @@ -38,9 +38,10 @@ eglGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, DCAST_INTO_V(egl_pipe, _pipe); _pbuffer = EGL_NO_SURFACE; - // Since the pbuffer never gets flipped, we get screenshots from the same - // buffer we draw into. - _screenshot_buffer_type = _draw_buffer_type; + // EGL pbuffers only have a back buffer (see 2.2.2 in spec), and it is never + // flipped (eglSwapBuffers is a no-op). + _draw_buffer_type = RenderBuffer::T_back; + _screenshot_buffer_type = RenderBuffer::T_back; } /**