[PATCH] d3d12/tests: Add tests for swapchain buffer heap properties.

Conor McCarthy cmccarthy at codeweavers.com
Wed Nov 13 21:44:42 CST 2019


Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
 dlls/d3d12/tests/d3d12.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/d3d12/tests/d3d12.c b/dlls/d3d12/tests/d3d12.c
index 33f5288a..9634564b 100644
--- a/dlls/d3d12/tests/d3d12.c
+++ b/dlls/d3d12/tests/d3d12.c
@@ -601,6 +601,8 @@ static HWND create_window(DWORD style)
 static IDXGISwapChain3 *create_swapchain(struct test_context *context, ID3D12CommandQueue *queue,
         HWND window, unsigned int buffer_count, DXGI_FORMAT format, unsigned int width, unsigned int height)
 {
+    D3D12_HEAP_PROPERTIES heap_properties;
+    D3D12_HEAP_FLAGS heap_flags;
     IDXGISwapChain1 *swapchain1;
     DXGI_SWAP_CHAIN_DESC1 desc;
     IDXGISwapChain3 *swapchain;
@@ -646,6 +648,13 @@ static IDXGISwapChain3 *create_swapchain(struct test_context *context, ID3D12Com
         {
             hr = IDXGISwapChain3_GetBuffer(swapchain, i, &IID_ID3D12Resource, (void **)&context->render_target[i]);
             ok(hr == S_OK, "Failed to get swapchain buffer %u, hr %#x.\n", i, hr);
+            hr = ID3D12Resource_GetHeapProperties(context->render_target[i], &heap_properties, &heap_flags);
+            ok(hr == S_OK, "Failed to get swapchain buffer %u heap properties, hr %#x.\n", i, hr);
+            ok(heap_properties.Type == D3D12_HEAP_TYPE_DEFAULT, "Got unexpected heap type 0x%x.\n", heap_properties.Type);
+            ok(heap_properties.CPUPageProperty == 0, "Got unexpected cpu page property 0x%x.\n", heap_properties.CPUPageProperty);
+            ok(heap_properties.MemoryPoolPreference == 0, "Got unexpected memory pool preference 0x%x.\n", heap_properties.MemoryPoolPreference);
+            ok(heap_properties.CreationNodeMask == 1, "Got unexpected node mask 0x%x.\n", heap_properties.CreationNodeMask);
+            ok(heap_properties.VisibleNodeMask == 1, "Got unexpected node mask 0x%x.\n", heap_properties.VisibleNodeMask);
             ID3D12Device_CreateRenderTargetView(context->device, context->render_target[i], NULL, context->rtv[i]);
         }
     }
-- 
2.23.0




More information about the wine-devel mailing list