Skip to content
Snippets Groups Projects
Commit 223e89a6 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard
Browse files

vkd3d: Implement private data for command signatures.

parent 1b07aae9
No related branches found
No related tags found
No related merge requests found
......@@ -4811,6 +4811,8 @@ static ULONG STDMETHODCALLTYPE d3d12_command_signature_Release(ID3D12CommandSign
{
struct d3d12_device *device = signature->device;
vkd3d_private_store_destroy(&signature->private_store);
vkd3d_free((void *)signature->desc.pArgumentDescs);
vkd3d_free(signature);
......@@ -4823,25 +4825,31 @@ static ULONG STDMETHODCALLTYPE d3d12_command_signature_Release(ID3D12CommandSign
static HRESULT STDMETHODCALLTYPE d3d12_command_signature_GetPrivateData(ID3D12CommandSignature *iface,
REFGUID guid, UINT *data_size, void *data)
{
FIXME("iface %p, guid %s, data_size %p, data %p stub!", iface, debugstr_guid(guid), data_size, data);
struct d3d12_command_signature *signature = impl_from_ID3D12CommandSignature(iface);
return E_NOTIMPL;
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_get_private_data(&signature->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_command_signature_SetPrivateData(ID3D12CommandSignature *iface,
REFGUID guid, UINT data_size, const void *data)
{
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
struct d3d12_command_signature *signature = impl_from_ID3D12CommandSignature(iface);
return E_NOTIMPL;
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_set_private_data(&signature->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_command_signature_SetPrivateDataInterface(ID3D12CommandSignature *iface,
REFGUID guid, const IUnknown *data)
{
FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
struct d3d12_command_signature *signature = impl_from_ID3D12CommandSignature(iface);
return E_NOTIMPL;
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
return vkd3d_set_private_data_interface(&signature->private_store, guid, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_command_signature_SetName(ID3D12CommandSignature *iface, const WCHAR *name)
......@@ -4926,6 +4934,8 @@ HRESULT d3d12_command_signature_create(struct d3d12_device *device, const D3D12_
memcpy((void *)object->desc.pArgumentDescs, desc->pArgumentDescs,
desc->NumArgumentDescs * sizeof(*desc->pArgumentDescs));
vkd3d_private_store_init(&object->private_store);
object->device = device;
ID3D12Device_AddRef(&device->ID3D12Device_iface);
......
......@@ -815,6 +815,8 @@ struct d3d12_command_signature
D3D12_COMMAND_SIGNATURE_DESC desc;
struct d3d12_device *device;
struct vkd3d_private_store private_store;
};
HRESULT d3d12_command_signature_create(struct d3d12_device *device, const D3D12_COMMAND_SIGNATURE_DESC *desc,
......
......@@ -2559,6 +2559,8 @@ static void test_create_fence(void)
 
static void test_private_data(void)
{
D3D12_COMMAND_SIGNATURE_DESC command_signature_desc;
D3D12_INDIRECT_ARGUMENT_DESC argument_desc;
D3D12_COMMAND_QUEUE_DESC queue_desc;
ULONG refcount, expected_refcount;
ID3D12CommandAllocator *allocator;
......@@ -2581,6 +2583,7 @@ static void test_private_data(void)
&IID_ID3D12CommandAllocator,
&IID_ID3D12CommandList,
&IID_ID3D12CommandQueue,
&IID_ID3D12CommandSignature,
&IID_ID3D12Device,
&IID_ID3D12Fence,
};
......@@ -2622,6 +2625,18 @@ static void test_private_data(void)
&IID_IUnknown, (void **)&unknown);
ok(hr == S_OK, "Failed to create command queue, hr %#x.\n", hr);
}
else if (IsEqualGUID(tests[i], &IID_ID3D12CommandSignature))
{
vkd3d_test_set_context("command signature");
argument_desc.Type = D3D12_INDIRECT_ARGUMENT_TYPE_DRAW;
command_signature_desc.ByteStride = sizeof(D3D12_DRAW_ARGUMENTS);
command_signature_desc.NumArgumentDescs = 1;
command_signature_desc.pArgumentDescs = &argument_desc;
command_signature_desc.NodeMask = 0;
hr = ID3D12Device_CreateCommandSignature(device, &command_signature_desc,
NULL, &IID_ID3D12CommandSignature, (void **)&unknown);
ok(hr == S_OK, "Failed to create command signature, hr %#x.\n", hr);
}
else if (IsEqualGUID(tests[i], &IID_ID3D12Device))
{
vkd3d_test_set_context("device");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment