graphicsdriver/opengl: Remove glGetError calls

As glGetError doesn't tell where the error happens, this is not
useful.

Fixes #815
This commit is contained in:
Hajime Hoshi 2019-02-16 09:59:53 +09:00
parent fc329bd215
commit 7ff99d3965
3 changed files with 0 additions and 11 deletions

View File

@ -171,10 +171,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte,
if err := mainthread.Run(func() error { if err := mainthread.Run(func() error {
pixels = make([]byte, 4*width*height) pixels = make([]byte, 4*width*height)
gl.ReadPixels(0, 0, int32(width), int32(height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(pixels)) 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 return nil
}); err != nil { }); err != nil {
return nil, err return nil, err

View File

@ -193,10 +193,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte,
p := js.TypedArrayOf(pixels) p := js.TypedArrayOf(pixels)
gl.Call("readPixels", 0, 0, width, height, rgba, unsignedByte, p) gl.Call("readPixels", 0, 0, width, height, rgba, unsignedByte, p)
p.Release() p.Release()
if e := gl.Call("getError"); e.Int() != noError.Int() {
return nil, errors.New(fmt.Sprintf("opengl: error: %d", e))
}
return pixels, nil return pixels, nil
} }

View File

@ -148,9 +148,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte,
pixels := make([]byte, 4*width*height) pixels := make([]byte, 4*width*height)
gl.ReadPixels(pixels, 0, 0, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE) 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 return pixels, nil
} }