The CTS requires a 565-no-depth-no-stencil config for ES 3.0, but at depth
24 of X11 we wouldn't do so.  We can satisfy that bad requirement using a
pbuffer-only visual with whatever other buffers the driver happens to have
given us.
---

Anyone who's done CTS runs have opinions on this one?  It seems to
have been required for GLES3 in VK-GL-CTS since the beginning, so I
guess Mesa has only passed using the old GTF-only suite?

Unfortunately, this patch currently fails when drawing to the 565
pbuffer surface in the CTS because the framebuffer width/height ends
up being 0.  I haven't managed to debug what's going on yet, but if
people think the CTS should be changed instead I want to not do that
work.

 src/egl/drivers/dri2/platform_x11.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_x11.c 
b/src/egl/drivers/dri2/platform_x11.c
index c525b5834115..e767717f00dd 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -844,6 +844,30 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display 
*dri2_dpy,
       xcb_depth_next(&d);
    }
 
+   /* Add a 565 pbuffer-only config.  If X11 is depth 24, we wouldn't have 565
+    * avialable, which the CTS demands.
+    */
+   for (int j = 0; dri2_dpy->driver_configs[j]; j++) {
+      const __DRIconfig *config = dri2_dpy->driver_configs[j];
+      const EGLint config_attrs[] = {
+         EGL_NATIVE_VISUAL_ID,    0,
+         EGL_NATIVE_VISUAL_TYPE,  EGL_NONE,
+         EGL_NONE
+      };
+      EGLint surface_type = EGL_PBUFFER_BIT;
+      unsigned int rgba_masks[4] = {
+         0x1f << 11,
+         0x3f << 5,
+         0x1f << 0,
+         0,
+      };
+      if (dri2_add_config(disp, config, config_count + 1, surface_type,
+                          config_attrs, rgba_masks)) {
+         config_count++;
+         break;
+      }
+   }
+
    if (!config_count) {
       _eglLog(_EGL_WARNING, "DRI2: failed to create any config");
       return EGL_FALSE;
-- 
2.18.0

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

Reply via email to