Skip to content

Commit

Permalink
drm: fix synchronization on amd
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Jul 11, 2024
1 parent 6dda802 commit 4fd590a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/backend/drm/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ SP<CDRMRenderer> CDRMRenderer::attempt(int drmfd, SP<CBackend> backend_) {
attrs.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG);
}

if (EGLEXTENSIONS2.contains("EXT_create_context_robustness")) {
attrs.push_back(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT);
attrs.push_back(EGL_LOSE_CONTEXT_ON_RESET_EXT);
}

attrs.push_back(EGL_CONTEXT_MAJOR_VERSION);
attrs.push_back(2);
attrs.push_back(EGL_CONTEXT_MINOR_VERSION);
Expand Down Expand Up @@ -348,6 +353,8 @@ CDRMRenderer::GLTex CDRMRenderer::glTex(Hyprutils::Memory::CSharedPointer<IBuffe
egl.glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, tex.image);
GLCALL(glBindTexture(GL_TEXTURE_2D, 0));

glFlush();

return tex;
}

Expand Down Expand Up @@ -437,6 +444,8 @@ bool CDRMRenderer::blit(SP<IBuffer> from, SP<IBuffer> to) {
}
}

glFlush();

TRACE(backend->log(AQ_LOG_TRACE, std::format("EGL (blit): rboImage 0x{:x}", (uintptr_t)rboImage)));

GLCALL(glBindRenderbuffer(GL_RENDERBUFFER, rboID));
Expand Down

0 comments on commit 4fd590a

Please sign in to comment.