From d9effdad8e13ebf0daa0423e520163ed198c06a1 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 23 Sep 2021 09:49:09 +0200 Subject: [PATCH] gpu/internal/opengl: fix glCopyTexSubImage2D on Samsung J2 To use glCopyTexSubImage2D on the Samsung J2 it's not enough to set GL_READ_FRAMEBUFFER. This change binds GL_FRAMEBUFFER, setting both READ_FRAMEBUFFER and DRAW_FRAMEBUFFER, fixing the issue. Setting only GL_READ_FRAMEBUFFER was also a genuine bug, because OpenGL ES 2.0 doesn't support it. Signed-off-by: Elias Naur --- gpu/internal/opengl/opengl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu/internal/opengl/opengl.go b/gpu/internal/opengl/opengl.go index 62c28ce4..15b8fc66 100644 --- a/gpu/internal/opengl/opengl.go +++ b/gpu/internal/opengl/opengl.go @@ -1123,7 +1123,7 @@ func (b *Backend) CopyTexture(dst driver.Texture, dstOrigin image.Point, src dri b.glstate.bindTexture(b.funcs, unit, oldTex) }() b.glstate.bindTexture(b.funcs, unit, dst.(*texture).obj) - b.glstate.bindFramebuffer(b.funcs, gl.READ_FRAMEBUFFER, src.(*texture).ensureFBO()) + b.glstate.bindFramebuffer(b.funcs, gl.FRAMEBUFFER, src.(*texture).ensureFBO()) sz := srcRect.Size() b.funcs.CopyTexSubImage2D(gl.TEXTURE_2D, 0, dstOrigin.X, dstOrigin.Y, srcRect.Min.X, srcRect.Min.Y, sz.X, sz.Y) }