KhronosGroup / Vulkan-Tutorial

Khronos version of the Vulkan Tutorial as parts of the Vulkan documentation project
Creative Commons Attribution Share Alike 4.0 International
29 stars 4 forks source link

Unused helper function #46

Open NecdetYavas opened 1 month ago

NecdetYavas commented 1 month ago

I'm still new at Vulkan and followed the tutorial until multisampling. During deph buffering chapter we create a helper function:

bool hasStencilComponent(VkFormat format) { return format == VK_FORMAT_D32_SFLOAT_S8_UINT || format == VK_FORMAT_D24_UNORM_S8_UINT; }

But in the source code, it's not used anywhere.

SaschaWillems commented 1 month ago

Thanks for bringing this up.

The function itself could be used to check if you have a pure depth format with no stencil part. In such a case, you need to use different image aspects in some places.

But this is indeed not used in any of the source files. I'll look into this.