The gl.clear depends on the ability to write into the stencil or depth buffer. This is controlled by the corresponding write masks (gl.depthMask and gl.stencilMask), that weren’t correctly reset after each entity. This caused a bug: if the last entity disables writing to the depth or the stencil buffers, then this prevents the corresponding buffer from being cleared for the next frame.
This pr properly resets the depth and stencil masks. The depth mask is set to true. The stencil mask is set to the initial value, because it is a bit mask and different browsers have different number of stencil bits.
The
gl.clear
depends on the ability to write into the stencil or depth buffer. This is controlled by the corresponding write masks (gl.depthMask
andgl.stencilMask
), that weren’t correctly reset after each entity. This caused a bug: if the last entity disables writing to the depth or the stencil buffers, then this prevents the corresponding buffer from being cleared for the next frame.This pr properly resets the depth and stencil masks. The depth mask is set to
true
. The stencil mask is set to the initial value, because it is a bit mask and different browsers have different number of stencil bits.