dxgi: Translate swap effects in dxgi_factory_CreateSwapChainForHwnd().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5057df1f3e
commit
d612495a72
|
@ -275,12 +275,22 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IWineDXGIFa
|
||||||
switch (swapchain_desc->SwapEffect)
|
switch (swapchain_desc->SwapEffect)
|
||||||
{
|
{
|
||||||
case DXGI_SWAP_EFFECT_DISCARD:
|
case DXGI_SWAP_EFFECT_DISCARD:
|
||||||
|
wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD;
|
||||||
|
min_buffer_count = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case DXGI_SWAP_EFFECT_SEQUENTIAL:
|
case DXGI_SWAP_EFFECT_SEQUENTIAL:
|
||||||
|
wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_SEQUENTIAL;
|
||||||
min_buffer_count = 1;
|
min_buffer_count = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DXGI_SWAP_EFFECT_FLIP_DISCARD:
|
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:
|
case DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL:
|
||||||
|
wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL;
|
||||||
min_buffer_count = 2;
|
min_buffer_count = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -303,8 +313,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IWineDXGIFa
|
||||||
|
|
||||||
if (swapchain_desc->Scaling != DXGI_SCALING_STRETCH)
|
if (swapchain_desc->Scaling != DXGI_SCALING_STRETCH)
|
||||||
FIXME("Ignoring scaling %#x.\n", swapchain_desc->Scaling);
|
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)
|
if (swapchain_desc->AlphaMode != DXGI_ALPHA_MODE_IGNORE)
|
||||||
FIXME("Ignoring alpha mode %#x.\n", swapchain_desc->AlphaMode);
|
FIXME("Ignoring alpha mode %#x.\n", swapchain_desc->AlphaMode);
|
||||||
if (fullscreen_desc && fullscreen_desc->ScanlineOrdering)
|
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_desc.backbuffer_usage = wined3d_usage_from_dxgi_usage(swapchain_desc->BufferUsage);
|
||||||
wined3d_sample_desc_from_dxgi(&wined3d_desc.multisample_type,
|
wined3d_sample_desc_from_dxgi(&wined3d_desc.multisample_type,
|
||||||
&wined3d_desc.multisample_quality, &swapchain_desc->SampleDesc);
|
&wined3d_desc.multisample_quality, &swapchain_desc->SampleDesc);
|
||||||
wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD;
|
|
||||||
wined3d_desc.device_window = window;
|
wined3d_desc.device_window = window;
|
||||||
wined3d_desc.windowed = fullscreen_desc ? fullscreen_desc->Windowed : TRUE;
|
wined3d_desc.windowed = fullscreen_desc ? fullscreen_desc->Windowed : TRUE;
|
||||||
wined3d_desc.enable_auto_depth_stencil = FALSE;
|
wined3d_desc.enable_auto_depth_stencil = FALSE;
|
||||||
|
|
|
@ -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
|
* 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
|
* 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. */
|
* 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],
|
wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1],
|
||||||
0, WINED3D_LOCATION_DISCARDED);
|
0, WINED3D_LOCATION_DISCARDED);
|
||||||
|
|
||||||
|
|
|
@ -507,6 +507,7 @@ enum wined3d_swap_effect
|
||||||
{
|
{
|
||||||
WINED3D_SWAP_EFFECT_DISCARD,
|
WINED3D_SWAP_EFFECT_DISCARD,
|
||||||
WINED3D_SWAP_EFFECT_SEQUENTIAL,
|
WINED3D_SWAP_EFFECT_SEQUENTIAL,
|
||||||
|
WINED3D_SWAP_EFFECT_FLIP_DISCARD,
|
||||||
WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL,
|
WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL,
|
||||||
WINED3D_SWAP_EFFECT_COPY,
|
WINED3D_SWAP_EFFECT_COPY,
|
||||||
WINED3D_SWAP_EFFECT_COPY_VSYNC,
|
WINED3D_SWAP_EFFECT_COPY_VSYNC,
|
||||||
|
|
Loading…
Reference in New Issue