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>
This commit is contained in:
Daniel van Vugt 2021-05-20 18:42:28 +08:00
parent 216bb7f960
commit 936696afcf

View File

@ -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;