15#include <dxgiformat.h>
22static inline DXGI_FORMAT
26 case VK_FORMAT_B8G8R8A8_SRGB:
return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
27 case VK_FORMAT_B8G8R8A8_UNORM:
return DXGI_FORMAT_B8G8R8A8_UNORM;
28 case VK_FORMAT_D16_UNORM:
return DXGI_FORMAT_D16_UNORM;
29 case VK_FORMAT_D24_UNORM_S8_UINT:
return DXGI_FORMAT_D24_UNORM_S8_UINT;
30 case VK_FORMAT_D32_SFLOAT_S8_UINT:
return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
31 case VK_FORMAT_D32_SFLOAT:
return DXGI_FORMAT_D32_FLOAT;
34 case VK_FORMAT_R16G16B16A16_SFLOAT:
return DXGI_FORMAT_R16G16B16A16_FLOAT;
35 case VK_FORMAT_R16G16B16A16_UNORM:
return DXGI_FORMAT_R16G16B16A16_UNORM;
36 case VK_FORMAT_R8G8B8A8_SRGB:
return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
37 case VK_FORMAT_R8G8B8A8_UNORM:
return DXGI_FORMAT_R8G8B8A8_UNORM;
38 case VK_FORMAT_R32_SFLOAT:
return DXGI_FORMAT_R32_FLOAT;
40 case VK_FORMAT_X8_D24_UNORM_PACK32:
41 return (DXGI_FORMAT)0;
42 case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
43 return (DXGI_FORMAT)0;
45 default:
return (DXGI_FORMAT)0;
49static inline DXGI_FORMAT
50d3d_dxgi_format_to_typeless_dxgi(DXGI_FORMAT format)
53 case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
54 case DXGI_FORMAT_B8G8R8A8_UNORM:
55 return DXGI_FORMAT_B8G8R8A8_TYPELESS;
57 case DXGI_FORMAT_D16_UNORM:
58 return DXGI_FORMAT_R16_TYPELESS;
60 case DXGI_FORMAT_D32_FLOAT:
61 return DXGI_FORMAT_R32_TYPELESS;
63 case DXGI_FORMAT_D24_UNORM_S8_UINT:
64 return DXGI_FORMAT_R24G8_TYPELESS;
66 case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
67 return DXGI_FORMAT_R32G8X24_TYPELESS;
69 case DXGI_FORMAT_R16G16B16A16_FLOAT:
70 case DXGI_FORMAT_R16G16B16A16_UNORM:
71 return DXGI_FORMAT_R16G16B16A16_TYPELESS;
73 case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
74 case DXGI_FORMAT_R8G8B8A8_UNORM:
75 return DXGI_FORMAT_R8G8B8A8_TYPELESS;
77 case DXGI_FORMAT_R32_FLOAT:
78 return DXGI_FORMAT_R32_TYPELESS;
80 default:
return format;
85d3d_dxgi_format_to_vk(DXGI_FORMAT format)
88 case DXGI_FORMAT_R8G8B8A8_UNORM:
return VK_FORMAT_R8G8B8A8_UNORM;
89 case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
return VK_FORMAT_R8G8B8A8_SRGB;
90 case DXGI_FORMAT_B8G8R8A8_UNORM:
return VK_FORMAT_B8G8R8A8_UNORM;
91 case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
return VK_FORMAT_B8G8R8A8_SRGB;
92 case DXGI_FORMAT_R16G16B16A16_FLOAT:
return VK_FORMAT_R16G16B16A16_SFLOAT;
93 case DXGI_FORMAT_R16G16B16A16_UNORM:
return VK_FORMAT_R16G16B16A16_UNORM;
94 case DXGI_FORMAT_R16G16B16A16_SNORM:
return VK_FORMAT_R16G16B16A16_SNORM;
95 case DXGI_FORMAT_R32_FLOAT:
return VK_FORMAT_R32_SFLOAT;
96 case DXGI_FORMAT_D16_UNORM:
return VK_FORMAT_D16_UNORM;
97 case DXGI_FORMAT_D32_FLOAT:
return VK_FORMAT_D32_SFLOAT;
98 case DXGI_FORMAT_D24_UNORM_S8_UINT:
return VK_FORMAT_D24_UNORM_S8_UINT;
99 case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
return VK_FORMAT_D32_SFLOAT_S8_UINT;
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.
A minimal way to include Windows.h.