diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 4671818a74..6ff2ed884b 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -958,7 +958,23 @@ static INLINE void gl_copy_frame(gl_t *gl, const void *frame, performance_counter_init(©_frame, "copy_frame"); performance_counter_start(©_frame); -#if defined(HAVE_OPENGLES) +#if defined(HAVE_PSGL) + { + unsigned h; + size_t buffer_addr = gl->tex_w * gl->tex_h * + gl->tex_index * gl->base_size; + size_t buffer_stride = gl->tex_w * gl->base_size; + const uint8_t *frame_copy = frame; + size_t frame_copy_size = width * gl->base_size; + + uint8_t *buffer = (uint8_t*)glMapBuffer( + GL_TEXTURE_REFERENCE_BUFFER_SCE, GL_READ_WRITE) + buffer_addr; + for (h = 0; h < height; h++, buffer += buffer_stride, frame_copy += pitch) + memcpy(buffer, frame_copy, frame_copy_size); + + glUnmapBuffer(GL_TEXTURE_REFERENCE_BUFFER_SCE); + } +#elif defined(HAVE_OPENGLES) #if defined(HAVE_EGL) if (gl->egl_images) { @@ -1041,22 +1057,6 @@ static INLINE void gl_copy_frame(gl_t *gl, const void *frame, gl->texture_fmt, data_buf); } } -#elif defined(HAVE_PSGL) - { - unsigned h; - size_t buffer_addr = gl->tex_w * gl->tex_h * - gl->tex_index * gl->base_size; - size_t buffer_stride = gl->tex_w * gl->base_size; - const uint8_t *frame_copy = frame; - size_t frame_copy_size = width * gl->base_size; - - uint8_t *buffer = (uint8_t*)glMapBuffer( - GL_TEXTURE_REFERENCE_BUFFER_SCE, GL_READ_WRITE) + buffer_addr; - for (h = 0; h < height; h++, buffer += buffer_stride, frame_copy += pitch) - memcpy(buffer, frame_copy, frame_copy_size); - - glUnmapBuffer(GL_TEXTURE_REFERENCE_BUFFER_SCE); - } #else { const GLvoid *data_buf = frame;