[Mesa-dev,2/2] wglinfo: query and report multisample information

Submitted by Brian Paul on June 9, 2014, 12:26 p.m.

Details

Message ID 1402316813-3867-2-git-send-email-brianp@vmware.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Brian Paul June 9, 2014, 12:26 p.m.
Before, we always reported zeros in the multisample columns of the
format list.  Since PIXELFORMATDESCRIPTOR doesn't have fields for
multisample, we use a new format_info structure to extend that type.
---
 src/wgl/wglinfo.c |  145 +++++++++++++++++++++++++++++++++--------------------
 1 file changed, 91 insertions(+), 54 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/wgl/wglinfo.c b/src/wgl/wglinfo.c
index 2b2c921..76478e2 100644
--- a/src/wgl/wglinfo.c
+++ b/src/wgl/wglinfo.c
@@ -50,6 +50,18 @@  typedef enum
 } InfoMode;
 
 
+static GLboolean have_WGL_ARB_pixel_format;
+static GLboolean have_WGL_ARB_multisample;
+
+
+/**
+ * An extension of PIXELFORMATDESCRIPTOR to handle multisample, etc.
+ */
+struct format_info {
+   PIXELFORMATDESCRIPTOR pfd;
+   unsigned sampleBuffers, numSamples;
+};
+
 
 static LRESULT CALLBACK
 WndProc(HWND hWnd,
@@ -159,6 +171,12 @@  print_screen_info(HDC _hdc, GLboolean limits, GLboolean singleLine)
             printf("WGL extensions:\n");
             print_extension_list(wglExtensions, singleLine);
          }
+         if (extension_supported("WGL_ARB_pixel_format", wglExtensions)) {
+            have_WGL_ARB_pixel_format = GL_TRUE;
+         }
+         if (extension_supported("WGL_ARB_multisample", wglExtensions)) {
+            have_WGL_ARB_multisample = GL_TRUE;
+         }
       }
 #endif
       printf("OpenGL vendor string: %s\n", glVendor);
@@ -208,27 +226,27 @@  visual_render_type_name(BYTE iPixelType)
 }
 
 static void
-print_visual_attribs_verbose(int iPixelFormat, LPPIXELFORMATDESCRIPTOR ppfd)
+print_visual_attribs_verbose(int iPixelFormat, const struct format_info *info)
 {
    printf("Visual ID: %x  generic=%d  native=%d\n",
           iPixelFormat, 
-          ppfd->dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
-          ppfd->dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0);
+          info->pfd.dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
+          info->pfd.dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0);
    printf("    bufferSize=%d level=%d renderType=%s doubleBuffer=%d stereo=%d\n",
-          0 /* ppfd->bufferSize */, 0 /* ppfd->level */,
-	  visual_render_type_name(ppfd->iPixelType),
-          ppfd->dwFlags & PFD_DOUBLEBUFFER ? 1 : 0, 
-          ppfd->dwFlags & PFD_STEREO ? 1 : 0);
+          0 /* info->pfd.bufferSize */, 0 /* info->pfd.level */,
+	  visual_render_type_name(info->pfd.iPixelType),
+          info->pfd.dwFlags & PFD_DOUBLEBUFFER ? 1 : 0, 
+          info->pfd.dwFlags & PFD_STEREO ? 1 : 0);
    printf("    rgba: cRedBits=%d cGreenBits=%d cBlueBits=%d cAlphaBits=%d\n",
-          ppfd->cRedBits, ppfd->cGreenBits,
-          ppfd->cBlueBits, ppfd->cAlphaBits);
+          info->pfd.cRedBits, info->pfd.cGreenBits,
+          info->pfd.cBlueBits, info->pfd.cAlphaBits);
    printf("    cAuxBuffers=%d cDepthBits=%d cStencilBits=%d\n",
-          ppfd->cAuxBuffers, ppfd->cDepthBits, ppfd->cStencilBits);
+          info->pfd.cAuxBuffers, info->pfd.cDepthBits, info->pfd.cStencilBits);
    printf("    accum: cRedBits=%d cGreenBits=%d cBlueBits=%d cAlphaBits=%d\n",
-          ppfd->cAccumRedBits, ppfd->cAccumGreenBits,
-          ppfd->cAccumBlueBits, ppfd->cAccumAlphaBits);
+          info->pfd.cAccumRedBits, info->pfd.cAccumGreenBits,
+          info->pfd.cAccumBlueBits, info->pfd.cAccumAlphaBits);
    printf("    multiSample=%d  multiSampleBuffers=%d\n",
-          0 /* ppfd->numSamples */, 0 /* ppfd->numMultisample */);
+          info->numSamples, info->sampleBuffers);
 }
 
 
@@ -242,32 +260,32 @@  print_visual_attribs_short_header(void)
 
 
 static void
-print_visual_attribs_short(int iPixelFormat, LPPIXELFORMATDESCRIPTOR ppfd)
+print_visual_attribs_short(int iPixelFormat, const struct format_info *info)
 {
    char *caveat = "None";
 
    printf("0x%02x %2d  %2d %2d %2d %2d %c%c %c  %c %2d %2d %2d %2d %2d %2d %2d",
           iPixelFormat,
-          ppfd->dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
-          ppfd->dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
+          info->pfd.dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
+          info->pfd.dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
           0,
-          0 /* ppfd->bufferSize */,
-          0 /* ppfd->level */,
-          ppfd->iPixelType == PFD_TYPE_RGBA ? 'r' : ' ',
-          ppfd->iPixelType == PFD_TYPE_COLORINDEX ? 'c' : ' ',
-          ppfd->dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.',
-          ppfd->dwFlags & PFD_STEREO ? 'y' : '.',
-          ppfd->cRedBits, ppfd->cGreenBits,
-          ppfd->cBlueBits, ppfd->cAlphaBits,
-          ppfd->cAuxBuffers,
-          ppfd->cDepthBits,
-          ppfd->cStencilBits
+          0 /* info->pfd.bufferSize */,
+          0 /* info->pfd.level */,
+          info->pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : ' ',
+          info->pfd.iPixelType == PFD_TYPE_COLORINDEX ? 'c' : ' ',
+          info->pfd.dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.',
+          info->pfd.dwFlags & PFD_STEREO ? 'y' : '.',
+          info->pfd.cRedBits, info->pfd.cGreenBits,
+          info->pfd.cBlueBits, info->pfd.cAlphaBits,
+          info->pfd.cAuxBuffers,
+          info->pfd.cDepthBits,
+          info->pfd.cStencilBits
           );
 
    printf(" %2d %2d %2d %2d %2d %1d %s\n",
-          ppfd->cAccumRedBits, ppfd->cAccumGreenBits,
-          ppfd->cAccumBlueBits, ppfd->cAccumAlphaBits,
-          0 /* ppfd->numSamples */, 0 /* ppfd->numMultisample */,
+          info->pfd.cAccumRedBits, info->pfd.cAccumGreenBits,
+          info->pfd.cAccumBlueBits, info->pfd.cAccumAlphaBits,
+          info->sampleBuffers, info->numSamples,
           caveat
           );
 }
