diff options
Diffstat (limited to 'vendor/golang.org/x/mobile/gl')
-rw-r--r-- | vendor/golang.org/x/mobile/gl/gl.go | 13 | ||||
-rw-r--r-- | vendor/golang.org/x/mobile/gl/gldebug.go | 1 | ||||
-rw-r--r-- | vendor/golang.org/x/mobile/gl/types_debug.go | 1 | ||||
-rw-r--r-- | vendor/golang.org/x/mobile/gl/types_prod.go | 1 | ||||
-rw-r--r-- | vendor/golang.org/x/mobile/gl/work.c | 3 | ||||
-rw-r--r-- | vendor/golang.org/x/mobile/gl/work.go | 31 | ||||
-rw-r--r-- | vendor/golang.org/x/mobile/gl/work.h | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/mobile/gl/work_other.go | 1 |
8 files changed, 32 insertions, 21 deletions
diff --git a/vendor/golang.org/x/mobile/gl/gl.go b/vendor/golang.org/x/mobile/gl/gl.go index 95f7468..195a309 100644 --- a/vendor/golang.org/x/mobile/gl/gl.go +++ b/vendor/golang.org/x/mobile/gl/gl.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || linux || openbsd || windows) && !gldebug // +build darwin linux openbsd windows // +build !gldebug @@ -1284,6 +1285,14 @@ func (ctx *context) TexImage2D(target Enum, level int, internalFormat int, width } func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) { + // It is common to pass TexSubImage2D a nil data, indicating that a + // bound GL buffer is being used as the source. In that case, it + // is not necessary to block. + parg := unsafe.Pointer(nil) + if len(data) > 0 { + parg = unsafe.Pointer(&data[0]) + } + ctx.enqueue(call{ args: fnargs{ fn: glfnTexSubImage2D, @@ -1297,8 +1306,8 @@ func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height in a6: format.c(), a7: ty.c(), }, - parg: unsafe.Pointer(&data[0]), - blocking: true, + parg: parg, + blocking: parg != nil, }) } diff --git a/vendor/golang.org/x/mobile/gl/gldebug.go b/vendor/golang.org/x/mobile/gl/gldebug.go index 1639c1b..5a4bf71 100644 --- a/vendor/golang.org/x/mobile/gl/gldebug.go +++ b/vendor/golang.org/x/mobile/gl/gldebug.go @@ -5,6 +5,7 @@ // Code generated from gl.go using go generate. DO NOT EDIT. // See doc.go for details. +//go:build (darwin || linux || openbsd || windows) && gldebug // +build darwin linux openbsd windows // +build gldebug diff --git a/vendor/golang.org/x/mobile/gl/types_debug.go b/vendor/golang.org/x/mobile/gl/types_debug.go index 60c0afc..b6dbaaa 100644 --- a/vendor/golang.org/x/mobile/gl/types_debug.go +++ b/vendor/golang.org/x/mobile/gl/types_debug.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || linux || openbsd || windows) && gldebug // +build darwin linux openbsd windows // +build gldebug diff --git a/vendor/golang.org/x/mobile/gl/types_prod.go b/vendor/golang.org/x/mobile/gl/types_prod.go index 91c50f8..e1c8b42 100644 --- a/vendor/golang.org/x/mobile/gl/types_prod.go +++ b/vendor/golang.org/x/mobile/gl/types_prod.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || linux || openbsd || windows) && !gldebug // +build darwin linux openbsd windows // +build !gldebug diff --git a/vendor/golang.org/x/mobile/gl/work.c b/vendor/golang.org/x/mobile/gl/work.c index 7203acf..605e0ba 100644 --- a/vendor/golang.org/x/mobile/gl/work.c +++ b/vendor/golang.org/x/mobile/gl/work.c @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin || linux || openbsd // +build darwin linux openbsd #include <stdlib.h> @@ -356,7 +357,7 @@ uintptr_t processFn(struct fnargs* args, char* parg) { glScissor((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3); break; case glfnShaderSource: -#if defined(os_ios) || defined(os_osx) +#if defined(os_ios) || defined(os_macos) glShaderSource((GLuint)args->a0, (GLsizei)args->a1, (const GLchar *const *)args->a2, NULL); #else glShaderSource((GLuint)args->a0, (GLsizei)args->a1, (const GLchar **)args->a2, NULL); diff --git a/vendor/golang.org/x/mobile/gl/work.go b/vendor/golang.org/x/mobile/gl/work.go index 9f340c1..65eaf9a 100644 --- a/vendor/golang.org/x/mobile/gl/work.go +++ b/vendor/golang.org/x/mobile/gl/work.go @@ -2,28 +2,25 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin || linux || openbsd // +build darwin linux openbsd package gl /* -#cgo ios LDFLAGS: -framework OpenGLES -#cgo darwin,amd64,!ios LDFLAGS: -framework OpenGL -#cgo darwin,arm LDFLAGS: -framework OpenGLES -#cgo darwin,arm64 LDFLAGS: -framework OpenGLES -#cgo linux LDFLAGS: -lGLESv2 -#cgo openbsd LDFLAGS: -L/usr/X11R6/lib/ -lGLESv2 - -#cgo android CFLAGS: -Dos_android -#cgo ios CFLAGS: -Dos_ios -#cgo darwin,amd64,!ios CFLAGS: -Dos_osx -#cgo darwin,arm CFLAGS: -Dos_ios -#cgo darwin,arm64 CFLAGS: -Dos_ios -#cgo darwin CFLAGS: -DGL_SILENCE_DEPRECATION -#cgo linux CFLAGS: -Dos_linux -#cgo openbsd CFLAGS: -Dos_openbsd - -#cgo openbsd CFLAGS: -I/usr/X11R6/include/ +#cgo ios LDFLAGS: -framework OpenGLES +#cgo darwin,!ios LDFLAGS: -framework OpenGL +#cgo linux LDFLAGS: -lGLESv2 +#cgo openbsd LDFLAGS: -L/usr/X11R6/lib/ -lGLESv2 + +#cgo android CFLAGS: -Dos_android +#cgo ios CFLAGS: -Dos_ios +#cgo darwin,!ios CFLAGS: -Dos_macos +#cgo darwin CFLAGS: -DGL_SILENCE_DEPRECATION -DGLES_SILENCE_DEPRECATION +#cgo linux CFLAGS: -Dos_linux +#cgo openbsd CFLAGS: -Dos_openbsd + +#cgo openbsd CFLAGS: -I/usr/X11R6/include/ #include <stdint.h> #include "work.h" diff --git a/vendor/golang.org/x/mobile/gl/work.h b/vendor/golang.org/x/mobile/gl/work.h index cc2e48c..5bc093b 100644 --- a/vendor/golang.org/x/mobile/gl/work.h +++ b/vendor/golang.org/x/mobile/gl/work.h @@ -18,7 +18,7 @@ #include <OpenGLES/ES2/glext.h> #endif -#ifdef os_osx +#ifdef os_macos #include <OpenGL/gl3.h> #define GL_ES_VERSION_3_0 1 #endif diff --git a/vendor/golang.org/x/mobile/gl/work_other.go b/vendor/golang.org/x/mobile/gl/work_other.go index b0f22fd..b4b48f4 100644 --- a/vendor/golang.org/x/mobile/gl/work_other.go +++ b/vendor/golang.org/x/mobile/gl/work_other.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (!cgo || (!darwin && !linux && !openbsd)) && !windows // +build !cgo !darwin,!linux,!openbsd // +build !windows |