Conor McCarthy : dxgi/tests: Add tests for IDXGISwapChain3::ResizeBuffers1().
Alexandre Julliard
julliard at winehq.org
Mon Nov 11 16:20:22 CST 2019
Module: wine
Branch: master
Commit: a7cd70a8c842fdc1a0135a3bab274385af47ee92
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a7cd70a8c842fdc1a0135a3bab274385af47ee92
Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date: Fri Nov 8 00:54:41 2019 +1000
dxgi/tests: Add tests for IDXGISwapChain3::ResizeBuffers1().
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dxgi/tests/dxgi.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c
index b05e7f8bf9..874c39b88e 100644
--- a/dlls/dxgi/tests/dxgi.c
+++ b/dlls/dxgi/tests/dxgi.c
@@ -3534,6 +3534,8 @@ static void test_swapchain_resize(IUnknown *device, BOOL is_d3d12)
{
DXGI_SWAP_CHAIN_DESC swapchain_desc;
DXGI_SWAP_EFFECT swap_effect;
+ IDXGISwapChain3 *swapchain3;
+ IUnknown *present_queue[2];
IDXGISwapChain *swapchain;
ID3D12Resource *resource;
ID3D10Texture2D *texture;
@@ -3541,6 +3543,7 @@ static void test_swapchain_resize(IUnknown *device, BOOL is_d3d12)
IDXGISurface *surface;
IDXGIFactory *factory;
RECT client_rect, r;
+ UINT node_mask[2];
ULONG refcount;
HWND window;
BOOL ret;
@@ -3803,6 +3806,41 @@ static void test_swapchain_resize(IUnknown *device, BOOL is_d3d12)
ok(!swapchain_desc.Flags,
"Got unexpected Flags %#x.\n", swapchain_desc.Flags);
+ node_mask[0] = 1;
+ node_mask[1] = 1;
+ present_queue[0] = device;
+ present_queue[1] = device;
+ if (IDXGISwapChain_QueryInterface(swapchain, &IID_IDXGISwapChain3, (void **)&swapchain3) == E_NOINTERFACE)
+ {
+ skip("IDXGISwapChain3 is not supported.\n");
+ }
+ else if (!is_d3d12)
+ {
+ hr = IDXGISwapChain3_ResizeBuffers1(swapchain3, 2, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0, node_mask, present_queue);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Expected DXGI_ERROR_INVALID_CALL, got hr %#x.\n", hr);
+ IDXGISwapChain3_Release(swapchain3);
+ }
+ else
+ {
+ hr = IDXGISwapChain3_ResizeBuffers1(swapchain3, 2, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0, node_mask, present_queue);
+ ok(hr == S_OK, "Failed to resize buffers, hr %#x.\n", hr);
+ hr = IDXGISwapChain3_ResizeBuffers1(swapchain3, 2, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0, NULL, present_queue);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Expected DXGI_ERROR_INVALID_CALL, got hr %#x.\n", hr);
+ hr = IDXGISwapChain3_ResizeBuffers1(swapchain3, 2, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0, NULL, NULL);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Expected DXGI_ERROR_INVALID_CALL, got hr %#x.\n", hr);
+ hr = IDXGISwapChain3_ResizeBuffers1(swapchain3, 0, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0, NULL, NULL);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Expected DXGI_ERROR_INVALID_CALL, got hr %#x.\n", hr);
+ node_mask[0] = 2;
+ node_mask[1] = 2;
+ hr = IDXGISwapChain3_ResizeBuffers1(swapchain3, 2, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0, node_mask, present_queue);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Expected DXGI_ERROR_INVALID_CALL, got hr %#x.\n", hr);
+ /* Windows validates node masks even when the buffer count is zero. It defaults to the current buffer count.
+ * NULL queues cause some Windows versions to crash. */
+ hr = IDXGISwapChain3_ResizeBuffers1(swapchain3, 0, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0, node_mask, present_queue);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Expected DXGI_ERROR_INVALID_CALL, got hr %#x.\n", hr);
+ IDXGISwapChain3_Release(swapchain3);
+ }
+
IDXGISwapChain_Release(swapchain);
DestroyWindow(window);
refcount = IDXGIFactory_Release(factory);
More information about the wine-cvs
mailing list