mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[d3d11] Added GetBufferFormatFeatures and GetImageFormatFeatures helpers
This commit is contained in:
parent
f586970c59
commit
7e0a2a9165
@ -157,4 +157,32 @@ namespace dxvk {
|
|||||||
return usage;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -46,4 +46,10 @@ namespace dxvk {
|
|||||||
VkImageUsageFlags GetImageUsageFlags(
|
VkImageUsageFlags GetImageUsageFlags(
|
||||||
UINT BindFlags);
|
UINT BindFlags);
|
||||||
|
|
||||||
|
VkFormatFeatureFlags GetBufferFormatFeatures(
|
||||||
|
UINT BindFlags);
|
||||||
|
|
||||||
|
VkFormatFeatureFlags GetImageFormatFeatures(
|
||||||
|
UINT BindFlags);
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user