egl: set KHR_gl_texture_3D_image only when the requirements are met.
authorEmil Velikov <emil.velikov@collabora.com>
Wed, 28 Jun 2017 15:41:30 +0000 (16:41 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 12 Jul 2017 14:45:27 +0000 (15:45 +0100)
DRI_IMAGE's createImageFromTexture is used to implement the extension,
so we should check for it prior to advertising.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/egl/drivers/dri2/egl_dri2.c

index f8cadfaf8c8f86219185180d16c11e2fec4b12c8..2392bfbb2a5809b20b650b04d7392117e0ef77a1 100644 (file)
@@ -702,10 +702,11 @@ dri2_setup_screen(_EGLDisplay *disp)
           dri2_dpy->image->createImageFromTexture) {
          disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
          disp->Extensions.KHR_gl_texture_cubemap_image = EGL_TRUE;
+
+         if (dri2_renderer_query_integer(dri2_dpy,
+                                         __DRI2_RENDERER_HAS_TEXTURE_3D))
+             disp->Extensions.KHR_gl_texture_3D_image = EGL_TRUE;
       }
-      if (dri2_renderer_query_integer(dri2_dpy,
-                                      __DRI2_RENDERER_HAS_TEXTURE_3D))
-         disp->Extensions.KHR_gl_texture_3D_image = EGL_TRUE;
 #ifdef HAVE_LIBDRM
       if (dri2_dpy->image->base.version >= 8 &&
           dri2_dpy->image->createImageFromDmaBufs) {