libs/vkd3d: Export a function to get the Vulkan format from a DXGI format.

This commit is contained in:
Henri Verbeet 2016-10-22 21:11:42 +02:00
parent b760b52859
commit 6babf11214
2 changed files with 11 additions and 0 deletions

View File

@ -45,6 +45,7 @@ HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
HRESULT vkd3d_create_image_resource(ID3D12Device *device, const D3D12_RESOURCE_DESC *desc,
VkImage vk_image, ID3D12Resource **resource);
VkDevice vkd3d_get_vk_device(ID3D12Device *device);
VkFormat vkd3d_get_vk_format(DXGI_FORMAT format);
VkInstance vkd3d_get_vk_instance(ID3D12Device *device);
VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device);
VkQueue vkd3d_get_vk_queue(ID3D12CommandQueue *queue);

View File

@ -47,6 +47,16 @@ const struct vkd3d_format *vkd3d_get_format(DXGI_FORMAT dxgi_format)
return NULL;
}
VkFormat vkd3d_get_vk_format(DXGI_FORMAT format)
{
const struct vkd3d_format *vkd3d_format;
if (!(vkd3d_format = vkd3d_get_format(format)))
return VK_FORMAT_UNDEFINED;
return vkd3d_format->vk_format;
}
bool vkd3d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size)
{
size_t new_capacity, max_capacity;