From fc73ae2efaf79638042683ae3025a1bd00618d8f Mon Sep 17 00:00:00 2001 From: Steven Behnke Date: Tue, 30 Nov 2021 10:36:55 -0600 Subject: [PATCH] Reset stencil mask prior to clear. This fixes a crash on LG ThinQ V60 (LM-V600). From libEGL.so eglSwapBuffers() the libGLESv2_adreno.so causes a segmentation violation (invalid memory reference) without first performing the recommended step of setting the stencil mask back to 0xff. --- cocos/renderer/backend/opengl/CommandBufferGL.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/renderer/backend/opengl/CommandBufferGL.cpp b/cocos/renderer/backend/opengl/CommandBufferGL.cpp index e7ecfe05f9c4..cdf79f485f6d 100644 --- a/cocos/renderer/backend/opengl/CommandBufferGL.cpp +++ b/cocos/renderer/backend/opengl/CommandBufferGL.cpp @@ -275,6 +275,7 @@ void CommandBufferGL::applyRenderPassDescriptor(const RenderPassDescriptor& desc if (descirptor.needClearStencil) { mask |= GL_STENCIL_BUFFER_BIT; + glStencilMask(0xff); glClearStencil(descirptor.clearStencilValue); }