=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: tests: Add test for creating tons of command queues.

Alexandre Julliard julliard at winehq.org
Mon Oct 8 15:38:52 CDT 2018


Module: vkd3d
Branch: master
Commit: e47a1320ca0c13e84134aaa076c8946b4ab62f17
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=e47a1320ca0c13e84134aaa076c8946b4ab62f17

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Oct  8 15:40:21 2018 +0200

tests: Add test for creating tons of command queues.

Mainly to show that those are not strictly linked to HW queues.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tests/d3d12.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/d3d12.c b/tests/d3d12.c
index 73f4da9..f40aded 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -1529,9 +1529,11 @@ static void test_create_command_list(void)
 
 static void test_create_command_queue(void)
 {
+    ID3D12CommandQueue* direct_queues[32], *compute_queues[32];
     D3D12_COMMAND_QUEUE_DESC desc, result_desc;
     ID3D12Device *device, *tmp_device;
     ID3D12CommandQueue *queue;
+    unsigned int i;
     ULONG refcount;
     HRESULT hr;
 
@@ -1584,6 +1586,24 @@ static void test_create_command_queue(void)
     refcount = ID3D12CommandQueue_Release(queue);
     ok(!refcount, "ID3D12CommandQueue has %u references left.\n", (unsigned int)refcount);
 
+    desc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
+    for (i = 0; i < ARRAY_SIZE(direct_queues); ++i)
+    {
+        hr = ID3D12Device_CreateCommandQueue(device, &desc, &IID_ID3D12CommandQueue, (void **)&direct_queues[i]);
+        ok(hr == S_OK, "Failed to create direct command queue %u, hr %#x.\n", hr, i);
+    }
+    desc.Type = D3D12_COMMAND_LIST_TYPE_COMPUTE;
+    for (i = 0; i < ARRAY_SIZE(compute_queues); ++i)
+    {
+        hr = ID3D12Device_CreateCommandQueue(device, &desc, &IID_ID3D12CommandQueue, (void **)&compute_queues[i]);
+        ok(hr == S_OK, "Failed to create compute command queue %u, hr %#x.\n", hr, i);
+    }
+
+    for (i = 0; i < ARRAY_SIZE(direct_queues); ++i)
+        ID3D12CommandQueue_Release(direct_queues[i]);
+    for (i = 0; i < ARRAY_SIZE(compute_queues); ++i)
+        ID3D12CommandQueue_Release(compute_queues[i]);
+
     refcount = ID3D12Device_Release(device);
     ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
 }




More information about the wine-cvs mailing list