internal/egl: replace glFinish with eglWaitClient

glFinish depends on package gl which is about to require a function
pointer loader. eglWaitClient is in the EGL API and always available.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-05-15 11:04:06 +02:00
parent 1d4bf04aa1
commit e90c99a66c
3 changed files with 11 additions and 8 deletions
+6
View File
@@ -40,6 +40,7 @@ var (
_eglSwapBuffers = libEGL.NewProc("eglSwapBuffers")
_eglTerminate = libEGL.NewProc("eglTerminate")
_eglQueryString = libEGL.NewProc("eglQueryString")
_eglWaitClient = libEGL.NewProc("eglWaitClient")
)
var loadOnce sync.Once
@@ -156,6 +157,11 @@ func eglQueryString(disp _EGLDisplay, name _EGLint) string {
return syscall.BytePtrToString((*byte)(unsafe.Pointer(r)))
}
func eglWaitClient() bool {
r, _, _ := _eglWaitClient.Call()
return r != 0
}
// issue34474KeepAlive calls runtime.KeepAlive as a
// workaround for golang.org/issue/34474.
func issue34474KeepAlive(v interface{}) {