egl: fix KHR_partial_update without EXT_buffer_age
authorChia-I Wu <olvaffe@gmail.com>
Thu, 7 Feb 2019 23:11:57 +0000 (15:11 -0800)
committerEric Engestrom <eric.engestrom@intel.com>
Tue, 12 Feb 2019 19:14:34 +0000 (19:14 +0000)
EGL_BUFFER_AGE_EXT can be queried without EXT_buffer_age.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/egl/main/eglsurface.c

index ffef1b8f259e7a0f6327dfe61b84f9424e780878..7d96514f77553e145e72ec873d8dcd0bbce7b595 100644 (file)
@@ -522,7 +522,12 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface,
       *value = surface->PostSubBufferSupportedNV;
       break;
    case EGL_BUFFER_AGE_EXT:
-      if (!disp->Extensions.EXT_buffer_age)
+      /* Both EXT_buffer_age and KHR_partial_update accept EGL_BUFFER_AGE_EXT.
+       * To be precise, the KHR one accepts EGL_BUFFER_AGE_KHR which is an
+       * alias with the same numeric value.
+       */
+      if (!disp->Extensions.EXT_buffer_age &&
+          !disp->Extensions.KHR_partial_update)
          return _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
 
       _EGLContext *ctx = _eglGetCurrentContext();