| 29 | #include <vulkan/utility/vk_struct_helper.hpp> |
| 30 | |
| 31 | uint32_t GetEffectiveLevelCount(const VkImageSubresourceRange& subresource_range, uint32_t total_level_count) { |
| 32 | uint32_t level_count = subresource_range.levelCount; |
| 33 | if (level_count == VK_REMAINING_MIP_LEVELS) { |
| 34 | if (total_level_count > subresource_range.baseMipLevel) { |
| 35 | level_count = total_level_count - subresource_range.baseMipLevel; |
| 36 | } else { // invalid mip range which should be caught by validation |
| 37 | level_count = 0; |
| 38 | } |
| 39 | } |
| 40 | return level_count; |
| 41 | } |
| 42 | |
| 43 | uint32_t GetEffectiveLayerCount(const VkImageSubresourceRange& subresource_range, uint32_t total_layer_count) { |
| 44 | uint32_t layer_count = subresource_range.layerCount; |
no outgoing calls
no test coverage detected