app/internal/glimpl: [wasm] remove slow getError calls

The removal of getError significantly improves performance on js/wasm:

Opera 72 (w/ AMD Ryzen 3900X): ~12.29ms per frame to ~8.09ms;
Chrome 87 (w/ Snapdragon 435): ~156.34ms per frame to ~94.31ms;

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
Inkeliz
2020-12-01 06:26:44 +00:00
committed by Elias Naur
parent 4c3de5f5d2
commit b9846b48b8
+2 -1
View File
@@ -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())
// Avoid slow getError calls. See gio#179.
return 0
}
func (f *Functions) GetRenderbufferParameteri(target, pname gl.Enum) int {
return paramVal(f.Ctx.Call("getRenderbufferParameteri", int(pname)))