@@ -283,29 +301,29 @@  print_visual_attribs_long_header(void)
 
 
 static void
-print_visual_attribs_long(int iPixelFormat, LPPIXELFORMATDESCRIPTOR ppfd)
+print_visual_attribs_long(int iPixelFormat, const struct format_info *info)
 {
    printf("0x%2x %2d %11d %2d     %2d %2d  %4s %3d %3d %3d %3d %3d %3d",
           iPixelFormat,
-          ppfd->dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
-          ppfd->dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
+          info->pfd.dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
+          info->pfd.dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
           0,
-          0 /* ppfd->bufferSize */,
-          0 /* ppfd->level */,
-          visual_render_type_name(ppfd->iPixelType),
-          ppfd->dwFlags & PFD_DOUBLEBUFFER ? 1 : 0,
-          ppfd->dwFlags & PFD_STEREO ? 1 : 0,
-          ppfd->cRedBits, ppfd->cGreenBits,
-          ppfd->cBlueBits, ppfd->cAlphaBits
+          0 /* info->pfd.bufferSize */,
+          0 /* info->pfd.level */,
+          visual_render_type_name(info->pfd.iPixelType),
+          info->pfd.dwFlags & PFD_DOUBLEBUFFER ? 1 : 0,
+          info->pfd.dwFlags & PFD_STEREO ? 1 : 0,
+          info->pfd.cRedBits, info->pfd.cGreenBits,
+          info->pfd.cBlueBits, info->pfd.cAlphaBits
           );
 
    printf(" %3d %4d %2d %3d %3d %3d %3d  %2d  %2d\n",
-          ppfd->cAuxBuffers,
-          ppfd->cDepthBits,
-          ppfd->cStencilBits,
-          ppfd->cAccumRedBits, ppfd->cAccumGreenBits,
-          ppfd->cAccumBlueBits, ppfd->cAccumAlphaBits,
-          0 /* ppfd->numSamples */, 0 /* ppfd->numMultisample */
+          info->pfd.cAuxBuffers,
+          info->pfd.cDepthBits,
+          info->pfd.cStencilBits,
+          info->pfd.cAccumRedBits, info->pfd.cAccumGreenBits,
+          info->pfd.cAccumBlueBits, info->pfd.cAccumAlphaBits,
+          info->sampleBuffers, info->numSamples
           );
 }
 
@@ -313,20 +331,25 @@  print_visual_attribs_long(int iPixelFormat, LPPIXELFORMATDESCRIPTOR ppfd)
 static void
 print_visual_info(HDC hdc, InfoMode mode)
 {
-   PIXELFORMATDESCRIPTOR pfd;
+   PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB_func;
+   struct format_info info;
    int numVisuals, numWglVisuals;
    int i;
 
+   wglGetPixelFormatAttribivARB_func =
+      (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)
+      wglGetProcAddress("wglGetPixelFormatAttribivARB");
+
    numVisuals = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL);
    if (numVisuals == 0)
       return;
 
    numWglVisuals = 0;
    for (i = 0; i < numVisuals; i++) {
-      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd))
+      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &info.pfd))
 	 continue;
 
-      //if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL))
+      //if(!(info.pfd.dwFlags & PFD_SUPPORT_OPENGL))
       //   continue;
 
       ++numWglVisuals;
@@ -340,18 +363,32 @@  print_visual_info(HDC hdc, InfoMode mode)
       print_visual_attribs_long_header();
 
    for (i = 0; i < numVisuals; i++) {
-      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd))
+      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &info.pfd))
 	 continue;
 
-      //if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL))
+      //if(!(info.pfd.dwFlags & PFD_SUPPORT_OPENGL))
       //   continue;
 
+      if (have_WGL_ARB_pixel_format && have_WGL_ARB_multisample) {
+         int attribs[] = { WGL_SAMPLE_BUFFERS_ARB, WGL_SAMPLES_ARB };
+         int values[2], layer = 0;
+         if (wglGetPixelFormatAttribivARB_func(hdc, i, layer,
+                                               2, attribs, values)) {
+            info.sampleBuffers = values[0];
+            info.numSamples = values[1];
+         }
+         else {
+            info.sampleBuffers = 0;
+            info.numSamples = 0;
+         }
+      }
+
       if (mode == Verbose)
-	 print_visual_attribs_verbose(i, &pfd);
+	 print_visual_attribs_verbose(i, &info);
       else if (mode == Normal)
-         print_visual_attribs_short(i, &pfd);
+         print_visual_attribs_short(i, &info);
       else if (mode == Wide) 
-         print_visual_attribs_long(i, &pfd);
+         print_visual_attribs_long(i, &info);
    }
    printf("\n");
 }

Comments

I don't think that OpenGL ICD should advertise multi-sample formats via the standard DescribePixelFormat.  http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states:

    Indices are assigned to pixel formats in the following order:

    1. Accelerated pixel formats that are displayable

    2. Accelerated pixel formats that are displayable and which have
       extended attributes

    3. Generic pixel formats

    4. Accelerated pixel formats that are non displayable

    ChoosePixelFormat will never select pixel formats from either group
    2 or group 4. Each pixel format in group 2 is required to appear
    identical to some pixel format in group 1 when queried by
    DescribePixelFormat. Consequently, ChoosePixelFormat will always
    select a format from group 1 when it might otherwise have selected a
    format from group 2. Pixel formats in group 4 cannot be accessed by
    ChoosePixelFormat at all.

That is, IIUC, in order to discover multi-sampled formats one must get the the number of pixel formats via wglGetPixelFormatAttribivARB(WGL_NUMBER_PIXEL_FORMATS_ARB) instead of 

   numVisuals = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL);
   if (numVisuals == 0)
      return;

And I'm not even sure if it is OK to call DescribePixelFormat() with extended pixel formats or if one must use exclusively wglGetPixelFormatAttribivARB/wglGetPixelFormatAttribivARB.  You can see how GLFW does it on https://github.com/glfw/glfw/blob/master/src/wgl_context.c#L144

Jose


