From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d/state.c | 21 +++++++++++++++------ libs/vkd3d/vkd3d_private.h | 2 ++ tests/d3d12.c | 12 +++++++++--- 3 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index b2f177c9798d..f0b61ec057d1 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -107,6 +107,7 @@ static ULONG STDMETHODCALLTYPE d3d12_root_signature_Release(ID3D12RootSignature if (!refcount) { struct d3d12_device *device = root_signature->device; + vkd3d_private_store_destroy(&root_signature->private_store); d3d12_root_signature_cleanup(root_signature, device); vkd3d_free(root_signature); ID3D12Device_Release(&device->ID3D12Device_iface); @@ -118,25 +119,31 @@ static ULONG STDMETHODCALLTYPE d3d12_root_signature_Release(ID3D12RootSignature static HRESULT STDMETHODCALLTYPE d3d12_root_signature_GetPrivateData(ID3D12RootSignature *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_root_signature *root_signature = impl_from_ID3D12RootSignature(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(&root_signature->private_store, guid, data_size, data); }
static HRESULT STDMETHODCALLTYPE d3d12_root_signature_SetPrivateData(ID3D12RootSignature *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_root_signature *root_signature = impl_from_ID3D12RootSignature(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(&root_signature->private_store, guid, data_size, data); }
static HRESULT STDMETHODCALLTYPE d3d12_root_signature_SetPrivateDataInterface(ID3D12RootSignature *iface, REFGUID guid, const IUnknown *data) { - FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data); + struct d3d12_root_signature *root_signature = impl_from_ID3D12RootSignature(iface);
- return E_NOTIMPL; + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return vkd3d_set_private_data_interface(&root_signature->private_store, guid, data); }
static HRESULT STDMETHODCALLTYPE d3d12_root_signature_SetName(ID3D12RootSignature *iface, const WCHAR *name) @@ -992,6 +999,8 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa &root_signature->vk_pipeline_layout))) goto fail;
+ vkd3d_private_store_init(&root_signature->private_store); + root_signature->device = device; ID3D12Device_AddRef(&device->ID3D12Device_iface);
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index eef7d904f686..14f95bfa5d4a 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -559,6 +559,8 @@ struct d3d12_root_signature VkSampler *static_samplers;
struct d3d12_device *device; + + struct vkd3d_private_store private_store; };
HRESULT d3d12_root_signature_create(struct d3d12_device *device, const void *bytecode, diff --git a/tests/d3d12.c b/tests/d3d12.c index 9e381cb4810d..61b00e60ab4e 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -2586,6 +2586,7 @@ static void test_private_data(void) &IID_ID3D12CommandSignature, &IID_ID3D12Device, &IID_ID3D12Fence, + &IID_ID3D12RootSignature, };
if (!(device = create_device())) @@ -2598,14 +2599,14 @@ static void test_private_data(void) { if (IsEqualGUID(tests[i], &IID_ID3D12CommandAllocator)) { - vkd3d_test_set_context("allocator"); + vkd3d_test_set_context("command allocator"); hr = ID3D12Device_CreateCommandAllocator(device, D3D12_COMMAND_LIST_TYPE_DIRECT, &IID_IUnknown, (void **)&unknown); ok(hr == S_OK, "Failed to create command allocator, hr %#x.\n", hr); } else if (IsEqualGUID(tests[i], &IID_ID3D12CommandList)) { - vkd3d_test_set_context("list"); + vkd3d_test_set_context("command list"); hr = ID3D12Device_CreateCommandAllocator(device, D3D12_COMMAND_LIST_TYPE_DIRECT, &IID_ID3D12CommandAllocator, (void **)&allocator); ok(hr == S_OK, "Failed to create command allocator, hr %#x.\n", hr); @@ -2616,7 +2617,7 @@ static void test_private_data(void) } else if (IsEqualGUID(tests[i], &IID_ID3D12CommandQueue)) { - vkd3d_test_set_context("queue"); + vkd3d_test_set_context("command queue"); queue_desc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT; queue_desc.Priority = D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; queue_desc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; @@ -2649,6 +2650,11 @@ static void test_private_data(void) &IID_IUnknown, (void **)&unknown); ok(hr == S_OK, "Failed to create fence, hr %#x.\n", hr); } + else if (IsEqualGUID(tests[i], &IID_ID3D12RootSignature)) + { + vkd3d_test_set_context("root signature"); + unknown = (IUnknown *)create_empty_root_signature(device, 0); + } else { unknown = NULL;