Mesa (master): progs/es2: Fix an assertion failure in tri.

Chia-I Wu olv at kemper.freedesktop.org
Tue Feb 2 02:46:15 UTC 2010


Module: Mesa
Branch: master
Commit: 5fa4ea29343757084d16ebb86e29009742d50dac
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fa4ea29343757084d16ebb86e29009742d50dac

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Tue Feb  2 10:40:32 2010 +0800

progs/es2: Fix an assertion failure in tri.

EGL_SURFACE_TYPE is a config attribute, not a surface attribute.  Thanks
to Mike Stroyan for pointing out this error.

---

 progs/es2/xegl/tri.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/progs/es2/xegl/tri.c b/progs/es2/xegl/tri.c
index 7729a09..8981d8a 100644
--- a/progs/es2/xegl/tri.c
+++ b/progs/es2/xegl/tri.c
@@ -334,14 +334,15 @@ make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
       exit(1);
    }
 
+   /* sanity checks */
    {
       EGLint val;
       eglQuerySurface(egl_dpy, *surfRet, EGL_WIDTH, &val);
       assert(val == width);
       eglQuerySurface(egl_dpy, *surfRet, EGL_HEIGHT, &val);
       assert(val == height);
-      eglQuerySurface(egl_dpy, *surfRet, EGL_SURFACE_TYPE, &val);
-      assert(val == EGL_WINDOW_BIT);
+      assert(eglGetConfigAttrib(egl_dpy, config, EGL_SURFACE_TYPE, &val));
+      assert(val & EGL_WINDOW_BIT);
    }
 
    XFree(visInfo);




More information about the mesa-commit mailing list