[Mesa-dev] [PATCH 2/2] wglinfo: query and report multisample information
Brian Paul
brianp at vmware.com
Mon Jun 9 08:45:42 PDT 2014
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
More information about the mesa-dev
mailing list