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