Mark Lobodzinski | d42e4d2 | 2017-01-17 14:14:22 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2015-2017 The Khronos Group Inc. |
| 2 | * Copyright (c) 2015-2017 Valve Corporation |
| 3 | * Copyright (c) 2015-2017 LunarG, Inc. |
| 4 | * Copyright (C) 2015-2017 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 | * Author: Mark Lobodzinski <mark@lunarg.com> |
| 19 | */ |
| 20 | |
| 21 | // Allow use of STL min and max functions in Windows |
| 22 | #define NOMINMAX |
| 23 | |
| 24 | #include "buffer_validation.h" |
Mark Lobodzinski | 42fe5f7 | 2017-01-11 11:36:16 -0700 | [diff] [blame] | 25 | |
Mark Lobodzinski | bf93db7 | 2017-01-17 16:24:29 -0700 | [diff] [blame^] | 26 | void PostCallRecordCreateImage(std::unordered_map<VkImage, std::unique_ptr<IMAGE_STATE>> *imageMap, |
| 27 | std::unordered_map<VkImage, std::vector<ImageSubresourcePair>> *imageSubresourceMap, |
| 28 | std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> *imageLayoutMap, |
| 29 | const VkImageCreateInfo *pCreateInfo, VkImage *pImage) { |
Mark Lobodzinski | 42fe5f7 | 2017-01-11 11:36:16 -0700 | [diff] [blame] | 30 | IMAGE_LAYOUT_NODE image_state; |
| 31 | image_state.layout = pCreateInfo->initialLayout; |
| 32 | image_state.format = pCreateInfo->format; |
Mark Lobodzinski | bf93db7 | 2017-01-17 16:24:29 -0700 | [diff] [blame^] | 33 | (*imageMap).insert(std::make_pair(*pImage, std::unique_ptr<IMAGE_STATE>(new IMAGE_STATE(*pImage, pCreateInfo)))); |
Mark Lobodzinski | 42fe5f7 | 2017-01-11 11:36:16 -0700 | [diff] [blame] | 34 | ImageSubresourcePair subpair{*pImage, false, VkImageSubresource()}; |
Mark Lobodzinski | bf93db7 | 2017-01-17 16:24:29 -0700 | [diff] [blame^] | 35 | (*imageSubresourceMap)[*pImage].push_back(subpair); |
| 36 | (*imageLayoutMap)[subpair] = image_state; |
Mark Lobodzinski | 42fe5f7 | 2017-01-11 11:36:16 -0700 | [diff] [blame] | 37 | } |