1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxvk] Add helper function to get info about depth-stencil image layouts

This commit is contained in:
Philip Rebohle 2019-05-03 14:37:59 +02:00
parent 81821414b0
commit 6eeb3b6da9
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -160,6 +160,17 @@ namespace dxvk::util {
inline uint32_t flattenImageExtent(VkExtent3D extent) {
return extent.width * extent.height * extent.depth;
}
/**
* \brief Checks whether the depth aspect is read-only in a layout
*
* \param [in] layout Image layout. Must be a valid depth-stencil attachment laoyut.
* \returns \c true if the depth aspect for images in this layout is read-only.
*/
inline bool isDepthReadOnlyLayout(VkImageLayout layout) {
return layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
|| layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL;
}
/**
* \brief Computes image data size, in bytes