tests: Add a test for compute thread IDs.

This commit is contained in:
Zebediah Figura
2021-08-16 18:55:56 -05:00
committed by Alexandre Julliard
parent 404a2d6a3d
commit 809a43f06b
Notes: Alexandre Julliard 2023-01-25 22:44:06 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/64
4 changed files with 200 additions and 39 deletions

View File

@ -1034,6 +1034,35 @@ static inline bool init_test_context_(unsigned int line, struct test_context *co
return true;
}
#define init_compute_test_context(context) init_compute_test_context_(__LINE__, context)
static inline bool init_compute_test_context_(unsigned int line, struct test_context *context)
{
ID3D12Device *device;
HRESULT hr;
memset(context, 0, sizeof(*context));
if (!(context->device = create_device()))
{
skip_(line)("Failed to create device.\n");
return false;
}
device = context->device;
context->queue = create_command_queue_(line, device,
D3D12_COMMAND_LIST_TYPE_COMPUTE, D3D12_COMMAND_QUEUE_PRIORITY_NORMAL);
hr = ID3D12Device_CreateCommandAllocator(device, D3D12_COMMAND_LIST_TYPE_COMPUTE,
&IID_ID3D12CommandAllocator, (void **)&context->allocator);
ok_(line)(hr == S_OK, "Failed to create command allocator, hr %#x.\n", hr);
hr = ID3D12Device_CreateCommandList(device, 0, D3D12_COMMAND_LIST_TYPE_COMPUTE,
context->allocator, NULL, &IID_ID3D12GraphicsCommandList, (void **)&context->list);
ok_(line)(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
return true;
}
static inline void destroy_pipeline_state_objects(struct test_context *context)
{
size_t i;