mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphicsdriver/opengl: Call glFinish before glReadPixels
It looks like glFlush is not enough at least on Travis CI. Fixes #814
This commit is contained in:
parent
0546783ad5
commit
04dc1faa9c
@ -161,7 +161,10 @@ func (c *context) bindFramebufferImpl(f framebufferNative) {
|
|||||||
func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte, error) {
|
func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte, error) {
|
||||||
var pixels []byte
|
var pixels []byte
|
||||||
_ = mainthread.Run(func() error {
|
_ = mainthread.Run(func() error {
|
||||||
gl.Flush()
|
// glFlush is not enough. glFinish can be required before glReadPixels on some environments like
|
||||||
|
// Travis CI (#814)
|
||||||
|
// See also: https://forums.khronos.org/showthread.php/62741
|
||||||
|
gl.Finish()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
c.bindFramebuffer(f.native)
|
c.bindFramebuffer(f.native)
|
||||||
|
@ -142,7 +142,7 @@ func (c *context) bindFramebufferImpl(f framebufferNative) {
|
|||||||
|
|
||||||
func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte, error) {
|
func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte, error) {
|
||||||
gl := c.gl
|
gl := c.gl
|
||||||
gl.Flush()
|
gl.Finish()
|
||||||
|
|
||||||
c.bindFramebuffer(f.native)
|
c.bindFramebuffer(f.native)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user