Added some more codes.
Of course, the stencil mask restored to ~0x00 after the drawing. And I checked the value was default.
I feel this is a bug of Pi(brcm) or Mesa.
I have no idea how I can resolve this issue.
I'm a quite newbie for PI and not an expert for opengl stuffs. But I feel glStencilMask is not working on an app to test stencil. Could you check this is a bug or known issue or some misunderstanding? *Environment Raspberry PI 3 Mesa 12.0.2 DRI - vc4_dri * Symptom Stencil buffer is updated by glSten...