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 ...@@ -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, static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc,
const D3DPRESENT_PARAMETERS *present_parameters) 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); WARN("Invalid swap effect %u passed.\n", present_parameters->SwapEffect);
return FALSE; return FALSE;
} }
if (present_parameters->BackBufferCount > 3 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)) && present_parameters->BackBufferCount > 1))
{ {
WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount); WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount);
......
...@@ -7326,6 +7326,10 @@ static void test_swapchain_parameters(void) ...@@ -7326,6 +7326,10 @@ static void test_swapchain_parameters(void)
{TRUE, 1, D3DSWAPEFFECT_COPY, D3D_OK}, {TRUE, 1, D3DSWAPEFFECT_COPY, D3D_OK},
{TRUE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL}, {TRUE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL},
{FALSE, 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. */ /* Ok with the others, in fullscreen and windowed mode. */
{TRUE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, {TRUE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK},
...@@ -7333,6 +7337,10 @@ static void test_swapchain_parameters(void) ...@@ -7333,6 +7337,10 @@ static void test_swapchain_parameters(void)
{FALSE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, {FALSE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK},
{FALSE, 2, D3DSWAPEFFECT_FLIP, 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. */ /* 3 is the highest allowed backbuffer count. */
{TRUE, 3, D3DSWAPEFFECT_DISCARD, D3D_OK}, {TRUE, 3, D3DSWAPEFFECT_DISCARD, D3D_OK},
{TRUE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL}, {TRUE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL},
......
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