----- Original Message -----
> Before, we always reported zeros in the multisample columns of the
> format list.  Since PIXELFORMATDESCRIPTOR doesn't have fields for
> multisample, we use a new format_info structure to extend that type.
> ---
>  src/wgl/wglinfo.c |  145
>  +++++++++++++++++++++++++++++++++--------------------
>  1 file changed, 91 insertions(+), 54 deletions(-)
> 
> diff --git a/src/wgl/wglinfo.c b/src/wgl/wglinfo.c
> index 2b2c921..76478e2 100644
> --- a/src/wgl/wglinfo.c
> +++ b/src/wgl/wglinfo.c
> @@ -50,6 +50,18 @@ typedef enum
>  } InfoMode;
>  
>  
> +static GLboolean have_WGL_ARB_pixel_format;
> +static GLboolean have_WGL_ARB_multisample;
> +
> +
> +/**
> + * An extension of PIXELFORMATDESCRIPTOR to handle multisample, etc.
> + */
> +struct format_info {
> +   PIXELFORMATDESCRIPTOR pfd;
> +   unsigned sampleBuffers, numSamples;
> +};
> +
>  
>  static LRESULT CALLBACK
>  WndProc(HWND hWnd,
> @@ -159,6 +171,12 @@ print_screen_info(HDC _hdc, GLboolean limits, GLboolean
> singleLine)
>              printf("WGL extensions:\n");
>              print_extension_list(wglExtensions, singleLine);
>           }
> +         if (extension_supported("WGL_ARB_pixel_format", wglExtensions)) {
> +            have_WGL_ARB_pixel_format = GL_TRUE;
> +         }
> +         if (extension_supported("WGL_ARB_multisample", wglExtensions)) {
> +            have_WGL_ARB_multisample = GL_TRUE;
> +         }
>        }
>  #endif
>        printf("OpenGL vendor string: %s\n", glVendor);
> @@ -208,27 +226,27 @@ visual_render_type_name(BYTE iPixelType)
>  }
>  
>  static void
> -print_visual_attribs_verbose(int iPixelFormat, LPPIXELFORMATDESCRIPTOR ppfd)
> +print_visual_attribs_verbose(int iPixelFormat, const struct format_info
> *info)
>  {
>     printf("Visual ID: %x  generic=%d  native=%d\n",
>            iPixelFormat,
> -          ppfd->dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
> -          ppfd->dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0);
> +          info->pfd.dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
> +          info->pfd.dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0);
>     printf("    bufferSize=%d level=%d renderType=%s doubleBuffer=%d
>     stereo=%d\n",
> -          0 /* ppfd->bufferSize */, 0 /* ppfd->level */,
> -	  visual_render_type_name(ppfd->iPixelType),
> -          ppfd->dwFlags & PFD_DOUBLEBUFFER ? 1 : 0,
> -          ppfd->dwFlags & PFD_STEREO ? 1 : 0);
> +          0 /* info->pfd.bufferSize */, 0 /* info->pfd.level */,
> +	  visual_render_type_name(info->pfd.iPixelType),
> +          info->pfd.dwFlags & PFD_DOUBLEBUFFER ? 1 : 0,
> +          info->pfd.dwFlags & PFD_STEREO ? 1 : 0);
>     printf("    rgba: cRedBits=%d cGreenBits=%d cBlueBits=%d
>     cAlphaBits=%d\n",
> -          ppfd->cRedBits, ppfd->cGreenBits,
> -          ppfd->cBlueBits, ppfd->cAlphaBits);
> +          info->pfd.cRedBits, info->pfd.cGreenBits,
> +          info->pfd.cBlueBits, info->pfd.cAlphaBits);
>     printf("    cAuxBuffers=%d cDepthBits=%d cStencilBits=%d\n",
> -          ppfd->cAuxBuffers, ppfd->cDepthBits, ppfd->cStencilBits);
> +          info->pfd.cAuxBuffers, info->pfd.cDepthBits,
> info->pfd.cStencilBits);
>     printf("    accum: cRedBits=%d cGreenBits=%d cBlueBits=%d
>     cAlphaBits=%d\n",
> -          ppfd->cAccumRedBits, ppfd->cAccumGreenBits,
> -          ppfd->cAccumBlueBits, ppfd->cAccumAlphaBits);
> +          info->pfd.cAccumRedBits, info->pfd.cAccumGreenBits,
> +          info->pfd.cAccumBlueBits, info->pfd.cAccumAlphaBits);
>     printf("    multiSample=%d  multiSampleBuffers=%d\n",
> -          0 /* ppfd->numSamples */, 0 /* ppfd->numMultisample */);
> +          info->numSamples, info->sampleBuffers);
>  }
>  
>  
> @@ -242,32 +260,32 @@ print_visual_attribs_short_header(void)
>  
>  
>  static void
> -print_visual_attribs_short(int iPixelFormat, LPPIXELFORMATDESCRIPTOR ppfd)
> +print_visual_attribs_short(int iPixelFormat, const struct format_info *info)
>  {
>     char *caveat = "None";
>  
>     printf("0x%02x %2d  %2d %2d %2d %2d %c%c %c  %c %2d %2d %2d %2d %2d %2d
>     %2d",
>            iPixelFormat,
> -          ppfd->dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
> -          ppfd->dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
> +          info->pfd.dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
> +          info->pfd.dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
>            0,
> -          0 /* ppfd->bufferSize */,
> -          0 /* ppfd->level */,
> -          ppfd->iPixelType == PFD_TYPE_RGBA ? 'r' : ' ',
> -          ppfd->iPixelType == PFD_TYPE_COLORINDEX ? 'c' : ' ',
> -          ppfd->dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.',
> -          ppfd->dwFlags & PFD_STEREO ? 'y' : '.',
> -          ppfd->cRedBits, ppfd->cGreenBits,
> -          ppfd->cBlueBits, ppfd->cAlphaBits,
> -          ppfd->cAuxBuffers,
> -          ppfd->cDepthBits,
> -          ppfd->cStencilBits
> +          0 /* info->pfd.bufferSize */,
> +          0 /* info->pfd.level */,
> +          info->pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : ' ',
> +          info->pfd.iPixelType == PFD_TYPE_COLORINDEX ? 'c' : ' ',
> +          info->pfd.dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.',
> +          info->pfd.dwFlags & PFD_STEREO ? 'y' : '.',
> +          info->pfd.cRedBits, info->pfd.cGreenBits,
> +          info->pfd.cBlueBits, info->pfd.cAlphaBits,
> +          info->pfd.cAuxBuffers,
> +          info->pfd.cDepthBits,
> +          info->pfd.cStencilBits
>            );
>  
>     printf(" %2d %2d %2d %2d %2d %1d %s\n",
> -          ppfd->cAccumRedBits, ppfd->cAccumGreenBits,
> -          ppfd->cAccumBlueBits, ppfd->cAccumAlphaBits,
> -          0 /* ppfd->numSamples */, 0 /* ppfd->numMultisample */,
> +          info->pfd.cAccumRedBits, info->pfd.cAccumGreenBits,
> +          info->pfd.cAccumBlueBits, info->pfd.cAccumAlphaBits,
> +          info->sampleBuffers, info->numSamples,
>            caveat
>            );
>  }
> @@ -283,29 +301,29 @@ print_visual_attribs_long_header(void)
>  
>  
>  static void
> -print_visual_attribs_long(int iPixelFormat, LPPIXELFORMATDESCRIPTOR ppfd)
> +print_visual_attribs_long(int iPixelFormat, const struct format_info *info)
>  {
>     printf("0x%2x %2d %11d %2d     %2d %2d  %4s %3d %3d %3d %3d %3d %3d",
>            iPixelFormat,
> -          ppfd->dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
> -          ppfd->dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
> +          info->pfd.dwFlags & PFD_GENERIC_FORMAT ? 1 : 0,
> +          info->pfd.dwFlags & PFD_DRAW_TO_WINDOW ? 1 : 0,
>            0,
> -          0 /* ppfd->bufferSize */,
> -          0 /* ppfd->level */,
> -          visual_render_type_name(ppfd->iPixelType),
> -          ppfd->dwFlags & PFD_DOUBLEBUFFER ? 1 : 0,
> -          ppfd->dwFlags & PFD_STEREO ? 1 : 0,
> -          ppfd->cRedBits, ppfd->cGreenBits,
> -          ppfd->cBlueBits, ppfd->cAlphaBits
> +          0 /* info->pfd.bufferSize */,
> +          0 /* info->pfd.level */,
> +          visual_render_type_name(info->pfd.iPixelType),
> +          info->pfd.dwFlags & PFD_DOUBLEBUFFER ? 1 : 0,
> +          info->pfd.dwFlags & PFD_STEREO ? 1 : 0,
> +          info->pfd.cRedBits, info->pfd.cGreenBits,
> +          info->pfd.cBlueBits, info->pfd.cAlphaBits
>            );
>  
>     printf(" %3d %4d %2d %3d %3d %3d %3d  %2d  %2d\n",
> -          ppfd->cAuxBuffers,
> -          ppfd->cDepthBits,
> -          ppfd->cStencilBits,
> -          ppfd->cAccumRedBits, ppfd->cAccumGreenBits,
> -          ppfd->cAccumBlueBits, ppfd->cAccumAlphaBits,
> -          0 /* ppfd->numSamples */, 0 /* ppfd->numMultisample */
> +          info->pfd.cAuxBuffers,
> +          info->pfd.cDepthBits,
> +          info->pfd.cStencilBits,
> +          info->pfd.cAccumRedBits, info->pfd.cAccumGreenBits,
> +          info->pfd.cAccumBlueBits, info->pfd.cAccumAlphaBits,
> +          info->sampleBuffers, info->numSamples
>            );
>  }
>  
> @@ -313,20 +331,25 @@ print_visual_attribs_long(int iPixelFormat,
> LPPIXELFORMATDESCRIPTOR ppfd)
>  static void
>  print_visual_info(HDC hdc, InfoMode mode)
>  {
> -   PIXELFORMATDESCRIPTOR pfd;
> +   PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB_func;
> +   struct format_info info;
>     int numVisuals, numWglVisuals;
>     int i;
>  
> +   wglGetPixelFormatAttribivARB_func =
> +      (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)
> +      wglGetProcAddress("wglGetPixelFormatAttribivARB");
> +
>     numVisuals = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR),
>     NULL);
>     if (numVisuals == 0)
>        return;
>  
>     numWglVisuals = 0;
>     for (i = 0; i < numVisuals; i++) {
> -      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd))
> +      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR),
> &info.pfd))
>  	 continue;
>  
> -      //if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL))
> +      //if(!(info.pfd.dwFlags & PFD_SUPPORT_OPENGL))
>        //   continue;
>  
>        ++numWglVisuals;
> @@ -340,18 +363,32 @@ print_visual_info(HDC hdc, InfoMode mode)
>        print_visual_attribs_long_header();
>  
>     for (i = 0; i < numVisuals; i++) {
> -      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd))
> +      if(!DescribePixelFormat(hdc, i, sizeof(PIXELFORMATDESCRIPTOR),
> &info.pfd))
>  	 continue;
>  
> -      //if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL))
> +      //if(!(info.pfd.dwFlags & PFD_SUPPORT_OPENGL))
>        //   continue;
>  
> +      if (have_WGL_ARB_pixel_format && have_WGL_ARB_multisample) {
> +         int attribs[] = { WGL_SAMPLE_BUFFERS_ARB, WGL_SAMPLES_ARB };
> +         int values[2], layer = 0;
> +         if (wglGetPixelFormatAttribivARB_func(hdc, i, layer,
> +                                               2, attribs, values)) {
> +            info.sampleBuffers = values[0];
> +            info.numSamples = values[1];
> +         }
> +         else {
> +            info.sampleBuffers = 0;
> +            info.numSamples = 0;
> +         }
> +      }
> +
>        if (mode == Verbose)
> -	 print_visual_attribs_verbose(i, &pfd);
> +	 print_visual_attribs_verbose(i, &info);
>        else if (mode == Normal)
> -         print_visual_attribs_short(i, &pfd);
> +         print_visual_attribs_short(i, &info);
>        else if (mode == Wide)
> -         print_visual_attribs_long(i, &pfd);
> +         print_visual_attribs_long(i, &info);
>     }
>     printf("\n");
>  }
> --
> 1.7.10.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=mIR8V6P%2FYoxEbnhUZudn2DC8YBTiHYlMkU%2FRwIHNl6I%3D%0A&s=62e7dd68a5ab08412f68fbcd48475f3f35c3aa10cd4290d53f30b4632ab3b800
> 

