From 16ef82fa236c7222be8d5224831dda4c5cb9ed62 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 1 Jun 2016 03:53:55 +0900 Subject: [PATCH] opengl: Reduce CheckFramebufferState call for speed --- internal/graphics/opengl/context_desktop.go | 6 ------ internal/graphics/opengl/context_mobile.go | 6 ------ 2 files changed, 12 deletions(-) diff --git a/internal/graphics/opengl/context_desktop.go b/internal/graphics/opengl/context_desktop.go index aa3242fc4..0e7a31593 100644 --- a/internal/graphics/opengl/context_desktop.go +++ b/internal/graphics/opengl/context_desktop.go @@ -231,12 +231,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) { func (c *Context) SetViewport(f Framebuffer, width, height int) error { return c.RunOnContextThread(func() error { c.bindFramebuffer(f) - if st := gl.CheckFramebufferStatus(gl.FRAMEBUFFER); st != gl.FRAMEBUFFER_COMPLETE { - if e := gl.GetError(); e != 0 { - return fmt.Errorf("opengl: glBindFramebuffer failed: %d", e) - } - return errors.New("opengl: glBindFramebuffer failed: the context is different?") - } gl.Viewport(0, 0, int32(width), int32(height)) return nil }) diff --git a/internal/graphics/opengl/context_mobile.go b/internal/graphics/opengl/context_mobile.go index 30767f7f5..a7fdf572c 100644 --- a/internal/graphics/opengl/context_mobile.go +++ b/internal/graphics/opengl/context_mobile.go @@ -186,12 +186,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) { func (c *Context) SetViewport(f Framebuffer, width, height int) error { gl := c.gl c.bindFramebuffer(f) - if err := gl.CheckFramebufferStatus(mgl.FRAMEBUFFER); err != mgl.FRAMEBUFFER_COMPLETE { - if e := gl.GetError(); e != 0 { - return fmt.Errorf("opengl: glBindFramebuffer failed: %d", e) - } - return errors.New("opengl: glBindFramebuffer failed: the context is different?") - } gl.Viewport(0, 0, width, height) return nil }