Add utility for deleting sync object without throwing

PiperOrigin-RevId: 547138887
This commit is contained in:
andrewlewis 2023-07-11 11:28:27 +01:00 committed by Rohit Singh
parent 9b06da8174
commit f657fa8048

View file

@ -407,6 +407,12 @@ public final class GlUtil {
checkGlError();
}
/** Releases the GL sync object if set, suppressing any error. */
public static void deleteSyncObjectQuietly(long syncObject) {
// glDeleteSync ignores a 0-valued sync object.
GLES30.glDeleteSync(syncObject);
}
/**
* Ensures that following commands on the current OpenGL context will not be executed until the
* sync point has been reached. If {@code syncObject} equals {@code 0}, this does not block the