vkd3d: Implement private data for ID3D12Device.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ec13f36681
commit
567000cab3
|
@ -1469,6 +1469,8 @@ static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device *iface)
|
||||||
{
|
{
|
||||||
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
||||||
|
|
||||||
|
vkd3d_private_store_destroy(&device->private_store);
|
||||||
|
|
||||||
vkd3d_gpu_va_allocator_cleanup(&device->gpu_va_allocator);
|
vkd3d_gpu_va_allocator_cleanup(&device->gpu_va_allocator);
|
||||||
vkd3d_fence_worker_stop(&device->fence_worker, device);
|
vkd3d_fence_worker_stop(&device->fence_worker, device);
|
||||||
VK_CALL(vkDestroySampler(device->vk_device, device->vk_dummy_sampler, NULL));
|
VK_CALL(vkDestroySampler(device->vk_device, device->vk_dummy_sampler, NULL));
|
||||||
|
@ -1488,27 +1490,33 @@ static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device *iface)
|
||||||
static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device *iface,
|
static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device *iface,
|
||||||
REFGUID guid, UINT *data_size, void *data)
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %p, data %p stub!",
|
struct d3d12_device *device = impl_from_ID3D12Device(iface);
|
||||||
|
|
||||||
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n",
|
||||||
iface, debugstr_guid(guid), data_size, data);
|
iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return vkd3d_get_private_data(&device->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device *iface,
|
static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device *iface,
|
||||||
REFGUID guid, UINT data_size, const void *data)
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
|
struct d3d12_device *device = impl_from_ID3D12Device(iface);
|
||||||
|
|
||||||
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n",
|
||||||
iface, debugstr_guid(guid), data_size, data);
|
iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return vkd3d_set_private_data(&device->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateDataInterface(ID3D12Device *iface,
|
static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateDataInterface(ID3D12Device *iface,
|
||||||
REFGUID guid, const IUnknown *data)
|
REFGUID guid, const IUnknown *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
|
struct d3d12_device *device = impl_from_ID3D12Device(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
|
||||||
|
|
||||||
|
return vkd3d_set_private_data_interface(&device->private_store, guid, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device *iface, const WCHAR *name)
|
static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device *iface, const WCHAR *name)
|
||||||
|
@ -2526,6 +2534,8 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
|
||||||
if ((device->parent = create_info->parent))
|
if ((device->parent = create_info->parent))
|
||||||
IUnknown_AddRef(device->parent);
|
IUnknown_AddRef(device->parent);
|
||||||
|
|
||||||
|
vkd3d_private_store_init(&device->private_store);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
out_free_pipeline_cache:
|
out_free_pipeline_cache:
|
||||||
|
|
|
@ -860,6 +860,8 @@ struct d3d12_device
|
||||||
IUnknown *parent;
|
IUnknown *parent;
|
||||||
LUID adapter_luid;
|
LUID adapter_luid;
|
||||||
|
|
||||||
|
struct vkd3d_private_store private_store;
|
||||||
|
|
||||||
HRESULT removed_reason;
|
HRESULT removed_reason;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2581,6 +2581,7 @@ static void test_private_data(void)
|
||||||
&IID_ID3D12CommandAllocator,
|
&IID_ID3D12CommandAllocator,
|
||||||
&IID_ID3D12CommandList,
|
&IID_ID3D12CommandList,
|
||||||
&IID_ID3D12CommandQueue,
|
&IID_ID3D12CommandQueue,
|
||||||
|
&IID_ID3D12Device,
|
||||||
&IID_ID3D12Fence,
|
&IID_ID3D12Fence,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2621,6 +2622,11 @@ static void test_private_data(void)
|
||||||
&IID_IUnknown, (void **)&unknown);
|
&IID_IUnknown, (void **)&unknown);
|
||||||
ok(hr == S_OK, "Failed to create command queue, hr %#x.\n", hr);
|
ok(hr == S_OK, "Failed to create command queue, hr %#x.\n", hr);
|
||||||
}
|
}
|
||||||
|
else if (IsEqualGUID(tests[i], &IID_ID3D12Device))
|
||||||
|
{
|
||||||
|
vkd3d_test_set_context("device");
|
||||||
|
unknown = (IUnknown *)create_device();
|
||||||
|
}
|
||||||
else if (IsEqualGUID(tests[i], &IID_ID3D12Fence))
|
else if (IsEqualGUID(tests[i], &IID_ID3D12Fence))
|
||||||
{
|
{
|
||||||
vkd3d_test_set_context("fence");
|
vkd3d_test_set_context("fence");
|
||||||
|
@ -2733,6 +2739,12 @@ static void test_private_data(void)
|
||||||
ok(!size, "Got unexpected size %u.\n", size);
|
ok(!size, "Got unexpected size %u.\n", size);
|
||||||
ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr);
|
ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr);
|
||||||
|
|
||||||
|
if (IsEqualGUID(tests[i], &IID_ID3D12Device))
|
||||||
|
{
|
||||||
|
hr = ID3D12Object_SetPrivateDataInterface(object, &test_guid, NULL);
|
||||||
|
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
}
|
||||||
|
|
||||||
ID3D12Object_Release(object);
|
ID3D12Object_Release(object);
|
||||||
|
|
||||||
refcount = IUnknown_Release(test_object);
|
refcount = IUnknown_Release(test_object);
|
||||||
|
|
Loading…
Reference in New Issue