From 3df198f68eea502c524e79aaa78a87c0574752ce Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 22 Nov 2019 00:27:18 +0900 Subject: [PATCH] graphicsdriver/opengl: Use GL_READ_WRITE at glMapBuffer Updates #993 --- internal/graphicsdriver/opengl/context_desktop.go | 2 +- internal/graphicsdriver/opengl/gl/package.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/graphicsdriver/opengl/context_desktop.go b/internal/graphicsdriver/opengl/context_desktop.go index 5928db8a9..7a57d7ecd 100644 --- a/internal/graphicsdriver/opengl/context_desktop.go +++ b/internal/graphicsdriver/opengl/context_desktop.go @@ -529,7 +529,7 @@ func (c *context) mapPixelBuffer(buffer buffer) unsafe.Pointer { var ptr unsafe.Pointer _ = c.t.Call(func() error { gl.BindBuffer(gl.PIXEL_UNPACK_BUFFER, uint32(buffer)) - ptr = gl.MapBuffer(gl.PIXEL_UNPACK_BUFFER, gl.WRITE_ONLY) + ptr = gl.MapBuffer(gl.PIXEL_UNPACK_BUFFER, gl.READ_WRITE) return nil }) return ptr diff --git a/internal/graphicsdriver/opengl/gl/package.go b/internal/graphicsdriver/opengl/gl/package.go index a4ce01dc5..5fd5480ef 100644 --- a/internal/graphicsdriver/opengl/gl/package.go +++ b/internal/graphicsdriver/opengl/gl/package.go @@ -47,6 +47,7 @@ const ( MAX_TEXTURE_SIZE = 0x0D33 NEAREST = 0x2600 NO_ERROR = 0 + READ_WRITE = 0x88BA RGBA = 0x1908 TEXTURE_2D = 0x0DE1 TEXTURE_MAG_FILTER = 0x2800