Do the glGetStringi lookup after making context current so it works on WGL.
Remove an incorrect glGetStringi lookup, which returned NULL on Mali.

Signed-off-by: Frank Henigman <fjhenig...@google.com>
---
Not sure what happened but wflinfo is still broken on mali because of the 
glGetStringi madness.
Chad put in a fix:
https://github.com/waffle-gl/waffle/commit/0543d0d12aa16e0daf361937619998c8995fd6fc
and ten days before that Emil had moved the offending 
waffle_get_proc_address("glGetStringi") down about 20 lines:
https://github.com/waffle-gl/waffle/commit/6ae99a4701bd5117a182c2e555a0c0a2061254d3
It looks like both changes to that line got in, because after Chad's change 
successfully sets the address the old, wrong line later sets it to null.
Sorry but I'm not able to test on Windows.

 src/utils/wflinfo.c | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
index 5a9195c..5e173b7 100644
--- a/src/utils/wflinfo.c
+++ b/src/utils/wflinfo.c
@@ -1076,6 +1076,25 @@ main(int argc, char **argv)
     if (!glGetString)
         error_get_gl_symbol("glGetString");
 
+    const struct wflinfo_config_attrs config_attrs = {
+        .api = opts.context_api,
+        .profile = opts.context_profile,
+        .major = opts.context_major,
+        .minor = opts.context_minor,
+        .forward_compat = opts.context_forward_compatible,
+        .debug = opts.context_debug,
+    };
+
+    wflinfo_create_context(dpy, config_attrs, &ctx, &config);
+
+    window = waffle_window_create(config, WINDOW_WIDTH, WINDOW_HEIGHT);
+    if (!window)
+        error_waffle();
+
+    ok = waffle_make_current(dpy, window, ctx);
+    if (!ok)
+        error_waffle();
+
     // Retrieving GL functions is tricky. When glGetStringi is supported, here
     // are some boggling variations as of 2014-11-19:
     //   - Mali drivers on EGL 1.4 expose glGetStringi statically from
@@ -1099,27 +1118,6 @@ main(int argc, char **argv)
         glGetStringi = waffle_get_proc_address("glGetStringi");
     }
 
-    const struct wflinfo_config_attrs config_attrs = {
-        .api = opts.context_api,
-        .profile = opts.context_profile,
-        .major = opts.context_major,
-        .minor = opts.context_minor,
-        .forward_compat = opts.context_forward_compatible,
-        .debug = opts.context_debug,
-    };
-
-    wflinfo_create_context(dpy, config_attrs, &ctx, &config);
-
-    window = waffle_window_create(config, WINDOW_WIDTH, WINDOW_HEIGHT);
-    if (!window)
-        error_waffle();
-
-    ok = waffle_make_current(dpy, window, ctx);
-    if (!ok)
-        error_waffle();
-
-    glGetStringi = waffle_get_proc_address("glGetStringi");
-
     ok = print_wflinfo(&opts);
     if (!ok)
         error_waffle();
-- 
2.2.0.rc0.207.ga3a616c

_______________________________________________
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to