| Mark Lobodzinski | 6b35c8a | 2019-01-10 10:57:27 -0700 | [diff] [blame] | 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. |
| Mark Lobodzinski | d42e4d2 | 2017-01-17 14:14:22 -0700 | [diff] [blame] | 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> |
| Dave Houlton | 0d4ad6f | 2018-09-05 14:53:34 -0600 | [diff] [blame] | 19 | * Dave Houlton <daveh@lunarg.com> |
| Mark Lobodzinski | d42e4d2 | 2017-01-17 14:14:22 -0700 | [diff] [blame] | 20 | */ |
| 21 | #ifndef CORE_VALIDATION_BUFFER_VALIDATION_H_ |
| 22 | #define CORE_VALIDATION_BUFFER_VALIDATION_H_ |
| 23 | |
| Mark Lobodzinski | d42e4d2 | 2017-01-17 14:14:22 -0700 | [diff] [blame] | 24 | #include "vulkan/vk_layer.h" |
| Mark Lobodzinski | ab9ea3e | 2017-02-15 12:59:00 -0700 | [diff] [blame] | 25 | #include <limits.h> |
| Mark Lobodzinski | d42e4d2 | 2017-01-17 14:14:22 -0700 | [diff] [blame] | 26 | #include <memory> |
| 27 | #include <unordered_map> |
| 28 | #include <vector> |
| Mark Lobodzinski | 9ef5d56 | 2017-01-27 12:28:30 -0700 | [diff] [blame] | 29 | #include <utility> |
| Mark Lobodzinski | 3c0f636 | 2017-02-01 13:35:48 -0700 | [diff] [blame] | 30 | #include <algorithm> |
| Mark Lobodzinski | ab9ea3e | 2017-02-15 12:59:00 -0700 | [diff] [blame] | 31 | #include <bitset> |
| Mark Lobodzinski | 3c0f636 | 2017-02-01 13:35:48 -0700 | [diff] [blame] | 32 | |
| Dave Houlton | d961131 | 2018-11-19 17:03:36 -0700 | [diff] [blame] | 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 | |
| Mark Lobodzinski | 903e5ff | 2017-03-23 09:43:35 -0600 | [diff] [blame] | 37 | uint32_t ResolveRemainingLevels(const VkImageSubresourceRange *range, uint32_t mip_levels); |
| Mark Lobodzinski | d81d101 | 2017-02-01 09:03:06 -0700 | [diff] [blame] | 38 | |
| Mark Lobodzinski | 903e5ff | 2017-03-23 09:43:35 -0600 | [diff] [blame] | 39 | uint32_t ResolveRemainingLayers(const VkImageSubresourceRange *range, uint32_t layers); |
| John Zulauf | f660ad6 | 2019-03-23 07:16:05 -0600 | [diff] [blame] | 40 | VkImageSubresourceRange NormalizeSubresourceRange(const IMAGE_STATE &image_state, const VkImageSubresourceRange &range); |
| Mark Lobodzinski | d81d101 | 2017-02-01 09:03:06 -0700 | [diff] [blame] | 41 | |
| Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 42 | #endif // CORE_VALIDATION_BUFFER_VALIDATION_H_ |