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

Function GetEffectiveLayerCount

layers/utils/image_utils.cpp:43–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43uint32_t GetEffectiveLayerCount(const VkImageSubresourceRange& subresource_range, uint32_t total_layer_count) {
44 uint32_t layer_count = subresource_range.layerCount;
45 if (layer_count == VK_REMAINING_ARRAY_LAYERS) {
46 if (total_layer_count > subresource_range.baseArrayLayer) {
47 layer_count = total_layer_count - subresource_range.baseArrayLayer;
48 } else { // invalid array layer range which should be caught by validation
49 layer_count = 0;
50 }
51 }
52 return layer_count;
53}
54
55// Returns the effective extent of an image subresource, adjusted for mip level and array depth.
56VkExtent3D GetEffectiveExtent(uint32_t mip_levels, VkExtent3D extent, VkFormat format, VkImageCreateFlags2KHR flags,

Callers 4

GetRemainingFunction · 0.85
ForEachSubresourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected