Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/dxgi/factory.c | 13 ++++++++++--- dlls/wined3d/swapchain.c | 3 ++- include/wine/wined3d.h | 1 + 3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 00ca122..7fc3279 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -275,12 +275,22 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IWineDXGIFa switch (swapchain_desc->SwapEffect) { case DXGI_SWAP_EFFECT_DISCARD: + wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD; + min_buffer_count = 1; + break; + case DXGI_SWAP_EFFECT_SEQUENTIAL: + wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_SEQUENTIAL; min_buffer_count = 1; break;
case DXGI_SWAP_EFFECT_FLIP_DISCARD: + wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_FLIP_DISCARD; + min_buffer_count = 2; + break; + case DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL: + wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL; min_buffer_count = 2; break;
@@ -303,8 +313,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IWineDXGIFa
if (swapchain_desc->Scaling != DXGI_SCALING_STRETCH) FIXME("Ignoring scaling %#x.\n", swapchain_desc->Scaling); - if (swapchain_desc->SwapEffect) - FIXME("Ignoring swap effect %#x.\n", swapchain_desc->SwapEffect); if (swapchain_desc->AlphaMode != DXGI_ALPHA_MODE_IGNORE) FIXME("Ignoring alpha mode %#x.\n", swapchain_desc->AlphaMode); if (fullscreen_desc && fullscreen_desc->ScanlineOrdering) @@ -319,7 +327,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IWineDXGIFa wined3d_desc.backbuffer_usage = wined3d_usage_from_dxgi_usage(swapchain_desc->BufferUsage); wined3d_sample_desc_from_dxgi(&wined3d_desc.multisample_type, &wined3d_desc.multisample_quality, &swapchain_desc->SampleDesc); - wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD; wined3d_desc.device_window = window; wined3d_desc.windowed = fullscreen_desc ? fullscreen_desc->Windowed : TRUE; wined3d_desc.enable_auto_depth_stencil = FALSE; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 2729df2..0d76b67 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -505,7 +505,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, * The FLIP swap effect is not implemented yet. We could mark WINED3D_LOCATION_DRAWABLE * up to date and hope WGL flipped front and back buffers and read this data into * the FBO. Don't bother about this for now. */ - if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_DISCARD) + if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_DISCARD + || swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP_DISCARD) wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1], 0, WINED3D_LOCATION_DISCARDED);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 22bb2d8..1e3c08b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -507,6 +507,7 @@ enum wined3d_swap_effect { WINED3D_SWAP_EFFECT_DISCARD, WINED3D_SWAP_EFFECT_SEQUENTIAL, + WINED3D_SWAP_EFFECT_FLIP_DISCARD, WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL, WINED3D_SWAP_EFFECT_COPY, WINED3D_SWAP_EFFECT_COPY_VSYNC,