From 936696afcfc99100cbc4026b8d9dba794ff11602 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Thu, 20 May 2021 18:42:28 +0800 Subject: [PATCH] cogl/winsys-glx: Request 2 stencil bits Just like we do on EGL. Two bits are required because `cogl-clip-stack-gl.c` needs each stencil buffer element to be able to count from 0 to 2. This mistake probably went unnoticed because: * Drivers usually provide more than 1 anyway; and * Optimizations in `cogl-clip-stack-gl.c` avoid calling the code that needs to count past 1 in most cases. Part-of: --- cogl/cogl/winsys/cogl-winsys-glx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogl/cogl/winsys/cogl-winsys-glx.c b/cogl/cogl/winsys/cogl-winsys-glx.c index a2cb5c548..a8453dd48 100644 --- a/cogl/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/cogl/winsys/cogl-winsys-glx.c @@ -533,7 +533,7 @@ glx_attributes_from_framebuffer_config (CoglDisplay *display, attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1; attributes[i++] = GLX_STENCIL_SIZE; - attributes[i++] = config->need_stencil ? 1: GLX_DONT_CARE; + attributes[i++] = config->need_stencil ? 2 : 0; if (config->stereo_enabled) { attributes[i++] = GLX_STEREO;