blob: a4cf548e8339e1dab78558922ba9cbfbc5f999eb [file] [log] [blame]
Mark Lobodzinski6b35c8a2019-01-10 10:57:27 -07001/* 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 Lobodzinskid42e4d22017-01-17 14:14:22 -07005 *
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 Houlton0d4ad6f2018-09-05 14:53:34 -060019 * Dave Houlton <daveh@lunarg.com>
Mark Lobodzinskid42e4d22017-01-17 14:14:22 -070020 */
21#ifndef CORE_VALIDATION_BUFFER_VALIDATION_H_
22#define CORE_VALIDATION_BUFFER_VALIDATION_H_
23
Mark Lobodzinskid42e4d22017-01-17 14:14:22 -070024#include "vulkan/vk_layer.h"
Mark Lobodzinskiab9ea3e2017-02-15 12:59:00 -070025#include <limits.h>
Mark Lobodzinskid42e4d22017-01-17 14:14:22 -070026#include <memory>
27#include <unordered_map>
28#include <vector>
Mark Lobodzinski9ef5d562017-01-27 12:28:30 -070029#include <utility>
Mark Lobodzinski3c0f6362017-02-01 13:35:48 -070030#include <algorithm>
Mark Lobodzinskiab9ea3e2017-02-15 12:59:00 -070031#include <bitset>
Mark Lobodzinski3c0f6362017-02-01 13:35:48 -070032
Dave Houltond9611312018-11-19 17:03:36 -070033uint32_t FullMipChainLevels(uint32_t height, uint32_t width = 1, uint32_t depth = 1);
34uint32_t FullMipChainLevels(VkExtent3D);
35uint32_t FullMipChainLevels(VkExtent2D);
36
Mark Lobodzinski903e5ff2017-03-23 09:43:35 -060037uint32_t ResolveRemainingLevels(const VkImageSubresourceRange *range, uint32_t mip_levels);
Mark Lobodzinskid81d1012017-02-01 09:03:06 -070038
Mark Lobodzinski903e5ff2017-03-23 09:43:35 -060039uint32_t ResolveRemainingLayers(const VkImageSubresourceRange *range, uint32_t layers);
John Zulauff660ad62019-03-23 07:16:05 -060040VkImageSubresourceRange NormalizeSubresourceRange(const IMAGE_STATE &image_state, const VkImageSubresourceRange &range);
Mark Lobodzinskid81d1012017-02-01 09:03:06 -070041
Mark Lobodzinski64318ba2017-01-26 13:34:13 -070042#endif // CORE_VALIDATION_BUFFER_VALIDATION_H_