mirror of
https://github.com/reactos/wine.git
synced 2024-11-30 23:20:56 +00:00
dxgi: Enable WINED3D_SWAPCHAIN_USE_CLOSEST_MATCHING_MODE.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
92a6c5839d
commit
f94ef02dbc
@ -481,6 +481,9 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device
|
||||
wined3d_mutex_lock();
|
||||
wined3d_private_store_init(&swapchain->private_store);
|
||||
|
||||
if (!desc->windowed && (!desc->backbuffer_width || !desc->backbuffer_height))
|
||||
FIXME("Fullscreen swapchain with back buffer width/height equal to 0 not supported properly.\n");
|
||||
|
||||
swapchain->fullscreen = !desc->windowed;
|
||||
desc->windowed = TRUE;
|
||||
if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain,
|
||||
|
@ -1183,21 +1183,18 @@ static void test_create_swapchain(void)
|
||||
expected_height = expected_client_rect->bottom - expected_client_rect->top;
|
||||
|
||||
hr = IDXGIFactory_CreateSwapChain(factory, obj, &creation_desc, &swapchain);
|
||||
todo_wine ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
|
||||
ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr);
|
||||
ok(result_desc.BufferDesc.Width == expected_width, "Got width %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Width, expected_width);
|
||||
ok(result_desc.BufferDesc.Height == expected_height, "Got height %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Height, expected_height);
|
||||
check_swapchain_fullscreen_state(swapchain, &expected_state);
|
||||
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
|
||||
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
|
||||
check_swapchain_fullscreen_state(swapchain, &initial_state);
|
||||
IDXGISwapChain_Release(swapchain);
|
||||
}
|
||||
ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
|
||||
hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
|
||||
ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr);
|
||||
todo_wine ok(result_desc.BufferDesc.Width == expected_width, "Got width %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Width, expected_width);
|
||||
todo_wine ok(result_desc.BufferDesc.Height == expected_height, "Got height %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Height, expected_height);
|
||||
check_swapchain_fullscreen_state(swapchain, &expected_state);
|
||||
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
|
||||
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
|
||||
check_swapchain_fullscreen_state(swapchain, &initial_state);
|
||||
IDXGISwapChain_Release(swapchain);
|
||||
|
||||
IDXGIOutput_Release(expected_state.target);
|
||||
|
||||
@ -2161,25 +2158,22 @@ static void test_inexact_modes(void)
|
||||
sizes[i].width, sizes[i].height, output);
|
||||
|
||||
hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain);
|
||||
todo_wine ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
|
||||
ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
check_swapchain_fullscreen_state(swapchain, &expected_state);
|
||||
hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
|
||||
ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr);
|
||||
ok(result_desc.BufferDesc.Width == sizes[i].width, "Got width %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Width, sizes[i].width);
|
||||
ok(result_desc.BufferDesc.Height == sizes[i].height, "Got height %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Height, sizes[i].height);
|
||||
check_swapchain_fullscreen_state(swapchain, &expected_state);
|
||||
hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
|
||||
ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr);
|
||||
ok(result_desc.BufferDesc.Width == sizes[i].width, "Got width %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Width, sizes[i].width);
|
||||
ok(result_desc.BufferDesc.Height == sizes[i].height, "Got height %u, expected %u.\n",
|
||||
result_desc.BufferDesc.Height, sizes[i].height);
|
||||
|
||||
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
|
||||
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
|
||||
check_swapchain_fullscreen_state(swapchain, &initial_state);
|
||||
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
|
||||
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
|
||||
check_swapchain_fullscreen_state(swapchain, &initial_state);
|
||||
|
||||
refcount = IDXGISwapChain_Release(swapchain);
|
||||
ok(!refcount, "IDXGISwapChain has %u references left.\n", refcount);
|
||||
}
|
||||
refcount = IDXGISwapChain_Release(swapchain);
|
||||
ok(!refcount, "IDXGISwapChain has %u references left.\n", refcount);
|
||||
|
||||
/* Test SetFullscreenState(). */
|
||||
swapchain_desc.BufferDesc.Width = sizes[i].width;
|
||||
@ -2189,11 +2183,10 @@ static void test_inexact_modes(void)
|
||||
hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain);
|
||||
ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
|
||||
|
||||
todo_wine hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, output);
|
||||
todo_wine ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
|
||||
hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, output);
|
||||
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
check_swapchain_fullscreen_state(swapchain, &expected_state);
|
||||
check_swapchain_fullscreen_state(swapchain, &expected_state);
|
||||
hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
|
||||
ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr);
|
||||
ok(result_desc.BufferDesc.Width == sizes[i].width, "Got width %u, expected %u.\n",
|
||||
|
@ -453,11 +453,14 @@ void wined3d_display_mode_from_dxgi(struct wined3d_display_mode *wined3d_mode,
|
||||
wined3d_mode->scanline_ordering = wined3d_scanline_ordering_from_dxgi(mode->ScanlineOrdering);
|
||||
}
|
||||
|
||||
#define DXGI_WINED3D_SWAPCHAIN_FLAGS \
|
||||
(WINED3D_SWAPCHAIN_USE_CLOSEST_MATCHING_MODE | WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT)
|
||||
|
||||
unsigned int dxgi_swapchain_flags_from_wined3d(unsigned int wined3d_flags)
|
||||
{
|
||||
unsigned int flags = 0;
|
||||
|
||||
wined3d_flags &= ~WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT;
|
||||
wined3d_flags &= ~DXGI_WINED3D_SWAPCHAIN_FLAGS;
|
||||
|
||||
if (wined3d_flags & WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH)
|
||||
{
|
||||
@ -473,7 +476,7 @@ unsigned int dxgi_swapchain_flags_from_wined3d(unsigned int wined3d_flags)
|
||||
|
||||
unsigned int wined3d_swapchain_flags_from_dxgi(unsigned int flags)
|
||||
{
|
||||
unsigned int wined3d_flags = WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT; /* WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL? */
|
||||
unsigned int wined3d_flags = DXGI_WINED3D_SWAPCHAIN_FLAGS; /* WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL? */
|
||||
|
||||
if (flags & DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user