mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
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:
parent
a6479c3d10
commit
d288891c77
1 changed files with 2 additions and 1 deletions
|
|
@ -434,7 +434,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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue