libs/vkd3d: Export a function to get the Vulkan physical device from a d3d12 device.

This commit is contained in:
Henri Verbeet 2016-10-22 21:07:46 +02:00
parent c79584ed92
commit b760b52859
3 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,7 @@ HRESULT vkd3d_create_image_resource(ID3D12Device *device, const D3D12_RESOURCE_D
VkImage vk_image, ID3D12Resource **resource); VkImage vk_image, ID3D12Resource **resource);
VkDevice vkd3d_get_vk_device(ID3D12Device *device); VkDevice vkd3d_get_vk_device(ID3D12Device *device);
VkInstance vkd3d_get_vk_instance(ID3D12Device *device); VkInstance vkd3d_get_vk_instance(ID3D12Device *device);
VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device);
VkQueue vkd3d_get_vk_queue(ID3D12CommandQueue *queue); VkQueue vkd3d_get_vk_queue(ID3D12CommandQueue *queue);
uint32_t vkd3d_get_vk_queue_family_index(ID3D12CommandQueue *queue); uint32_t vkd3d_get_vk_queue_family_index(ID3D12CommandQueue *queue);

View File

@ -453,6 +453,7 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device)
return hr; return hr;
} }
device->vk_physical_device = physical_device;
device->vk_device = vk_device; device->vk_device = vk_device;
TRACE("Created Vulkan device %p.\n", vk_device); TRACE("Created Vulkan device %p.\n", vk_device);
@ -1198,3 +1199,10 @@ VkInstance vkd3d_get_vk_instance(ID3D12Device *device)
return d3d12_device->vkd3d_instance.vk_instance; return d3d12_device->vkd3d_instance.vk_instance;
} }
VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device)
{
struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);
return d3d12_device->vk_physical_device;
}

View File

@ -343,6 +343,7 @@ struct d3d12_device
LONG refcount; LONG refcount;
VkDevice vk_device; VkDevice vk_device;
VkPhysicalDevice vk_physical_device;
struct vkd3d_vk_device_procs vk_procs; struct vkd3d_vk_device_procs vk_procs;
vkd3d_signal_event_pfn signal_event; vkd3d_signal_event_pfn signal_event;