1
0
Fork 0

cogl/clip-stack: Explicitely initialize the stencil mask

We need the stencil buffer to consist of binary values of 0 and 1
because we're doing additions and subtractions on the buffer, so even
though this is the default, explicitely set the stencil mask to 0x1.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
This commit is contained in:
Jonas Dreßler 2020-02-26 17:21:09 +01:00 committed by Carlos Garnacho
parent 72054332c5
commit 1e0b015ce8

View file

@ -98,6 +98,7 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer,
else
{
GE( ctx, glEnable (GL_STENCIL_TEST) );
GE( ctx, glStencilMask (0x1) );
/* Initially disallow everything */
GE( ctx, glClearStencil (0) );
@ -155,8 +156,6 @@ add_stencil_clip_region (CoglFramebuffer *framebuffer,
- framebuffer->viewport_y,
0);
GE( ctx, glEnable (GL_STENCIL_TEST) );
GE( ctx, glColorMask (FALSE, FALSE, FALSE, FALSE) );
GE( ctx, glDepthMask (FALSE) );
@ -167,6 +166,9 @@ add_stencil_clip_region (CoglFramebuffer *framebuffer,
}
else
{
GE( ctx, glEnable (GL_STENCIL_TEST) );
GE( ctx, glStencilMask (0x1) );
/* Initially disallow everything */
GE( ctx, glClearStencil (0) );
GE( ctx, glClear (GL_STENCIL_BUFFER_BIT) );