Commit 6b8564d6 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d8: Accept D3DSWAPEFFECT_COPY_VSYNC.

parent e8c1cf44
......@@ -191,13 +191,14 @@ static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS
static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc,
const D3DPRESENT_PARAMETERS *present_parameters)
{
if (!present_parameters->SwapEffect || present_parameters->SwapEffect > D3DSWAPEFFECT_COPY)
if (!present_parameters->SwapEffect || present_parameters->SwapEffect > D3DSWAPEFFECT_COPY_VSYNC)
{
WARN("Invalid swap effect %u passed.\n", present_parameters->SwapEffect);
return FALSE;
}
if (present_parameters->BackBufferCount > 3
|| (present_parameters->SwapEffect == D3DSWAPEFFECT_COPY
|| ((present_parameters->SwapEffect == D3DSWAPEFFECT_COPY
|| present_parameters->SwapEffect == D3DSWAPEFFECT_COPY_VSYNC)
&& present_parameters->BackBufferCount > 1))
{
WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount);
......
......@@ -7309,36 +7309,44 @@ static void test_swapchain_parameters(void)
tests[] =
{
/* Swap effect 0 is not allowed. */
{TRUE, 1, 0, D3DERR_INVALIDCALL},
{FALSE, 1, 0, D3DERR_INVALIDCALL},
{TRUE, 1, 0, D3DERR_INVALIDCALL},
{FALSE, 1, 0, D3DERR_INVALIDCALL},
/* All (non-ex) swap effects are allowed in
* windowed and fullscreen mode. */
{TRUE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK},
{TRUE, 1, D3DSWAPEFFECT_FLIP, D3D_OK},
{FALSE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK},
{FALSE, 1, D3DSWAPEFFECT_FLIP, D3D_OK},
{FALSE, 1, D3DSWAPEFFECT_COPY, D3D_OK},
{TRUE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK},
{TRUE, 1, D3DSWAPEFFECT_FLIP, D3D_OK},
{FALSE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK},
{FALSE, 1, D3DSWAPEFFECT_FLIP, D3D_OK},
{FALSE, 1, D3DSWAPEFFECT_COPY, D3D_OK},
/* Only one backbuffer in copy mode. Reset allows it for
* some reason. */
{TRUE, 0, D3DSWAPEFFECT_COPY, D3D_OK},
{TRUE, 1, D3DSWAPEFFECT_COPY, D3D_OK},
{TRUE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL},
{FALSE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL},
{TRUE, 0, D3DSWAPEFFECT_COPY, D3D_OK},
{TRUE, 1, D3DSWAPEFFECT_COPY, D3D_OK},
{TRUE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL},
{FALSE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL},
{TRUE, 0, D3DSWAPEFFECT_COPY_VSYNC, D3D_OK},
{TRUE, 1, D3DSWAPEFFECT_COPY_VSYNC, D3D_OK},
{TRUE, 2, D3DSWAPEFFECT_COPY_VSYNC, D3DERR_INVALIDCALL},
{FALSE, 2, D3DSWAPEFFECT_COPY_VSYNC, D3DERR_INVALIDCALL},
/* Ok with the others, in fullscreen and windowed mode. */
{TRUE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK},
{TRUE, 2, D3DSWAPEFFECT_FLIP, D3D_OK},
{FALSE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK},
{FALSE, 2, D3DSWAPEFFECT_FLIP, D3D_OK},
{TRUE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK},
{TRUE, 2, D3DSWAPEFFECT_FLIP, D3D_OK},
{FALSE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK},
{FALSE, 2, D3DSWAPEFFECT_FLIP, D3D_OK},
/* Invalid swapeffects. */
{TRUE, 1, D3DSWAPEFFECT_COPY_VSYNC + 1, D3DERR_INVALIDCALL},
{FALSE, 1, D3DSWAPEFFECT_COPY_VSYNC + 1, D3DERR_INVALIDCALL},
/* 3 is the highest allowed backbuffer count. */
{TRUE, 3, D3DSWAPEFFECT_DISCARD, D3D_OK},
{TRUE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL},
{TRUE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL},
{FALSE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL},
{FALSE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL},
{TRUE, 3, D3DSWAPEFFECT_DISCARD, D3D_OK},
{TRUE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL},
{TRUE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL},
{FALSE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL},
{FALSE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL},
};
window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
......
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