1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[d3d11] Add helper to find exact mapping for depth-stencil formats

This is necessary in situations when we need to get the Vulkan format
that corresponds to the DXGI format rather than the remapped one.
This commit is contained in:
Philip Rebohle 2018-11-08 18:49:52 +01:00
parent 2b02e692c3
commit 81a5e2fa0c
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 23 additions and 0 deletions

View File

@ -157,4 +157,24 @@ namespace dxvk {
return features;
}
VkFormat GetPackedDepthStencilFormat(DXGI_FORMAT Format) {
switch (Format) {
case DXGI_FORMAT_R24G8_TYPELESS:
case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
case DXGI_FORMAT_D24_UNORM_S8_UINT:
return VK_FORMAT_D24_UNORM_S8_UINT;
case DXGI_FORMAT_R32G8X24_TYPELESS:
case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
return VK_FORMAT_D32_SFLOAT_S8_UINT;
default:
return VK_FORMAT_UNDEFINED;
}
}
}

View File

@ -48,5 +48,8 @@ namespace dxvk {
VkFormatFeatureFlags GetImageFormatFeatures(
UINT BindFlags);
VkFormat GetPackedDepthStencilFormat(
DXGI_FORMAT Format);
}