1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 04:24:11 +01:00

[d3d11] Added GetBufferFormatFeatures and GetImageFormatFeatures helpers

This commit is contained in:
Philip Rebohle 2018-08-09 23:33:36 +02:00
parent f586970c59
commit 7e0a2a9165
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 34 additions and 0 deletions

View File

@ -157,4 +157,32 @@ namespace dxvk {
return usage;
}
VkFormatFeatureFlags GetBufferFormatFeatures(UINT BindFlags) {
VkFormatFeatureFlags features = 0;
if (BindFlags & D3D11_BIND_SHADER_RESOURCE)
features |= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT;
if (BindFlags & D3D11_BIND_UNORDERED_ACCESS)
features |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT;
return features;
}
VkFormatFeatureFlags GetImageFormatFeatures(UINT BindFlags) {
VkFormatFeatureFlags features = 0;
if (BindFlags & D3D11_BIND_DEPTH_STENCIL)
features |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT;
if (BindFlags & D3D11_BIND_RENDER_TARGET)
features |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT;
if (BindFlags & D3D11_BIND_SHADER_RESOURCE)
features |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
if (BindFlags & D3D11_BIND_UNORDERED_ACCESS)
features |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
return features;
}
}

View File

@ -45,5 +45,11 @@ namespace dxvk {
VkImageUsageFlags GetImageUsageFlags(
UINT BindFlags);
VkFormatFeatureFlags GetBufferFormatFeatures(
UINT BindFlags);
VkFormatFeatureFlags GetImageFormatFeatures(
UINT BindFlags);
}