diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2026-01-30 20:42:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-30 19:42:01 +0000 |
| commit | ec120d57328e5ae4bfc93a7e809ace47d98f2dc3 (patch) | |
| tree | 431cb6fbd6e97e8386930a4c164a37a58a31fd20 /src/render/OpenGL.cpp | |
| parent | fe6c213024a1b0d8583a1c4cd256f0a27928f259 (diff) | |
opengl: set EGL_CONTEXT_RELEASE_BEHAVIOR_KHR if supported (#13114)
EGL_CONTEXT_RELEASE_BEHAVIOR_KHR determines what happends with implicit
flushes when context changes, on multigpu scenario we change context
frequently when blitting content. while we still rely on explicit sync
fences, the flush is destroying driver optimisations.
setting it to EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR essentially mean
just swap context and continue processing on the next context.
Diffstat (limited to 'src/render/OpenGL.cpp')
| -rw-r--r-- | src/render/OpenGL.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 715ca4f7..b00728ed 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -160,6 +160,7 @@ void CHyprOpenGLImpl::initEGL(bool gbm) { m_exts.EXT_create_context_robustness = EGLEXTENSIONS.contains("EXT_create_context_robustness"); m_exts.EXT_image_dma_buf_import = EGLEXTENSIONS.contains("EXT_image_dma_buf_import"); m_exts.EXT_image_dma_buf_import_modifiers = EGLEXTENSIONS.contains("EXT_image_dma_buf_import_modifiers"); + m_exts.KHR_context_flush_control = EGLEXTENSIONS.contains("EGL_KHR_context_flush_control"); if (m_exts.IMG_context_priority) { Log::logger->log(Log::DEBUG, "EGL: IMG_context_priority supported, requesting high"); @@ -173,6 +174,12 @@ void CHyprOpenGLImpl::initEGL(bool gbm) { attrs.push_back(EGL_LOSE_CONTEXT_ON_RESET_EXT); } + if (m_exts.KHR_context_flush_control) { + Log::logger->log(Log::DEBUG, "EGL: Using KHR_context_flush_control"); + attrs.push_back(EGL_CONTEXT_RELEASE_BEHAVIOR_KHR); + attrs.push_back(EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR); // or _FLUSH_KHR + } + auto attrsNoVer = attrs; attrs.push_back(EGL_CONTEXT_MAJOR_VERSION); |
