Commit be8eaddd authored by Emil Velikov's avatar Emil Velikov Committed by Emil Velikov

wflinfo: use glGetStringi() only when available

In some corner cases, we may end up attempting to get the extension list
via the new API, even though we're yet to get function pointer.

Fetching symbols is fun, as can be seen in the beefy comment above the
glGetStringi retrieval.

With this in place, we no longer crash with the following:

  export LIBGL_ALWAYS_SOFTWARE=1
  wflinfo --platform glx --api gl --profile compat --version 3.1
Reported-by: Ben Crocker's avatarBen Crocker <bcrocker@redhat.com>
Signed-off-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
parent 2485a41c
Pipeline #258114 failed with stages
in 1 minute and 17 seconds
...@@ -994,7 +994,11 @@ gl_has_extension_GetStringi(const char *name) ...@@ -994,7 +994,11 @@ gl_has_extension_GetStringi(const char *name)
static bool static bool
gl_has_extension(const char *name) gl_has_extension(const char *name)
{ {
if (gl_get_version() >= 30) { // Use the new glGetStringi when possible.
//
// Due to the funky semantics of obtaining the function pointer, we can
// get here, even when it is NULL.
if (glGetStringi && gl_get_version() >= 30) {
return gl_has_extension_GetStringi(name); return gl_has_extension_GetStringi(name);
} else { } else {
return gl_has_extension_GetString(name); return gl_has_extension_GetString(name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment