From 7568a9793cfdc8558729a4f134458e745b91c339 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 17 Oct 2016 18:49:44 +0200 Subject: [PATCH] libs/vkd3d: Export a function to get the Vulkan device from a d3d12 device. --- include/vkd3d.h | 1 + libs/vkd3d/device.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/vkd3d.h b/include/vkd3d.h index 87b5bdac..a76398d6 100644 --- a/include/vkd3d.h +++ b/include/vkd3d.h @@ -44,6 +44,7 @@ HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info, REFIID riid, void **device); HRESULT vkd3d_create_image_resource(ID3D12Device *device, const D3D12_RESOURCE_DESC *desc, VkImage vk_image, ID3D12Resource **resource); +VkDevice vkd3d_get_vk_device(ID3D12Device *device); VkInstance vkd3d_get_vk_instance(ID3D12Device *device); #ifdef __cplusplus diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 3da098b3..e7c6a38b 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1151,6 +1151,13 @@ HRESULT d3d12_device_create(const struct vkd3d_device_create_info *create_info, return S_OK; } +VkDevice vkd3d_get_vk_device(ID3D12Device *device) +{ + struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device); + + return d3d12_device->vk_device; +} + VkInstance vkd3d_get_vk_instance(ID3D12Device *device) { struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);