opengl: Remove glFlush to improve performance

This commit is contained in:
Hajime Hoshi 2016-06-01 01:48:46 +09:00
parent a95edaceba
commit 5638bb93f5
3 changed files with 0 additions and 3 deletions

View File

@ -226,7 +226,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
func (c *Context) SetViewport(f Framebuffer, width, height int) error { func (c *Context) SetViewport(f Framebuffer, width, height int) error {
return c.RunOnContextThread(func() error { return c.RunOnContextThread(func() error {
gl.Flush()
gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(f)) gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(f))
if st := gl.CheckFramebufferStatus(gl.FRAMEBUFFER); st != gl.FRAMEBUFFER_COMPLETE { if st := gl.CheckFramebufferStatus(gl.FRAMEBUFFER); st != gl.FRAMEBUFFER_COMPLETE {
if e := gl.GetError(); e != 0 { if e := gl.GetError(); e != 0 {

View File

@ -168,7 +168,6 @@ func (c *Context) bindFramebuffer(f Framebuffer) {
func (c *Context) FramebufferPixels(f Framebuffer, width, height int) ([]uint8, error) { func (c *Context) FramebufferPixels(f Framebuffer, width, height int) ([]uint8, error) {
gl := c.gl gl := c.gl
gl.Flush()
c.bindFramebuffer(f) c.bindFramebuffer(f)

View File

@ -181,7 +181,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
func (c *Context) SetViewport(f Framebuffer, width, height int) error { func (c *Context) SetViewport(f Framebuffer, width, height int) error {
gl := c.gl gl := c.gl
gl.Flush()
gl.BindFramebuffer(mgl.FRAMEBUFFER, mgl.Framebuffer(f)) gl.BindFramebuffer(mgl.FRAMEBUFFER, mgl.Framebuffer(f))
if err := gl.CheckFramebufferStatus(mgl.FRAMEBUFFER); err != mgl.FRAMEBUFFER_COMPLETE { if err := gl.CheckFramebufferStatus(mgl.FRAMEBUFFER); err != mgl.FRAMEBUFFER_COMPLETE {
if e := gl.GetError(); e != 0 { if e := gl.GetError(); e != 0 {