[mutter] cogl/winsys-glx: Request 2 stencil bits



commit 936696afcfc99100cbc4026b8d9dba794ff11602
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Thu May 20 18:42:28 2021 +0800

    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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1873>

 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 a2cb5c548f..a8453dd48e 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]