Series is

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
On 06/09/2014 07:22 AM, Jose Fonseca wrote:
> I don't think that OpenGL ICD should advertise multi-sample formats via the standard DescribePixelFormat.  http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states:
>
>      Indices are assigned to pixel formats in the following order:
>
>      1. Accelerated pixel formats that are displayable
>
>      2. Accelerated pixel formats that are displayable and which have
>         extended attributes
>
>      3. Generic pixel formats
>
>      4. Accelerated pixel formats that are non displayable
>
>      ChoosePixelFormat will never select pixel formats from either group
>      2 or group 4. Each pixel format in group 2 is required to appear
>      identical to some pixel format in group 1 when queried by
>      DescribePixelFormat. Consequently, ChoosePixelFormat will always
>      select a format from group 1 when it might otherwise have selected a
>      format from group 2. Pixel formats in group 4 cannot be accessed by
>      ChoosePixelFormat at all.
>
> That is, IIUC, in order to discover multi-sampled formats one must get the the number of pixel formats via wglGetPixelFormatAttribivARB(WGL_NUMBER_PIXEL_FORMATS_ARB) instead of
>
>     numVisuals = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL);
>     if (numVisuals == 0)
>        return;
>
> And I'm not even sure if it is OK to call DescribePixelFormat() with extended pixel formats or if one must use exclusively wglGetPixelFormatAttribivARB/wglGetPixelFormatAttribivARB.  You can see how GLFW does it on https://github.com/glfw/glfw/blob/master/src/wgl_context.c#L144

Nothing's ever easy on Windows. <sigh>

The code as-is seems to work fine both on a Windows/nvidia host and in 
the guest but I'll try the changes you suggested...

-Brian
----- Original Message -----
> On 06/09/2014 07:22 AM, Jose Fonseca wrote:
> > I don't think that OpenGL ICD should advertise multi-sample formats via the
> > standard DescribePixelFormat.
> > http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states:
> >
> >      Indices are assigned to pixel formats in the following order:
> >
> >      1. Accelerated pixel formats that are displayable
> >
> >      2. Accelerated pixel formats that are displayable and which have
> >         extended attributes
> >
> >      3. Generic pixel formats
> >
> >      4. Accelerated pixel formats that are non displayable
> >
> >      ChoosePixelFormat will never select pixel formats from either group
> >      2 or group 4. Each pixel format in group 2 is required to appear
> >      identical to some pixel format in group 1 when queried by
> >      DescribePixelFormat. Consequently, ChoosePixelFormat will always
> >      select a format from group 1 when it might otherwise have selected a
> >      format from group 2. Pixel formats in group 4 cannot be accessed by
> >      ChoosePixelFormat at all.
> >
> > That is, IIUC, in order to discover multi-sampled formats one must get the
> > the number of pixel formats via
> > wglGetPixelFormatAttribivARB(WGL_NUMBER_PIXEL_FORMATS_ARB) instead of
> >
> >     numVisuals = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR),
> >     NULL);
> >     if (numVisuals == 0)
> >        return;
> >
> > And I'm not even sure if it is OK to call DescribePixelFormat() with
> > extended pixel formats or if one must use exclusively
> > wglGetPixelFormatAttribivARB/wglGetPixelFormatAttribivARB.  You can see
> > how GLFW does it on
> > https://github.com/glfw/glfw/blob/master/src/wgl_context.c#L144
> 
> Nothing's ever easy on Windows. <sigh>

