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 class CoreChecks; 34 typedef CoreChecks layer_data; 35 36 uint32_t FullMipChainLevels(uint32_t height, uint32_t width = 1, uint32_t depth = 1); 37 uint32_t FullMipChainLevels(VkExtent3D); 38 uint32_t FullMipChainLevels(VkExtent2D); 39 40 uint32_t ResolveRemainingLevels(const VkImageSubresourceRange *range, uint32_t mip_levels); 41 42 uint32_t ResolveRemainingLayers(const VkImageSubresourceRange *range, uint32_t layers); 43 44 bool FindLayout(const std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> &imageLayoutMap, ImageSubresourcePair imgpair, 45 VkImageLayout &layout, const VkImageAspectFlags aspectMask); 46 47 void SetLayout(std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> &imageLayoutMap, ImageSubresourcePair imgpair, 48 VkImageLayout layout); 49 50 #endif // CORE_VALIDATION_BUFFER_VALIDATION_H_ 51