read_viewport can return false during video record.

This commit is contained in:
Themaister 2012-11-21 10:24:35 +01:00
parent 897167789f
commit a25dcf337c
2 changed files with 6 additions and 4 deletions

View File

@ -1542,7 +1542,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
RARCH_PERFORMANCE_INIT(read_viewport);
RARCH_PERFORMANCE_START(read_viewport);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, get_alignment(gl->vp.width * 3));
#ifdef HAVE_OPENGLES
glReadPixels(gl->vp.x, gl->vp.y,

View File

@ -226,9 +226,11 @@ static void recording_dump_frame(const void *data, unsigned width, unsigned heig
return;
}
// Big bottleneck. Also adds one frame "delay" to video output as we haven't rendered the current frame yet.
// It will probably improve performance a lot though, who knows.
video_read_viewport_func(g_extern.record_gpu_buffer);
// Big bottleneck.
// Since we might need to do read-backs asynchronously, it might take 3-4 times
// before this returns true ...
if (!video_read_viewport_func(g_extern.record_gpu_buffer))
return;
ffemu_data.pitch = g_extern.record_gpu_width * 3;
ffemu_data.width = g_extern.record_gpu_width;