No. OPENGL32.DLL interface 

> The code as-is seems to work fine both on a Windows/nvidia host and in
> the guest but I'll try the changes you suggested...

Is wglinfo displaying multi-sampled pixelformats on NVIDIA as is?  If so then my interpretation might be wrong somehow.


Jose
On 06/09/2014 11:38 AM, Jose Fonseca wrote:
>
>
> ----- Original Message -----
>> On 06/09/2014 07:22 AM, Jose Fonseca wrote:
>>> I don't think that OpenGL ICD should advertise multi-sample formats via the
>>> standard DescribePixelFormat.
>>> http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states:
>>>
>>>       Indices are assigned to pixel formats in the following order:
>>>
>>>       1. Accelerated pixel formats that are displayable
>>>
>>>       2. Accelerated pixel formats that are displayable and which have
>>>          extended attributes
>>>
>>>       3. Generic pixel formats
>>>
>>>       4. Accelerated pixel formats that are non displayable
>>>
>>>       ChoosePixelFormat will never select pixel formats from either group
>>>       2 or group 4. Each pixel format in group 2 is required to appear
>>>       identical to some pixel format in group 1 when queried by
>>>       DescribePixelFormat. Consequently, ChoosePixelFormat will always
>>>       select a format from group 1 when it might otherwise have selected a
>>>       format from group 2. Pixel formats in group 4 cannot be accessed by
>>>       ChoosePixelFormat at all.
>>>
>>> That is, IIUC, in order to discover multi-sampled formats one must get the
>>> the number of pixel formats via
>>> wglGetPixelFormatAttribivARB(WGL_NUMBER_PIXEL_FORMATS_ARB) instead of
>>>
>>>      numVisuals = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR),
>>>      NULL);
>>>      if (numVisuals == 0)
>>>         return;
>>>
>>> And I'm not even sure if it is OK to call DescribePixelFormat() with
>>> extended pixel formats or if one must use exclusively
>>> wglGetPixelFormatAttribivARB/wglGetPixelFormatAttribivARB.  You can see
>>> how GLFW does it on
>>> https://github.com/glfw/glfw/blob/master/src/wgl_context.c#L144
>>
>> Nothing's ever easy on Windows. <sigh>
>
> No. OPENGL32.DLL interface
>
>> The code as-is seems to work fine both on a Windows/nvidia host and in
>> the guest but I'll try the changes you suggested...
>
> Is wglinfo displaying multi-sampled pixelformats on NVIDIA as is?  If so then my interpretation might be wrong somehow.

Yes.  I'm attaching the output of wglinfo on a windows/nvidia host w/ 
the patch in question.

