GTK+: OpenGL: Use MapBufferRange on GL >= 3.0.

This commit is contained in:
Brandon Wright 2019-01-17 10:41:27 -06:00
parent 5b01fa2dc1
commit 175b9baf64
1 changed files with 10 additions and 0 deletions

View File

@ -175,6 +175,11 @@ void S9xOpenGLDisplayDriver::update (int width, int height, int yoffset)
width * height * 2, width * height * 2,
NULL, NULL,
GL_STREAM_DRAW); GL_STREAM_DRAW);
if (version >= 30)
glMapBufferRange (GL_PIXEL_UNPACK_BUFFER, 0,
width * height * image_bpp,
GL_WRITE_ONLY | GL_MAP_INVALIDATE_BUFFER_BIT);
pbo_map = glMapBuffer (GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); pbo_map = glMapBuffer (GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
for (int y = 0; y < height; y++) for (int y = 0; y < height; y++)
@ -206,6 +211,11 @@ void S9xOpenGLDisplayDriver::update (int width, int height, int yoffset)
width * height * 4, width * height * 4,
NULL, NULL,
GL_STREAM_DRAW); GL_STREAM_DRAW);
if (version >= 30)
glMapBufferRange (GL_PIXEL_UNPACK_BUFFER, 0,
width * height * image_bpp,
GL_WRITE_ONLY | GL_MAP_INVALIDATE_BUFFER_BIT);
pbo_map = glMapBuffer (GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); pbo_map = glMapBuffer (GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
/* Pixel swizzling in software */ /* Pixel swizzling in software */