From 50f72c069232d6e3dd5d4e73fc5353af78c40543 Mon Sep 17 00:00:00 2001 From: kallaballa Date: Mon, 19 Dec 2022 08:16:02 +0100 Subject: [PATCH] set the viewport before flushing --- src/common/detail/clglcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/detail/clglcontext.cpp b/src/common/detail/clglcontext.cpp index 5388140a2..47158ce72 100644 --- a/src/common/detail/clglcontext.cpp +++ b/src/common/detail/clglcontext.cpp @@ -83,9 +83,9 @@ void CLGLContext::end() { GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, 0)); //glFlush seems enough but i wanna make sure that there won't be race conditions. //At least on TigerLake/Iris it doesn't make a difference in performance. + GL_CHECK(glViewport(viewport_[0], viewport_[1], viewport_[2], viewport_[3])); GL_CHECK(glFlush()); GL_CHECK(glFinish()); - GL_CHECK(glViewport(viewport_[0], viewport_[1], viewport_[2], viewport_[3])); } void CLGLContext::acquireFromGL(cv::UMat &m) {