-Brian
WGL extensions:
    WGL_ARB_buffer_region, WGL_ARB_create_context, 
    WGL_ARB_create_context_profile, WGL_ARB_create_context_robustness, 
    WGL_ARB_extensions_string, WGL_ARB_make_current_read, WGL_ARB_multisample, 
    WGL_ARB_pbuffer, WGL_ARB_pixel_format, WGL_ARB_pixel_format_float, 
    WGL_ARB_render_texture, WGL_ATI_pixel_format_float, 
    WGL_EXT_create_context_es2_profile, WGL_EXT_create_context_es_profile, 
    WGL_EXT_extensions_string, WGL_EXT_framebuffer_sRGB, 
    WGL_EXT_pixel_format_packed_float, WGL_EXT_swap_control, 
    WGL_EXT_swap_control_tear, WGL_NVX_DX_interop, WGL_NV_DX_interop, 
    WGL_NV_DX_interop2, WGL_NV_copy_image, WGL_NV_delay_before_swap, 
    WGL_NV_float_buffer, WGL_NV_gpu_affinity, WGL_NV_multisample_coverage, 
    WGL_NV_render_depth_texture, WGL_NV_render_texture_rectangle, 
    WGL_NV_swap_group, WGL_NV_video_capture
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro FX 580/PCIe/SSE2
OpenGL version string: 3.3.0
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL extensions:
    GL_ARB_ES2_compatibility, GL_ARB_ES3_compatibility, 
    GL_ARB_arrays_of_arrays, GL_ARB_base_instance, GL_ARB_blend_func_extended, 
    GL_ARB_clear_buffer_object, GL_ARB_color_buffer_float, 
    GL_ARB_compatibility, GL_ARB_compressed_texture_pixel_storage, 
    GL_ARB_conservative_depth, GL_ARB_copy_buffer, GL_ARB_copy_image, 
    GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, 
    GL_ARB_depth_texture, GL_ARB_draw_buffers, 
    GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced, 
    GL_ARB_enhanced_layouts, GL_ARB_explicit_attrib_location, 
    GL_ARB_explicit_uniform_location, GL_ARB_fragment_coord_conventions, 
    GL_ARB_fragment_layer_viewport, GL_ARB_fragment_program, 
    GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, 
    GL_ARB_framebuffer_no_attachments, GL_ARB_framebuffer_object, 
    GL_ARB_framebuffer_sRGB, GL_ARB_geometry_shader4, 
    GL_ARB_get_program_binary, GL_ARB_half_float_pixel, 
    GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_instanced_arrays, 
    GL_ARB_internalformat_query, GL_ARB_internalformat_query2, 
    GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, 
    GL_ARB_map_buffer_range, GL_ARB_multi_bind, GL_ARB_multisample, 
    GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_occlusion_query2, 
    GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, 
    GL_ARB_program_interface_query, GL_ARB_provoking_vertex, 
    GL_ARB_robust_buffer_access_behavior, GL_ARB_robustness, 
    GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, 
    GL_ARB_separate_shader_objects, GL_ARB_shader_bit_encoding, 
    GL_ARB_shader_objects, GL_ARB_shader_texture_lod, 
    GL_ARB_shading_language_100, GL_ARB_shading_language_420pack, 
    GL_ARB_shading_language_include, GL_ARB_shading_language_packing, 
    GL_ARB_shadow, GL_ARB_stencil_texturing, GL_ARB_sync, 
    GL_ARB_texture_border_clamp, GL_ARB_texture_buffer_object, 
    GL_ARB_texture_buffer_range, GL_ARB_texture_compression, 
    GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map, 
    GL_ARB_texture_env_add, GL_ARB_texture_env_combine, 
    GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, 
    GL_ARB_texture_float, GL_ARB_texture_mirror_clamp_to_edge, 
    GL_ARB_texture_mirrored_repeat, GL_ARB_texture_multisample, 
    GL_ARB_texture_non_power_of_two, GL_ARB_texture_query_levels, 
    GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_rgb10_a2ui, 
    GL_ARB_texture_stencil8, GL_ARB_texture_storage, 
    GL_ARB_texture_storage_multisample, GL_ARB_texture_swizzle, 
    GL_ARB_texture_view, GL_ARB_timer_query, GL_ARB_transpose_matrix, 
    GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra, 
    GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_binding, 
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, 
    GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, 
    GL_ARB_viewport_array, GL_ARB_window_pos, GL_ATI_draw_buffers, 
    GL_ATI_texture_float, GL_ATI_texture_mirror_once, 
    GL_EXTX_framebuffer_mixed_formats, GL_EXT_Cg_shader, GL_EXT_abgr, 
    GL_EXT_bgra, GL_EXT_bindable_uniform, GL_EXT_blend_color, 
    GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_compiled_vertex_array, 
    GL_EXT_depth_bounds_test, GL_EXT_direct_state_access, 
    GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_draw_range_elements, 
    GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
    GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, 
    GL_EXT_framebuffer_sRGB, GL_EXT_geometry_shader4, 
    GL_EXT_gpu_program_parameters, GL_EXT_gpu_shader4, 
    GL_EXT_import_sync_object, GL_EXT_multi_draw_arrays, 
    GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels, 
    GL_EXT_pixel_buffer_object, GL_EXT_point_parameters, 
    GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color, 
    GL_EXT_separate_shader_objects, GL_EXT_separate_specular_color, 
    GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, 
    GL_EXT_texture3D, GL_EXT_texture_array, GL_EXT_texture_buffer_object, 
    GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_latc, 
    GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc, 
    GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, 
    GL_EXT_texture_env_add, GL_EXT_texture_env_combine, 
    GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, 
    GL_EXT_texture_integer, GL_EXT_texture_lod, GL_EXT_texture_lod_bias, 
    GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, GL_EXT_texture_sRGB, 
    GL_EXT_texture_sRGB_decode, GL_EXT_texture_shared_exponent, 
    GL_EXT_texture_storage, GL_EXT_texture_swizzle, GL_EXT_timer_query, 
    GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, GL_IBM_rasterpos_clip, 
    GL_IBM_texture_mirrored_repeat, GL_KHR_debug, GL_KTX_buffer_region, 
    GL_NVX_conditional_render, GL_NVX_gpu_memory_info, 
    GL_NV_ES1_1_compatibility, GL_NV_blend_square, GL_NV_conditional_render, 
    GL_NV_copy_depth_to_color, GL_NV_copy_image, GL_NV_depth_buffer_float, 
    GL_NV_depth_clamp, GL_NV_explicit_multisample, GL_NV_fence, 
    GL_NV_float_buffer, GL_NV_fog_distance, GL_NV_fragment_program, 
    GL_NV_fragment_program2, GL_NV_fragment_program_option, 
    GL_NV_framebuffer_multisample_coverage, GL_NV_geometry_shader4, 
    GL_NV_gpu_program4, GL_NV_half_float, GL_NV_light_max_exponent, 
    GL_NV_multisample_coverage, GL_NV_multisample_filter_hint, 
    GL_NV_occlusion_query, GL_NV_packed_depth_stencil, 
    GL_NV_parameter_buffer_object, GL_NV_parameter_buffer_object2, 
    GL_NV_path_rendering, GL_NV_pixel_data_range, GL_NV_point_sprite, 
    GL_NV_primitive_restart, GL_NV_register_combiners, 
    GL_NV_register_combiners2, GL_NV_shader_buffer_load, 
    GL_NV_texgen_reflection, GL_NV_texture_barrier, 
    GL_NV_texture_compression_vtc, GL_NV_texture_env_combine4, 
    GL_NV_texture_expand_normal, GL_NV_texture_multisample, 
    GL_NV_texture_rectangle, GL_NV_texture_shader, GL_NV_texture_shader2, 
    GL_NV_texture_shader3, GL_NV_transform_feedback, GL_NV_vertex_array_range, 
    GL_NV_vertex_array_range2, GL_NV_vertex_buffer_unified_memory, 
    GL_NV_vertex_program, GL_NV_vertex_program1_1, GL_NV_vertex_program2, 
    GL_NV_vertex_program2_option, GL_NV_vertex_program3, GL_S3_s3tc, 
    GL_SGIS_generate_mipmap, GL_SGIS_texture_lod, GL_SGIX_depth_texture, 
    GL_SGIX_shadow, GL_SUN_slice_accum, GL_WIN_swap_hint, 
    WGL_EXT_swap_control

341 WGL Visuals
   visual   x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id gen win sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
