Commit cc8d8b5e authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

opengl32: Prioritize stencil check over depth check in wglChoosePixelFormat().

Patch by Matteo Bruni. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com>
parent 28ba7e41
...@@ -564,27 +564,27 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd) ...@@ -564,27 +564,27 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
continue; continue;
} }
} }
if (ppfd->cDepthBits && !(ppfd->dwFlags & PFD_DEPTH_DONTCARE)) if (ppfd->cStencilBits)
{ {
if (((ppfd->cDepthBits > best.cDepthBits) && (format.cDepthBits > best.cDepthBits)) || if (((ppfd->cStencilBits > best.cStencilBits) && (format.cStencilBits > best.cStencilBits)) ||
((format.cDepthBits >= ppfd->cDepthBits) && (format.cDepthBits < best.cDepthBits))) ((format.cStencilBits >= ppfd->cStencilBits) && (format.cStencilBits < best.cStencilBits)))
goto found; goto found;
if (best.cDepthBits != format.cDepthBits) if (best.cStencilBits != format.cStencilBits)
{ {
TRACE( "depth mismatch for iPixelFormat=%d\n", i ); TRACE( "stencil mismatch for iPixelFormat=%d\n", i );
continue; continue;
} }
} }
if (ppfd->cStencilBits) if (ppfd->cDepthBits && !(ppfd->dwFlags & PFD_DEPTH_DONTCARE))
{ {
if (((ppfd->cStencilBits > best.cStencilBits) && (format.cStencilBits > best.cStencilBits)) || if (((ppfd->cDepthBits > best.cDepthBits) && (format.cDepthBits > best.cDepthBits)) ||
((format.cStencilBits >= ppfd->cStencilBits) && (format.cStencilBits < best.cStencilBits))) ((format.cDepthBits >= ppfd->cDepthBits) && (format.cDepthBits < best.cDepthBits)))
goto found; goto found;
if (best.cStencilBits != format.cStencilBits) if (best.cDepthBits != format.cDepthBits)
{ {
TRACE( "stencil mismatch for iPixelFormat=%d\n", i ); TRACE( "depth mismatch for iPixelFormat=%d\n", i );
continue; continue;
} }
} }
......
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