[Mesa-dev] [PATCH 10/10] egl: set KHR_gl_texture_3D_image only when the requirements are met.

Emil Velikov emil.l.velikov at gmail.com
Fri Jun 30 11:15:20 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

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 at collabora.com>
---
 src/egl/drivers/dri2/egl_dri2.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 78a6d5f2219..fe67de0a5ba 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -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) {
-- 
2.13.0



More information about the mesa-dev mailing list