remove unnecessary glFinish calls

pull/3471/head
kallaballa 2 years ago
parent bbdf82c55b
commit 2e93c76952
  1. 11
      modules/v4d/src/detail/framebuffercontext.cpp
  2. 1
      modules/v4d/src/detail/glcontext.cpp
  3. 1
      modules/v4d/src/detail/imguicontext.cpp

@ -133,6 +133,7 @@ void FrameBufferContext::initWebGLCopy(const size_t& index) {
void FrameBufferContext::doWebGLCopy(FrameBufferContext& other) {
#ifdef __EMSCRIPTEN__
GL_CHECK(glFinish());
size_t index = other.getIndex();
this->makeCurrent();
int width = getWindowSize().width;
@ -143,7 +144,6 @@ void FrameBufferContext::doWebGLCopy(FrameBufferContext& other) {
cv::Rect(0,0, other.size().width, other.size().height),
this->getWindowSize(),
false);
GL_CHECK(glFinish());
emscripten_webgl_commit_frame();
}
this->makeCurrent();
@ -192,7 +192,7 @@ void FrameBufferContext::doWebGLCopy(FrameBufferContext& other) {
GL_CHECK(glBindVertexArray(copyVaos[index]));
GL_CHECK(glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0));
GL_CHECK(glDisable(GL_BLEND));
GL_CHECK(glFinish());
GL_CHECK(glFlush());
#else
CV_UNUSED(other);
throw std::runtime_error("WebGL not supported in none WASM builds");
@ -429,13 +429,6 @@ void FrameBufferContext::setup(const cv::Size& sz) {
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, renderBufferID_));
assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
}
// glBindTexture(GL_TEXTURE_2D, 0);
// glGetError();
// glBindRenderbuffer(GL_RENDERBUFFER, 0);
// glGetError();
// glBindFramebuffer(GL_FRAMEBUFFER, 0);
// glGetError();
// GL_CHECK(glFinish());
}

@ -39,7 +39,6 @@ void GLContext::render(std::function<void(const cv::Size&)> fn) {
GL_CHECK(glClearColor(cColor[0], cColor[1], cColor[2], cColor[3]));
#endif
fn(fbCtx().size());
GL_CHECK(glFinish());
}
if(!fbCtx().isShared()) {
#ifdef __EMSCRIPTEN__

@ -82,7 +82,6 @@ void ImGuiContextImpl::render() {
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
}
GL_CHECK(glFinish());
}
}
}

Loading…
Cancel
Save