mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-11 05:16:12 +00:00
(PS3) Return to glMapBuffer/glUnmapBuffer version of gl_copy_frame -
seems to work without garbage frames when using GL_READ_WRITE instead of GL_WRITE_ONLY
This commit is contained in:
parent
dbea6f3614
commit
0b7baf9f9c
16
gfx/gl.c
16
gfx/gl.c
@ -1050,23 +1050,17 @@ static void gl_init_textures_data(void *data)
|
||||
#if defined(HAVE_PSGL)
|
||||
static inline void gl_copy_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
gl_t *gl = (gl_t*)data;
|
||||
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;
|
||||
|
||||
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_READ_WRITE) + 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(void *data, const video_info_t *video)
|
||||
|
Loading…
x
Reference in New Issue
Block a user