Re: [waffle] [PATCH] wflinfo: find glGetStringi on both Mali and WGL

2015-01-28 Thread Jose Fonseca

On 26/01/15 23:25, Frank Henigman wrote:

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://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_waffle-2Dgl_waffle_commit_0543d0d12aa16e0daf361937619998c8995fd6fcd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=jj_3KkjKndz1s137tbSUUg5KMJt2V9GA1zfYN2FD3NMs=MqMB3pPMPv0XARCwxF4eXGARoUaWTUMgtf36lr6r18ke=
and ten days before that Emil had moved the offending 
waffle_get_proc_address(glGetStringi) down about 20 lines:
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_waffle-2Dgl_waffle_commit_6ae99a4701bd5117a182c2e555a0c0a2061254d3d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=jj_3KkjKndz1s137tbSUUg5KMJt2V9GA1zfYN2FD3NMs=nva4AmJVhqxaYMvR3ci1RRFczSckPxLwyQrku1kjGkge=
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,
+};


After this change, MSVC 2013 started to fail with:

[1/3] Building C object src\utils\CMakeFiles\wflinfo.dir\wflinfo.c.obj
FAILED: C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe   /nologo /DWIN32 
/D_WINDOWS /W3 /MT /O1 /Ob1 /D NDEBUG -I..\include -I..\include\waffle 
-I..\src -I..\third_party\threads -I..\third_party\getopt /showIncludes 
-DWAFFLE_HAS_WGL -DWINVER=0x0601 -D_CRT_NONSTDC_NO_WARNINGS 
-D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x0601 
/Fosrc\utils\CMakeFiles\wflinfo.dir\wflinfo.c.obj 
/Fdsrc\utils\CMakeFiles\wflinfo.dir/ /FS -c ..\src\utils\wflinfo.c
..\src\utils\wflinfo.c(1079) : error C2143: syntax error : missing ';' 
before 'const'
..\src\utils\wflinfo.c(1088) : error C2065: 'config_attrs' : undeclared 
identifier
..\src\utils\wflinfo.c(1088) : error C2440: 'function' : cannot convert 
from 'int' to 'wflinfo_config_attrs'
..\src\utils\wflinfo.c(1088) : warning C4024: 'wflinfo_create_context' : 
different types for formal and actual parameter 2



But this change makes MSVC happy:

diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
index 5e173b7..30d04cd 100644
--- a/src/utils/wflinfo.c
+++ b/src/utils/wflinfo.c
@@ -1073,8 +1073,9 @@ main(int argc, char **argv)
 error_get_gl_symbol(glGetIntegerv);

 glGetString = waffle_dl_sym(opts.dl, glGetString);
-if (!glGetString)
+if (!glGetString) {
 error_get_gl_symbol(glGetString);
+}

 const struct wflinfo_config_attrs config_attrs = {
 .api = opts.context_api,


That is, there's a bug in MSVC 2013 C99 grammar/parser...

Jose


+
+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();



___
waffle mailing list
waffle@lists.freedesktop.org

Re: [waffle] [PATCH] wflinfo: find glGetStringi on both Mali and WGL

2015-01-27 Thread Emil Velikov
On 26 January 2015 at 23:25, Frank Henigman fjhenig...@google.com wrote:
 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
Reviewed-by: Emil Velikov emil.l.veli...@gmail.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.

The offending commit is based on top of the commit prior to the WGL
branch merge. So I'm guessing that either git did not notice the
change and/of Chad was tired as he pushed the Mali fix.

Frank I take it that Mali works with this change, whereas for Windows
I'm 99.99% certain it'll be fine.

Cheers,
Emil
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH] wflinfo: find glGetStringi on both Mali and WGL

2015-01-27 Thread Chad Versace
On 01/26/2015 03:25 PM, Frank Henigman wrote:
 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.
 
  src/utils/wflinfo.c | 40 +++-
  1 file changed, 19 insertions(+), 21 deletions(-)

LGTM
Reviewed-by: Chad Versace chad.vers...@intel.com

This will land in maint-1.5 and master later today.



signature.asc
Description: OpenPGP digital signature
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


[waffle] [PATCH] wflinfo: find glGetStringi on both Mali and WGL

2015-01-26 Thread Frank Henigman
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