[PATCH gio] app/internal/glimpl: remove getError calls
Export this patch
From: Inkeliz <inkeliz@inkeliz.com>
Fixes gio#179
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
---
app/internal/glimpl/gl_js.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/internal/glimpl/gl_js.go b/app/internal/glimpl/gl_js.go
index e4291d0..9c22c01 100644
--- a/app/internal/glimpl/gl_js.go
+++ b/app/internal/glimpl/gl_js.go
@@ -185,7 +185,8 @@ func (f *Functions) FramebufferTexture2D(target, attachment, texTarget gl.Enum,
f.Ctx.Call("framebufferTexture2D", int(target), int(attachment), int(texTarget), js.Value(t), level)
}
func (f *Functions) GetError() gl.Enum {
- return gl.Enum(f.Ctx.Call("getError").Int())
+ // It's a no-op to avoid getError calls: gio#179.
+ return 0
}
func (f *Functions) GetRenderbufferParameteri(target, pname gl.Enum) int {
return paramVal(f.Ctx.Call("getRenderbufferParameteri", int(pname)))
--
2.26.2
Please expand the subject to include webassembly and reason:
app/internal/glimpl: [wasm] remove slow getError calls
and then put a bit of timing information in the message body.
On Sat Nov 28, 2020 at 12:42 AM CET, ~inkeliz wrote:
> From: Inkeliz <inkeliz@inkeliz.com>
>
> Fixes gio#179
>
> Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
> ---
> app/internal/glimpl/gl_js.go | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/app/internal/glimpl/gl_js.go b/app/internal/glimpl/gl_js.go
> index e4291d0..9c22c01 100644
> --- a/app/internal/glimpl/gl_js.go
> +++ b/app/internal/glimpl/gl_js.go
> @@ -185,7 +185,8 @@ func (f *Functions) FramebufferTexture2D(target,
> attachment, texTarget gl.Enum,
> f.Ctx.Call("framebufferTexture2D", int(target), int(attachment),
> int(texTarget), js.Value(t), level)
> }
> func (f *Functions) GetError() gl.Enum {
> - return gl.Enum(f.Ctx.Call("getError").Int())
> + // It's a no-op to avoid getError calls: gio#179.
Note that getErrors are slow:
// Avoid slow getError calls. See gio#179.