vkspec.html#formats-planes-image-aspect
| 209 | |
| 210 | // vkspec.html#formats-planes-image-aspect |
| 211 | bool IsValidPlaneAspect(VkFormat format, VkImageAspectFlags aspect_mask) { |
| 212 | const uint32_t planes = vkuFormatPlaneCount(format); |
| 213 | constexpr VkImageAspectFlags valid_planes = |
| 214 | VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT; |
| 215 | |
| 216 | if (((aspect_mask & valid_planes) == aspect_mask) && (aspect_mask != 0)) { |
| 217 | if ((planes == 3) || ((planes == 2) && ((aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT) == 0))) { |
| 218 | return true; |
| 219 | } |
| 220 | } |
| 221 | return false; // Expects calls to make sure it is a multi-planar format |
| 222 | } |
| 223 | |
| 224 | bool IsOnlyOneValidPlaneAspect(VkFormat format, VkImageAspectFlags aspect_mask) { |
| 225 | const bool multiple_bits = aspect_mask != 0 && !IsPowerOfTwo(aspect_mask); |
no outgoing calls
no test coverage detected