From: Steinar H. Gunderson Date: Thu, 14 Apr 2016 08:24:26 +0000 (+0200) Subject: Always flush after setting a fence, since we could otherwise get unbounded delay... X-Git-Tag: 1.2.1~2 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=288a03c8054f20dd554b2250cedbae845442e7b6;p=nageru Always flush after setting a fence, since we could otherwise get unbounded delay. (Also, used to confuse apitrace, but that is fixed already.) --- diff --git a/h264encode.cpp b/h264encode.cpp index c923f47..523eae9 100644 --- a/h264encode.cpp +++ b/h264encode.cpp @@ -1913,6 +1913,8 @@ RefCountedGLsync H264EncoderImpl::end_frame(int64_t pts, const vector lock(frame_queue_mutex); diff --git a/mixer.cpp b/mixer.cpp index 08d2d01..42d8548 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -563,6 +563,8 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode, RefCountedGLsync fence(GL_SYNC_GPU_COMMANDS_COMPLETE, /*flags=*/0); check_error(); assert(fence.get() != nullptr); + glFlush(); // Make sure the main thread doesn't have to wait until we push out enough frames to make a new command buffer. + check_error(); if (field == 1) { // Don't upload the second field as fast as we can; wait until