-----------------------------------------------------------------------
0x01  0   1  0  0  0 r  .  .  8  8  8  0  4 24  0 16 16 16 16  0 0 None
0x02  0   1  0  0  0 r  .  .  8  8  8  8  4 24  0 16 16 16 16  0 0 None
0x03  0   1  0  0  0 r  .  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0x04  0   1  0  0  0 r  .  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0x05  0   1  0  0  0 r  .  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0x06  0   1  0  0  0 r  .  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0x07  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  0 0 None
0x08  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  0 0 None
0x09  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0x0a  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0x0b  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0x0c  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0x0d  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  0 0 None
0x0e  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  0 0 None
0x0f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0x10  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0x11  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0x12  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0x13  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 2 None
0x14  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 2 None
0x15  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 2 None
0x16  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 2 None
0x17  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 2 None
0x18  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 2 None
0x19  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 2 None
0x1a  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 2 None
0x1b  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 2 None
0x1c  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 2 None
0x1d  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 2 None
0x1e  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 2 None
0x1f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 4 None
0x20  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 4 None
0x21  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 4 None
0x22  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 4 None
0x23  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 4 None
0x24  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 4 None
0x25  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 4 None
0x26  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 4 None
0x27  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 4 None
0x28  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 4 None
0x29  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 4 None
0x2a  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 4 None
0x2b  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0x2c  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0x2d  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0x2e  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0x2f  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 8 None
0x30  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 8 None
0x31  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0x32  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0x33  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0x34  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0x35  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 8 None
0x36  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 8 None
0x37  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x38  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x39  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x3a  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x3b  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 16 None
0x3c  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 16 None
0x3d  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x3e  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x3f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x40  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x41  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 16 None
0x42  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 16 None
0x43  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 32 None
0x44  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 32 None
0x45  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 32 None
0x46  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 32 None
0x47  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 32 None
0x48  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 32 None
0x49  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 32 None
0x4a  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 32 None
0x4b  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 32 None
0x4c  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 32 None
0x4d  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 32 None
0x4e  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 32 None
0x4f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0x50  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0x51  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0x52  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0x53  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0x54  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0x55  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0x56  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0x57  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x58  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x59  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x5a  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x5b  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x5c  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x5d  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x5e  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x5f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x60  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x61  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x62  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x63  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x64  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x65  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x66  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x67  0   1  0  0  0 r  .  . 10 10 10  0  4 24  0 16 16 16 16  0 0 None
0x68  0   1  0  0  0 r  .  . 10 10 10  2  4 24  0 16 16 16 16  0 0 None
0x69  0   1  0  0  0 r  .  . 10 10 10  0  4 24  8 16 16 16 16  0 0 None
0x6a  0   1  0  0  0 r  .  . 10 10 10  2  4 24  8 16 16 16 16  0 0 None
0x6b  0   1  0  0  0 r  .  . 10 10 10  0  4  0  0 16 16 16 16  0 0 None
0x6c  0   1  0  0  0 r  .  . 10 10 10  2  4  0  0 16 16 16 16  0 0 None
0x6d  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  0 0 None
0x6e  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  0 0 None
0x6f  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  0 0 None
0x70  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  0 0 None
0x71  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  0 0 None
0x72  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  0 0 None
0x73  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  0 0 None
0x74  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  0 0 None
0x75  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  0 0 None
0x76  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  0 0 None
0x77  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  0 0 None
0x78  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  0 0 None
0x79  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 2 None
0x7a  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 2 None
0x7b  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 2 None
0x7c  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 2 None
0x7d  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 2 None
0x7e  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 2 None
0x7f  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 2 None
0x80  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 2 None
0x81  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 2 None
0x82  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 2 None
0x83  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 2 None
0x84  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 2 None
0x85  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 4 None
0x86  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 4 None
0x87  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 4 None
0x88  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 4 None
0x89  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 4 None
0x8a  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 4 None
0x8b  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 4 None
0x8c  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 4 None
0x8d  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 4 None
0x8e  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 4 None
0x8f  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 4 None
0x90  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 4 None
0x91  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 8 None
0x92  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 8 None
0x93  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 8 None
0x94  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 8 None
0x95  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 8 None
0x96  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 8 None
0x97  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 8 None
0x98  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 8 None
0x99  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 8 None
0x9a  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 8 None
0x9b  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 8 None
0x9c  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 8 None
0x9d  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 16 None
0x9e  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 16 None
0x9f  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 16 None
0xa0  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 16 None
0xa1  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 16 None
0xa2  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 16 None
0xa3  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 16 None
0xa4  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 16 None
0xa5  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 16 None
0xa6  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 16 None
0xa7  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 16 None
0xa8  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 16 None
0xa9  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 32 None
0xaa  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 32 None
0xab  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 32 None
0xac  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 32 None
0xad  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 32 None
0xae  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 32 None
0xaf  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 32 None
0xb0  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 32 None
0xb1  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 32 None
0xb2  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 32 None
0xb3  0   1  0  0  0 r  y  . 10 10 10  0  4  0  0 16 16 16 16  1 32 None
0xb4  0   1  0  0  0 r  y  . 10 10 10  2  4  0  0 16 16 16 16  1 32 None
0xb5  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 8 None
0xb6  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 8 None
0xb7  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 8 None
0xb8  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 8 None
0xb9  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 8 None
0xba  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 8 None
0xbb  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 8 None
0xbc  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 8 None
0xbd  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 16 None
0xbe  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 16 None
0xbf  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 16 None
0xc0  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 16 None
0xc1  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 16 None
0xc2  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 16 None
0xc3  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 16 None
0xc4  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 16 None
0xc5  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 16 None
0xc6  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 16 None
0xc7  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 16 None
0xc8  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 16 None
0xc9  0   1  0  0  0 r  y  . 10 10 10  0  4 24  0 16 16 16 16  1 16 None
0xca  0   1  0  0  0 r  y  . 10 10 10  2  4 24  0 16 16 16 16  1 16 None
0xcb  0   1  0  0  0 r  y  . 10 10 10  0  4 24  8 16 16 16 16  1 16 None
0xcc  0   1  0  0  0 r  y  . 10 10 10  2  4 24  8 16 16 16 16  1 16 None
0xcd  0   1  0  0  0 r  .  .  8  8  8  0  4 24  0 16 16 16 16  0 0 None
0xce  0   1  0  0  0 r  .  .  8  8  8  8  4 24  0 16 16 16 16  0 0 None
0xcf  0   1  0  0  0 r  .  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0xd0  0   1  0  0  0 r  .  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0xd1  0   1  0  0  0 r  .  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0xd2  0   1  0  0  0 r  .  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0xd3  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  0 0 None
0xd4  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  0 0 None
0xd5  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0xd6  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0xd7  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0xd8  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0xd9  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  0 0 None
0xda  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  0 0 None
0xdb  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0xdc  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0xdd  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0xde  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0xdf  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 2 None
0xe0  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 2 None
0xe1  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 2 None
0xe2  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 2 None
0xe3  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 2 None
0xe4  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 2 None
0xe5  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 2 None
0xe6  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 2 None
0xe7  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 2 None
0xe8  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 2 None
0xe9  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 2 None
0xea  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 2 None
0xeb  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 4 None
0xec  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 4 None
0xed  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 4 None
0xee  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 4 None
0xef  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 4 None
0xf0  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 4 None
0xf1  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 4 None
0xf2  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 4 None
0xf3  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 4 None
0xf4  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 4 None
0xf5  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 4 None
0xf6  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 4 None
0xf7  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0xf8  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0xf9  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0xfa  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0xfb  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 8 None
0xfc  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 8 None
0xfd  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0xfe  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0xff  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0x100  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0x101  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 8 None
0x102  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 8 None
0x103  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x104  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x105  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x106  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x107  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 16 None
0x108  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 16 None
0x109  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x10a  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x10b  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x10c  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x10d  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 16 None
0x10e  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 16 None
0x10f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 32 None
0x110  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 32 None
0x111  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 32 None
0x112  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 32 None
0x113  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 32 None
0x114  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 32 None
0x115  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 32 None
0x116  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 32 None
0x117  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 32 None
0x118  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 32 None
0x119  0   1  0  0  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  1 32 None
0x11a  0   1  0  0  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  1 32 None
0x11b  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0x11c  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0x11d  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0x11e  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0x11f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 8 None
0x120  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 8 None
0x121  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 8 None
0x122  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 8 None
0x123  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x124  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x125  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x126  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x127  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x128  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x129  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x12a  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x12b  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x12c  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x12d  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x12e  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x12f  0   1  0  0  0 r  y  .  8  8  8  0  4 24  0 16 16 16 16  1 16 None
0x130  0   1  0  0  0 r  y  .  8  8  8  8  4 24  0 16 16 16 16  1 16 None
0x131  0   1  0  0  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  1 16 None
0x132  0   1  0  0  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  1 16 None
0x133  1   1  0  0  0 r  .  .  8  8  8  0  0 32  8 16 16 16  0  0 0 None
0x134  1   1  0  0  0 r  .  .  8  8  8  0  0 16  8 16 16 16  0  0 0 None
0x135  1   1  0  0  0 r  y  .  8  8  8  0  0 32  8 16 16 16  0  0 0 None
0x136  1   1  0  0  0 r  y  .  8  8  8  0  0 16  8 16 16 16  0  0 0 None
0x137  1   1  0  0  0 r  .  .  8  8  8  8  0 32  8 16 16 16 16  0 0 None
0x138  1   1  0  0  0 r  .  .  8  8  8  8  0 16  8 16 16 16 16  0 0 None
0x139  1   1  0  0  0 r  y  .  8  8  8  8  0 32  8 16 16 16 16  0 0 None
0x13a  1   1  0  0  0 r  y  .  8  8  8  8  0 16  8 16 16 16 16  0 0 None
0x13b  1   1  0  0  0  c .  .  8  8  8  0  0 32  8  0  0  0  0  0 0 None
0x13c  1   1  0  0  0  c .  .  8  8  8  0  0 16  8  0  0  0  0  0 0 None
0x13d  1   1  0  0  0  c y  .  8  8  8  0  0 32  8  0  0  0  0  0 0 None
0x13e  1   1  0  0  0  c y  .  8  8  8  0  0 16  8  0  0  0  0  0 0 None
0x13f  1   0  0  0  0 r  .  .  8  8  8  0  0 32  8 16 16 16  0  0 0 None
0x140  1   0  0  0  0 r  .  .  8  8  8  0  0 16  8 16 16 16  0  0 0 None
0x141  1   0  0  0  0 r  .  .  8  8  8  8  0 32  8 16 16 16 16  0 0 None
0x142  1   0  0  0  0 r  .  .  8  8  8  8  0 16  8 16 16 16 16  0 0 None
0x143  1   0  0  0  0  c .  .  8  8  8  0  0 32  8  0  0  0  0  0 0 None
0x144  1   0  0  0  0  c .  .  8  8  8  0  0 16  8  0  0  0  0  0 0 None
0x145  1   0  0  0  0 r  .  .  5  5  5  0  0 32  8 11 11 10  0  0 0 None
0x146  1   0  0  0  0 r  .  .  5  5  5  0  0 16  8 11 11 10  0  0 0 None
0x147  1   0  0  0  0 r  .  .  5  5  5  8  0 32  8  8  8  8  8  0 0 None
0x148  1   0  0  0  0 r  .  .  5  5  5  8  0 16  8  8  8  8  8  0 0 None
0x149  1   0  0  0  0  c .  .  5  5  5  0  0 32  8  0  0  0  0  0 0 None
0x14a  1   0  0  0  0  c .  .  5  5  5  0  0 16  8  0  0  0  0  0 0 None
0x14b  1   0  0  0  0 r  .  .  3  3  2  0  0 32  8 11 11 10  0  0 0 None
0x14c  1   0  0  0  0 r  .  .  3  3  2  0  0 16  8 11 11 10  0  0 0 None
0x14d  1   0  0  0  0 r  .  .  3  3  2  8  0 32  8  8  8  8  8  0 0 None
0x14e  1   0  0  0  0 r  .  .  3  3  2  8  0 16  8  8  8  8  8  0 0 None
0x14f  1   0  0  0  0  c .  .  3  3  2  0  0 32  8  0  0  0  0  0 0 None
0x150  1   0  0  0  0  c .  .  3  3  2  0  0 16  8  0  0  0  0  0 0 None
0x151  1   0  0  0  0 r  .  .  1  1  1  0  0 32  8  5  6  5  0  0 0 None
0x152  1   0  0  0  0 r  .  .  1  1  1  0  0 16  8  5  6  5  0  0 0 None
0x153  1   0  0  0  0 r  .  .  1  1  1  8  0 32  8  4  4  4  4  0 0 None
0x154  1   0  0  0  0 r  .  .  1  1  1  8  0 16  8  4  4  4  4  0 0 None
0x155  1   0  0  0  0  c .  .  1  1  1  0  0 32  8  0  0  0  0  0 0 None
----- Original Message -----
> On 06/09/2014 11:38 AM, Jose Fonseca wrote:
> >
> >
> > ----- Original Message -----
> >> On 06/09/2014 07:22 AM, Jose Fonseca wrote:
> >>> I don't think that OpenGL ICD should advertise multi-sample formats via
> >>> the
> >>> standard DescribePixelFormat.
> >>> http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states:
> >>>
> >>>       Indices are assigned to pixel formats in the following order:
> >>>
> >>>       1. Accelerated pixel formats that are displayable
> >>>
> >>>       2. Accelerated pixel formats that are displayable and which have
> >>>          extended attributes
> >>>
> >>>       3. Generic pixel formats
> >>>
> >>>       4. Accelerated pixel formats that are non displayable
> >>>
> >>>       ChoosePixelFormat will never select pixel formats from either group
> >>>       2 or group 4. Each pixel format in group 2 is required to appear
> >>>       identical to some pixel format in group 1 when queried by
> >>>       DescribePixelFormat. Consequently, ChoosePixelFormat will always
> >>>       select a format from group 1 when it might otherwise have selected
> >>>       a
> >>>       format from group 2. Pixel formats in group 4 cannot be accessed by
> >>>       ChoosePixelFormat at all.
> >>>
> >>> That is, IIUC, in order to discover multi-sampled formats one must get
> >>> the
> >>> the number of pixel formats via
> >>> wglGetPixelFormatAttribivARB(WGL_NUMBER_PIXEL_FORMATS_ARB) instead of
> >>>
> >>>      numVisuals = DescribePixelFormat(hdc, 1,
> >>>      sizeof(PIXELFORMATDESCRIPTOR),
> >>>      NULL);
> >>>      if (numVisuals == 0)
> >>>         return;
> >>>
> >>> And I'm not even sure if it is OK to call DescribePixelFormat() with
> >>> extended pixel formats or if one must use exclusively
> >>> wglGetPixelFormatAttribivARB/wglGetPixelFormatAttribivARB.  You can see
> >>> how GLFW does it on
> >>> https://github.com/glfw/glfw/blob/master/src/wgl_context.c#L144
> >>
> >> Nothing's ever easy on Windows. <sigh>
> >
> > No. OPENGL32.DLL interface
> >
> >> The code as-is seems to work fine both on a Windows/nvidia host and in
> >> the guest but I'll try the changes you suggested...
> >
> > Is wglinfo displaying multi-sampled pixelformats on NVIDIA as is?  If so
> > then my interpretation might be wrong somehow.
> 
> Yes.  I'm attaching the output of wglinfo on a windows/nvidia host w/
> the patch in question.

Interesting.  So indeed it does seem that either I'm misinterpreting (may be both group 1 and 2 are supposed to be exposed to Describe/ChoosePixelFormat, and not just group 1 as I initially though), or NVIDIA opted for non-strict conformance.  I'll need to re-read the spec and our wgl state tracker more closely.

Either way, it seems that if all MSAA pixelformats have a non-MSAA correspondent, and that these non-MSAA pixelformats are listed first, then ChoosePixelFormat will never pick a later pixel format by mistake.

It wouldn't hurt to eventually extend wglinfo to iterate over WGL_NUMBER_PIXEL_FORMATS_ARB though  -- as it might show additional pixel formats (group 4?), at least for some GL drivers out there.  But if/when to do that is entirely up to you.

Jose