libs/vkd3d: Add support for device parent.

In order to hold a reference to IDXGIAdapter.

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:
Józef Kucia
2018-02-02 15:39:21 +01:00
committed by Alexandre Julliard
parent b1fc5039c8
commit 372bd56ade
5 changed files with 105 additions and 0 deletions

View File

@@ -1216,6 +1216,8 @@ static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device *iface)
VK_CALL(vkDestroyPipelineCache(device->vk_device, device->vk_pipeline_cache, NULL));
d3d12_device_destroy_vkd3d_queues(device);
VK_CALL(vkDestroyDevice(device->vk_device, NULL));
if (device->parent)
IUnknown_Release(device->parent);
vkd3d_instance_decref(device->vkd3d_instance);
vkd3d_free(device);
@@ -2174,6 +2176,9 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
d3d12_device_init_pipeline_cache(device);
if ((device->parent = create_info->parent))
IUnknown_AddRef(device->parent);
return S_OK;
}
@@ -2199,6 +2204,13 @@ HRESULT d3d12_device_create(struct vkd3d_instance *instance,
return S_OK;
}
IUnknown *vkd3d_get_device_parent(ID3D12Device *device)
{
struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);
return d3d12_device->parent;
}
VkDevice vkd3d_get_vk_device(ID3D12Device *device)
{
struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);

View File

@@ -6,6 +6,7 @@ global:
vkd3d_create_image_resource;
vkd3d_create_instance;
vkd3d_create_root_signature_deserializer;
vkd3d_get_device_parent;
vkd3d_get_vk_device;
vkd3d_get_vk_format;
vkd3d_get_vk_physical_device;

View File

@@ -666,6 +666,7 @@ struct d3d12_device
vkd3d_create_thread_pfn create_thread;
vkd3d_join_thread_pfn join_thread;
IUnknown *parent;
LUID adapter_luid;
};