[Piglit] [PATCH v2] gl30basic: add some extra suspected extension

Brian Paul brianp at vmware.com
Thu Apr 27 14:20:08 UTC 2017

On 04/27/2017 05:04 AM, Sandra Koroniewska wrote:
> This fixes
> spec/gl30basic test on Windows Intel or Nvidia driver according to page 693 of openGL 4.4 spec ("In additional to OpenGL extensions, there are also ARB extensions to the related GLX and WGL APIs.").
> ---
>   tests/general/gl30basic.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> diff --git a/tests/general/gl30basic.c b/tests/general/gl30basic.c
> index 2207787bb..08305a6f8 100644
> --- a/tests/general/gl30basic.c
> +++ b/tests/general/gl30basic.c
> @@ -99,8 +99,12 @@ test_extension_list(void)
>             ext[0] != 'G' ||
>             ext[1] != 'L' ||
>             ext[2] != '_') {
> -         printf("%s: bad extension string [%d]: %s\n", Prog, k, ext);
> -         return PIGLIT_FAIL;
> +          if (ext[0] != 'W' ||
> +              ext[1] != 'G' ||
> +              ext[2] != 'L') {
> +              printf("%s: bad extension string [%d]: %s\n", Prog, k, ext);
> +              return PIGLIT_FAIL;
> +          }
>         }
>         if (strchr((char *) ext, ' ')) {
>            printf("%s: extension string [%d] contains a space: %s\n", Prog, k, ext);

Hmm, It looks like NVIDIA's driver does report WGL_EXT_swap_control with 
glGetStringi(GL_EXTENSIONS, i).  That's really weird.  Is that what 
Intel's Windows driver does?

Doing that is actually counter to the extension spec for 
WGL_EXT_swap_control which says:

Dependencies on WGL_EXT_extensions_string

     Because there is no way to extend wgl, these calls are defined in
     the ICD and can be called by obtaining the address with
     wglGetProcAddress.  Because this extension is a WGL extension, it
     is not included in the GL_EXTENSIONS string.  Its existence can be
     determined with the WGL_EXT_extensions_string extension.

     For historical reasons, GL_EXT_SWAP_CONTROL is also included in the
     GL_EXTENSIONS string as return from glGetString.

I believe the last sentence should read "GL_EXT_swap_control" and not 
"GL_EXT_SWAP_CONTROL".  The spec for GL_EXT_swap_control make a vague 
reference to a shortcoming in the WGL extension querying mechanism so 
I'm not sure what the whole store is there.  NVIDIA's driver does not 
support GL_EXT_swap_control AFAICT.

In any case, I think your patch is OK, but let's please put a comment in 
to the effect of:

/* Note: normally, glGetStringi(GL_EXTENSIONS, i) should only return
  * "core" OpenGL extension strings and not window system (WGL/GLX)
  * extensions.  However, NVIDIA's and Intel's Windows drivers include
  * WGL_EXT_swap_control in the core extensions list.  This is a special
  * case for that.


More information about the Piglit mailing list