mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
graphicsdriver/opengl: Adopt WRITE_ONLY for PBOs
It looks like it is safe to use WRITE_ONLY: https://stackoverflow.com/questions/30248594/write-only-glmapbuffer-what-if-i-dont-write-it-all
This commit is contained in:
parent
4c4f67197f
commit
9f483ddc60
@ -529,7 +529,9 @@ func (c *context) mapPixelBuffer(buffer buffer, t textureNative) uintptr {
|
|||||||
var ptr uintptr
|
var ptr uintptr
|
||||||
_ = c.t.Call(func() error {
|
_ = c.t.Call(func() error {
|
||||||
gl.BindBuffer(gl.PIXEL_UNPACK_BUFFER, uint32(buffer))
|
gl.BindBuffer(gl.PIXEL_UNPACK_BUFFER, uint32(buffer))
|
||||||
ptr = gl.MapBuffer(gl.PIXEL_UNPACK_BUFFER, gl.READ_WRITE)
|
// Even though only the part of the buffer is updated, that's fine.
|
||||||
|
// https://stackoverflow.com/questions/30248594/write-only-glmapbuffer-what-if-i-dont-write-it-all
|
||||||
|
ptr = gl.MapBuffer(gl.PIXEL_UNPACK_BUFFER, gl.WRITE_ONLY)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
return ptr
|
return ptr
|
||||||
|
Loading…
Reference in New Issue
Block a user