mcst-linux-kernel/patches-2024.06.26/gl4es-1.1.4/0033-Revert-to-make-double-...

58 lines
2.4 KiB
Diff

From b05be536248326ec5f2f26371e59f7e4c47f14ef Mon Sep 17 00:00:00 2001
From: ptitSeb <sebastien.chev@gmail.com>
Date: Thu, 8 Oct 2020 15:02:43 +0200
Subject: [PATCH 033/233] Revert to make double buffer default again, and
fixing LIBGL_FB=3 that was broken
---
src/glx/glx.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/glx/glx.c b/src/glx/glx.c
index 72a7626a..8bd8e37b 100755
--- a/src/glx/glx.c
+++ b/src/glx/glx.c
@@ -273,9 +273,9 @@ static int get_config_default(Display *display, int attribute, int *value) {
case GLX_USE_GL:
case GLX_RGBA:
case GLX_X_RENDERABLE:
+ case GLX_DOUBLEBUFFER:
*value = 1;
break;
- case GLX_DOUBLEBUFFER:
case GLX_LEVEL:
case GLX_STEREO:
*value = 0;
@@ -615,7 +615,7 @@ GLXContext gl4es_glXCreateContext(Display *display,
default_glxfbconfig.alphaBits = (visual==0)?0:(visual->depth!=32)?0:8;
default_glxfbconfig.depthBits = 16;
default_glxfbconfig.stencilBits = 8;
- default_glxfbconfig.doubleBufferMode = 0;
+ default_glxfbconfig.doubleBufferMode = 1;
}
int depthBits = glxfbconfig->depthBits;
if(glxfbconfig->stencilBits>8)
@@ -1233,15 +1233,17 @@ Bool gl4es_glXMakeCurrent(Display *display,
egl_eglQuerySurface(eglDisplay,eglSurf,EGL_WIDTH,&Width);
egl_eglQuerySurface(eglDisplay,eglSurf,EGL_HEIGHT,&Height);
+ DBG(printf("New surface %p is %dx%d\n", eglSurf, Width, Height);)
addPixBuffer(display, eglSurf, eglConfig, Width, Height, eglCtx, drawable, depth, 2);
context->eglSurface = eglSurf;
- if(context->eglContext && context->eglContext!=eglContext) {
+ if(context->eglContext && context->eglContext!=eglCtx) {
// remove old context before putting PBuffer specific one
LOAD_EGL(eglDestroyContext);
+ DBG(printf("Remove old Cotnext %p, new is %p\n", context->eglContext, eglCtx);)
egl_eglDestroyContext(eglDisplay, context->eglContext);
}
- context->eglContext = eglContext;
+ context->eglContext = eglCtx;
// update, that context is a created emulated one...
created = isPBuffer(drawable);
} else
--
2.11.0