From 8655f6df6bd9eff27bb6600aa0e19bba8af0198c Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 4 Jan 2022 15:55:28 +0100 Subject: [PATCH] cameraview.cc: call glFlush after creating fence --- selfdrive/ui/qt/widgets/cameraview.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/ui/qt/widgets/cameraview.cc b/selfdrive/ui/qt/widgets/cameraview.cc index b390f5cdb2322e..51553bcc8f34f4 100644 --- a/selfdrive/ui/qt/widgets/cameraview.cc +++ b/selfdrive/ui/qt/widgets/cameraview.cc @@ -309,6 +309,10 @@ void CameraViewWidget::vipcThread() { assert(glGetError() == GL_NO_ERROR); wait_fence.reset(new WaitFence()); + + // Ensure the fence is in the GPU command queue, or waiting on it might block + // https://www.khronos.org/opengl/wiki/Sync_Object#Flushing_and_contexts + glFlush(); } latest_texture_id = buf->idx; }