NSW: skip frames if we can't acquire a buffer (newer libtransistors use three buffers, making this very unlikely to happen)

This commit is contained in:
misson20000 2018-03-06 20:55:40 -08:00
parent 4a4de74518
commit e934f11065

View File

@ -220,17 +220,18 @@ static bool switch_frame(void *data, const void *frame,
if (msg && strlen(msg) > 0) if (msg && strlen(msg) > 0)
RARCH_LOG("message: %s\n", msg); RARCH_LOG("message: %s\n", msg);
do { r = surface_dequeue_buffer(&sw->surface, &out_buffer);
if (sw->vsync) /* vsync seems to sometimes return before the buffer has actually been dequeued? */ if (sw->vsync)
switch_wait_vsync(sw); switch_wait_vsync(sw);
svcSleepThread(10000);
r = surface_dequeue_buffer(&sw->surface, &out_buffer); if(r != RESULT_OK) {
} while(r != RESULT_OK); return true; // just skip the frame
}
gfx_slow_swizzling_blit(out_buffer, sw->image, 1280, 720, 0, 0); gfx_slow_swizzling_blit(out_buffer, sw->image, 1280, 720, 0, 0);
r = surface_queue_buffer(&sw->surface); r = surface_queue_buffer(&sw->surface);
if (r != RESULT_OK) if (r != RESULT_OK)
return false; return false;