Clear depth buffers in glUtil.clearOutputFrame.

[GL documentation for glClear](https://registry.khronos.org/OpenGL-Refpages/gl4/html/glClear.xhtml) says "If a buffer is not present, then a glClear directed at that buffer has no effect." so it's okay to clear the depth buffer even if there isn't one set.

Also manually tested to have no impact when contrast effect and dizzy crop effect form transformer demo was added to image/video input.

PiperOrigin-RevId: 516879598
This commit is contained in:
tofunmi 2023-03-15 18:21:18 +00:00 committed by Rohit Singh
parent e6343a34b8
commit ddbad57031

View file

@ -433,7 +433,8 @@ public final class GlUtil {
/** Fills the pixels in the current output render target with (r=0, g=0, b=0, a=0). */
public static void clearOutputFrame() throws GlException {
GLES20.glClearColor(/* red= */ 0, /* green= */ 0, /* blue= */ 0, /* alpha= */ 0);
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
GLES20.glClearDepthf(1.0f);
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
GlUtil.checkGlError();
}