[waffle] [PATCH 2/2] glx: Set waffle_error when glXMakeCurrent fails

Chad Versace chad.versace at linux.intel.com
Thu May 8 21:59:26 PDT 2014


Jordan found this because `wflinfo -p glx -a gl -V 3.1 --profile=core`
failed on NVidia with this unhelpful message:
"Waffle error: 0x0 WAFFLE_NO_ERROR".

Reported-by: Jordan Justen <jordan.l.justen at intel.com>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/waffle/glx/glx_platform.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/waffle/glx/glx_platform.c b/src/waffle/glx/glx_platform.c
index be710eb..804c275 100644
--- a/src/waffle/glx/glx_platform.c
+++ b/src/waffle/glx/glx_platform.c
@@ -89,9 +89,17 @@ glx_platform_make_current(struct wcore_platform *wc_self,
                           struct wcore_window *wc_window,
                           struct wcore_context *wc_ctx)
 {
-    return wrapped_glXMakeCurrent(glx_display(wc_dpy)->x11.xlib,
-                                  wc_window ? glx_window(wc_window)->x11.xcb : 0,
-                                  wc_ctx ? glx_context(wc_ctx)->glx : NULL);
+    bool ok;
+    Display *dpy = glx_display(wc_dpy)->x11.xlib;
+    GLXDrawable win = wc_window ? glx_window(wc_window)->x11.xcb : 0;
+    GLXContext ctx = wc_ctx ? glx_context(wc_ctx)->glx : NULL;
+    
+    ok = wrapped_glXMakeCurrent(dpy, win, ctx);
+    if (!ok) {
+        wcore_errorf(WAFFLE_ERROR_UNKNOWN, "glXMakeCurrent failed");
+    }
+
+    return ok;
 }
 
 static void*
-- 
1.9.0



More information about the waffle mailing list