mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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 <mail@eliasnaur.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user