EGL_KHR_swap_buffers_with_damage is actually already supported, as it is
technically nothing but a rename of EGL_EXT_swap_buffers_with_damage.

To that effect, both extension are advertised depending on the same
condition, and the new entrypoint simply redirects to the previous one.

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/egl/main/eglapi.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 1c62a80..c3d471b 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -399,7 +399,10 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
    _EGL_CHECK_EXTENSION(EXT_buffer_age);
    _EGL_CHECK_EXTENSION(EXT_create_context_robustness);
    _EGL_CHECK_EXTENSION(EXT_image_dma_buf_import);
-   _EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);
+   if (dpy->Extensions.EXT_swap_buffers_with_damage) {
+      _eglAppendExtension(&exts, "EGL_EXT_swap_buffers_with_damage");
+      _eglAppendExtension(&exts, "EGL_KHR_swap_buffers_with_damage");
+   }
 
    _EGL_CHECK_EXTENSION(KHR_cl_event2);
    _EGL_CHECK_EXTENSION(KHR_create_context);
@@ -1060,6 +1063,14 @@ eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface 
surface,
    RETURN_EGL_EVAL(disp, ret);
 }
 
+static EGLBoolean EGLAPIENTRY
+eglSwapBuffersWithDamageKHR(EGLDisplay dpy, EGLSurface surface,
+                            EGLint *rects, EGLint n_rects)
+{
+   return eglSwapBuffersWithDamageEXT(dpy, surface,
+                                      rects, n_rects);
+}
+
 EGLBoolean EGLAPIENTRY
 eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
 {
@@ -1919,6 +1930,7 @@ eglGetProcAddress(const char *procname)
       { "eglCreateWaylandBufferFromImageWL", (_EGLProc) 
eglCreateWaylandBufferFromImageWL },
       { "eglPostSubBufferNV", (_EGLProc) eglPostSubBufferNV },
       { "eglSwapBuffersWithDamageEXT", (_EGLProc) eglSwapBuffersWithDamageEXT 
},
+      { "eglSwapBuffersWithDamageKHR", (_EGLProc) eglSwapBuffersWithDamageKHR 
},
       { "eglGetPlatformDisplayEXT", (_EGLProc) eglGetPlatformDisplayEXT },
       { "eglCreatePlatformWindowSurfaceEXT", (_EGLProc) 
eglCreatePlatformWindowSurfaceEXT },
       { "eglCreatePlatformPixmapSurfaceEXT", (_EGLProc) 
eglCreatePlatformPixmapSurfaceEXT },
-- 
Cheers,
  Eric

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to