mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 01:27:16 +00:00
opengl32: Support PFD_DEPTH_DONTCARE flag in wglChoosePixelFormat().
With this flag set native implementation ignores cDepthBits but cares to find a zero depth format if possible. Signed-off-by: Paul Gofman <pgofman@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6341546fde
commit
45f8b6924a
|
@ -330,6 +330,18 @@ static void test_choosepixelformat(void)
|
|||
ok( test_pfd(&pfd, NULL), "PFD_STEREO_DONTCARE failed\n" );
|
||||
pfd.dwFlags &= ~PFD_STEREO_DONTCARE;
|
||||
pfd.cAuxBuffers = 0;
|
||||
|
||||
pfd.dwFlags |= PFD_DEPTH_DONTCARE;
|
||||
pfd.cDepthBits = 24;
|
||||
ok( test_pfd(&pfd, &ret_fmt), "PFD_DEPTH_DONTCARE failed.\n" );
|
||||
ok( !ret_fmt.cDepthBits, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
|
||||
pfd.cStencilBits = 8;
|
||||
ok( test_pfd(&pfd, &ret_fmt), "PFD_DEPTH_DONTCARE, depth 24, stencil 8 failed.\n" );
|
||||
ok( !ret_fmt.cDepthBits || ret_fmt.cDepthBits == 24, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
|
||||
ok( ret_fmt.cStencilBits == 8, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
|
||||
pfd.cDepthBits = 0;
|
||||
pfd.cStencilBits = 0;
|
||||
pfd.dwFlags &= ~PFD_DEPTH_DONTCARE;
|
||||
}
|
||||
|
||||
static void WINAPI gl_debug_message_callback(GLenum source, GLenum type, GLuint id, GLenum severity,
|
||||
|
|
|
@ -563,7 +563,7 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (ppfd->cDepthBits)
|
||||
if (ppfd->cDepthBits && !(ppfd->dwFlags & PFD_DEPTH_DONTCARE))
|
||||
{
|
||||
if (((ppfd->cDepthBits > best.cDepthBits) && (format.cDepthBits > best.cDepthBits)) ||
|
||||
((format.cDepthBits >= ppfd->cDepthBits) && (format.cDepthBits < best.cDepthBits)))
|
||||
|
@ -599,6 +599,9 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (ppfd->dwFlags & PFD_DEPTH_DONTCARE && format.cDepthBits < best.cDepthBits)
|
||||
goto found;
|
||||
|
||||
continue;
|
||||
|
||||
found:
|
||||
|
|
Loading…
Reference in a new issue