mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 09:35:21 +00:00
Use glMapBuffer to copy data to texref bufs.
This commit is contained in:
parent
657c9ea3e8
commit
aa74c185f3
13
gfx/gl.c
13
gfx/gl.c
@ -892,16 +892,11 @@ static inline void gl_copy_frame(gl_t *gl, const void *frame, unsigned width, un
|
||||
const uint8_t *frame_copy = frame;
|
||||
size_t frame_copy_size = width * gl->base_size;
|
||||
|
||||
for (unsigned h = 0; h < height; h++)
|
||||
{
|
||||
glBufferSubData(GL_TEXTURE_REFERENCE_BUFFER_SCE,
|
||||
buffer_addr,
|
||||
frame_copy_size,
|
||||
frame_copy);
|
||||
uint8_t *buffer = (uint8_t*)glMapBuffer(GL_TEXTURE_REFERENCE_BUFFER_SCE, GL_WRITE_ONLY) + buffer_addr;
|
||||
for (unsigned h = 0; h < height; h++, buffer += buffer_stride, frame_copy += pitch)
|
||||
memcpy(buffer, frame_copy, frame_copy_size);
|
||||
|
||||
frame_copy += pitch;
|
||||
buffer_addr += buffer_stride;
|
||||
}
|
||||
glUnmapBuffer(GL_TEXTURE_REFERENCE_BUFFER_SCE);
|
||||
}
|
||||
|
||||
static void gl_init_textures(gl_t *gl)
|
||||
|
Loading…
x
Reference in New Issue
Block a user