1 /* Copyright (c) 2015-2019 The Khronos Group Inc.
2  * Copyright (c) 2015-2019 Valve Corporation
3  * Copyright (c) 2015-2019 LunarG, Inc.
4  * Copyright (C) 2015-2019 Google Inc.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * Mark Lobodzinski <mark@lunarg.com>
19  * Dave Houlton <daveh@lunarg.com>
20  */
21 #ifndef CORE_VALIDATION_BUFFER_VALIDATION_H_
22 #define CORE_VALIDATION_BUFFER_VALIDATION_H_
23 
24 #include "vulkan/vk_layer.h"
25 #include <limits.h>
26 #include <memory>
27 #include <unordered_map>
28 #include <vector>
29 #include <utility>
30 #include <algorithm>
31 #include <bitset>
32 
33 uint32_t FullMipChainLevels(uint32_t height, uint32_t width = 1, uint32_t depth = 1);
34 uint32_t FullMipChainLevels(VkExtent3D);
35 uint32_t FullMipChainLevels(VkExtent2D);
36 
37 uint32_t ResolveRemainingLevels(const VkImageSubresourceRange *range, uint32_t mip_levels);
38 
39 uint32_t ResolveRemainingLayers(const VkImageSubresourceRange *range, uint32_t layers);
40 VkImageSubresourceRange NormalizeSubresourceRange(const IMAGE_STATE &image_state, const VkImageSubresourceRange &range);
41 
42 #endif  // CORE_VALIDATION_BUFFER_VALIDATION_H_
43