Skip to content
Snippets Groups Projects
Verified Commit 7a3829bb authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Added function to check format for stencil portion

parent 48639293
No related branches found
No related tags found
1 merge request!105Resolve "Refactor Core API"
......@@ -23,6 +23,15 @@ namespace vkcv {
* otherwise false.
*/
bool isDepthFormat(const vk::Format format);
/**
* @brief Returns whether an image format is usable as stencil buffer.
*
* @param format Vulkan image format
* @return True, if the format is valid to use as stencil buffer,
* otherwise false.
*/
bool isStencilFormat(const vk::Format format);
/**
* @brief Class for image handling and filling data.
......
......@@ -12,12 +12,26 @@ namespace vkcv{
bool isDepthFormat(const vk::Format format) {
switch (format) {
case(vk::Format::eD16Unorm): return true;
case(vk::Format::eD16UnormS8Uint): return true;
case(vk::Format::eD24UnormS8Uint): return true;
case(vk::Format::eD32Sfloat): return true;
case(vk::Format::eD32SfloatS8Uint): return true;
default: return false;
case(vk::Format::eD16Unorm):
case(vk::Format::eD16UnormS8Uint):
case(vk::Format::eD24UnormS8Uint):
case(vk::Format::eD32Sfloat):
case(vk::Format::eD32SfloatS8Uint):
return true;
default:
return false;
}
}
bool isStencilFormat(const vk::Format format) {
switch (format) {
case(vk::Format::eS8Uint):
case(vk::Format::eD16UnormS8Uint):
case(vk::Format::eD24UnormS8Uint):
case(vk::Format::eD32SfloatS8Uint):
return true;
default:
return false;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment