MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / GetEffectiveLevelCount

Function GetEffectiveLevelCount

layers/utils/image_utils.cpp:31–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#include <vulkan/utility/vk_struct_helper.hpp>
30
31uint32_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
43uint32_t GetEffectiveLayerCount(const VkImageSubresourceRange& subresource_range, uint32_t total_layer_count) {
44 uint32_t layer_count = subresource_range.layerCount;

Callers 4

GetRemainingFunction · 0.85
ForEachSubresourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected