From 7ff99d3965d22ec6a2fe3ea97c22d469308989b5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 16 Feb 2019 09:59:53 +0900 Subject: [PATCH] graphicsdriver/opengl: Remove glGetError calls As glGetError doesn't tell where the error happens, this is not useful. Fixes #815 --- internal/graphicsdriver/opengl/context_desktop.go | 4 ---- internal/graphicsdriver/opengl/context_js.go | 4 ---- internal/graphicsdriver/opengl/context_mobile.go | 3 --- 3 files changed, 11 deletions(-) diff --git a/internal/graphicsdriver/opengl/context_desktop.go b/internal/graphicsdriver/opengl/context_desktop.go index 221385954..00ec46a71 100644 --- a/internal/graphicsdriver/opengl/context_desktop.go +++ b/internal/graphicsdriver/opengl/context_desktop.go @@ -171,10 +171,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte, if err := mainthread.Run(func() error { pixels = make([]byte, 4*width*height) gl.ReadPixels(0, 0, int32(width), int32(height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(pixels)) - if e := gl.GetError(); e != gl.NO_ERROR { - pixels = nil - return fmt.Errorf("opengl: glReadPixels: %d", e) - } return nil }); err != nil { return nil, err diff --git a/internal/graphicsdriver/opengl/context_js.go b/internal/graphicsdriver/opengl/context_js.go index ddd13f3cc..9de26d17e 100644 --- a/internal/graphicsdriver/opengl/context_js.go +++ b/internal/graphicsdriver/opengl/context_js.go @@ -193,10 +193,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte, p := js.TypedArrayOf(pixels) gl.Call("readPixels", 0, 0, width, height, rgba, unsignedByte, p) p.Release() - - if e := gl.Call("getError"); e.Int() != noError.Int() { - return nil, errors.New(fmt.Sprintf("opengl: error: %d", e)) - } return pixels, nil } diff --git a/internal/graphicsdriver/opengl/context_mobile.go b/internal/graphicsdriver/opengl/context_mobile.go index e7b3fb413..29119518b 100644 --- a/internal/graphicsdriver/opengl/context_mobile.go +++ b/internal/graphicsdriver/opengl/context_mobile.go @@ -148,9 +148,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte, pixels := make([]byte, 4*width*height) gl.ReadPixels(pixels, 0, 0, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE) - if e := gl.GetError(); e != mgl.NO_ERROR { - return nil, fmt.Errorf("opengl: glReadPixels: %d", e) - } return pixels, nil }