| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1 | |
| 2 | // This file is ***GENERATED***. Do Not Edit. |
| 3 | // See layer_chassis_dispatch_generator.py for modifications. |
| 4 | |
| 5 | /* Copyright (c) 2015-2019 The Khronos Group Inc. |
| 6 | * Copyright (c) 2015-2019 Valve Corporation |
| 7 | * Copyright (c) 2015-2019 LunarG, Inc. |
| 8 | * Copyright (c) 2015-2019 Google Inc. |
| 9 | * |
| 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 11 | * you may not use this file except in compliance with the License. |
| 12 | * You may obtain a copy of the License at |
| 13 | * |
| 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | * |
| 16 | * Unless required by applicable law or agreed to in writing, software |
| 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | * See the License for the specific language governing permissions and |
| 20 | * limitations under the License. |
| 21 | * |
| 22 | * Author: Mark Lobodzinski <mark@lunarg.com> |
| 23 | */ |
| 24 | |
| 25 | #include <mutex> |
| 26 | #include "chassis.h" |
| 27 | #include "layer_chassis_dispatch.h" |
| 28 | #include "vk_layer_utils.h" |
| 29 | |
| 30 | // This intentionally includes a cpp file |
| 31 | #include "vk_safe_struct.cpp" |
| 32 | |
| 33 | std::mutex dispatch_lock; |
| 34 | |
| 35 | // Unique Objects pNext extension handling function |
| 36 | void *CreateUnwrappedExtensionStructs(ValidationObject *layer_data, const void *pNext) { |
| 37 | void *cur_pnext = const_cast<void *>(pNext); |
| 38 | void *head_pnext = NULL; |
| 39 | void *prev_ext_struct = NULL; |
| 40 | void *cur_ext_struct = NULL; |
| 41 | |
| 42 | while (cur_pnext != NULL) { |
| 43 | VkBaseOutStructure *header = reinterpret_cast<VkBaseOutStructure *>(cur_pnext); |
| 44 | |
| 45 | switch (header->sType) { |
| 46 | case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: { |
| 47 | safe_VkDebugReportCallbackCreateInfoEXT *safe_struct = new safe_VkDebugReportCallbackCreateInfoEXT; |
| 48 | safe_struct->initialize(reinterpret_cast<const VkDebugReportCallbackCreateInfoEXT *>(cur_pnext)); |
| 49 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 50 | } break; |
| 51 | |
| 52 | case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: { |
| 53 | safe_VkDebugUtilsMessengerCreateInfoEXT *safe_struct = new safe_VkDebugUtilsMessengerCreateInfoEXT; |
| 54 | safe_struct->initialize(reinterpret_cast<const VkDebugUtilsMessengerCreateInfoEXT *>(cur_pnext)); |
| 55 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 56 | } break; |
| 57 | |
| 58 | case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: { |
| 59 | safe_VkValidationFeaturesEXT *safe_struct = new safe_VkValidationFeaturesEXT; |
| 60 | safe_struct->initialize(reinterpret_cast<const VkValidationFeaturesEXT *>(cur_pnext)); |
| 61 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 62 | } break; |
| 63 | |
| 64 | case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: { |
| 65 | safe_VkValidationFlagsEXT *safe_struct = new safe_VkValidationFlagsEXT; |
| 66 | safe_struct->initialize(reinterpret_cast<const VkValidationFlagsEXT *>(cur_pnext)); |
| 67 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 68 | } break; |
| 69 | |
| 70 | case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: { |
| 71 | safe_VkDeviceQueueGlobalPriorityCreateInfoEXT *safe_struct = new safe_VkDeviceQueueGlobalPriorityCreateInfoEXT; |
| 72 | safe_struct->initialize(reinterpret_cast<const VkDeviceQueueGlobalPriorityCreateInfoEXT *>(cur_pnext)); |
| 73 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 74 | } break; |
| 75 | |
| 76 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: { |
| 77 | safe_VkDeviceGroupDeviceCreateInfo *safe_struct = new safe_VkDeviceGroupDeviceCreateInfo; |
| 78 | safe_struct->initialize(reinterpret_cast<const VkDeviceGroupDeviceCreateInfo *>(cur_pnext)); |
| 79 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 80 | } break; |
| 81 | |
| 82 | case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: { |
| 83 | safe_VkDeviceMemoryOverallocationCreateInfoAMD *safe_struct = new safe_VkDeviceMemoryOverallocationCreateInfoAMD; |
| 84 | safe_struct->initialize(reinterpret_cast<const VkDeviceMemoryOverallocationCreateInfoAMD *>(cur_pnext)); |
| 85 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 86 | } break; |
| 87 | |
| 88 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: { |
| 89 | safe_VkPhysicalDevice16BitStorageFeatures *safe_struct = new safe_VkPhysicalDevice16BitStorageFeatures; |
| 90 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures *>(cur_pnext)); |
| 91 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 92 | } break; |
| 93 | |
| 94 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: { |
| 95 | safe_VkPhysicalDevice8BitStorageFeaturesKHR *safe_struct = new safe_VkPhysicalDevice8BitStorageFeaturesKHR; |
| 96 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDevice8BitStorageFeaturesKHR *>(cur_pnext)); |
| 97 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 98 | } break; |
| 99 | |
| 100 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: { |
| 101 | safe_VkPhysicalDeviceASTCDecodeFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceASTCDecodeFeaturesEXT; |
| 102 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceASTCDecodeFeaturesEXT *>(cur_pnext)); |
| 103 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 104 | } break; |
| 105 | |
| 106 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: { |
| 107 | safe_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; |
| 108 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *>(cur_pnext)); |
| 109 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 110 | } break; |
| 111 | |
| 112 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: { |
| 113 | safe_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT; |
| 114 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *>(cur_pnext)); |
| 115 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 116 | } break; |
| 117 | |
| 118 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: { |
| 119 | safe_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *safe_struct = new safe_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV; |
| 120 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *>(cur_pnext)); |
| 121 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 122 | } break; |
| 123 | |
| 124 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: { |
| 125 | safe_VkPhysicalDeviceConditionalRenderingFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceConditionalRenderingFeaturesEXT; |
| 126 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceConditionalRenderingFeaturesEXT *>(cur_pnext)); |
| 127 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 128 | } break; |
| 129 | |
| 130 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: { |
| 131 | safe_VkPhysicalDeviceCooperativeMatrixFeaturesNV *safe_struct = new safe_VkPhysicalDeviceCooperativeMatrixFeaturesNV; |
| 132 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixFeaturesNV *>(cur_pnext)); |
| 133 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 134 | } break; |
| 135 | |
| 136 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: { |
| 137 | safe_VkPhysicalDeviceCornerSampledImageFeaturesNV *safe_struct = new safe_VkPhysicalDeviceCornerSampledImageFeaturesNV; |
| 138 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceCornerSampledImageFeaturesNV *>(cur_pnext)); |
| 139 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 140 | } break; |
| 141 | |
| 142 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: { |
| 143 | safe_VkPhysicalDeviceCoverageReductionModeFeaturesNV *safe_struct = new safe_VkPhysicalDeviceCoverageReductionModeFeaturesNV; |
| 144 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceCoverageReductionModeFeaturesNV *>(cur_pnext)); |
| 145 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 146 | } break; |
| 147 | |
| 148 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: { |
| 149 | safe_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *safe_struct = new safe_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; |
| 150 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *>(cur_pnext)); |
| 151 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 152 | } break; |
| 153 | |
| 154 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: { |
| 155 | safe_VkPhysicalDeviceDepthClipEnableFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceDepthClipEnableFeaturesEXT; |
| 156 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceDepthClipEnableFeaturesEXT *>(cur_pnext)); |
| 157 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 158 | } break; |
| 159 | |
| 160 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT: { |
| 161 | safe_VkPhysicalDeviceDescriptorIndexingFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceDescriptorIndexingFeaturesEXT; |
| 162 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingFeaturesEXT *>(cur_pnext)); |
| 163 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 164 | } break; |
| 165 | |
| 166 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: { |
| 167 | safe_VkPhysicalDeviceExclusiveScissorFeaturesNV *safe_struct = new safe_VkPhysicalDeviceExclusiveScissorFeaturesNV; |
| 168 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceExclusiveScissorFeaturesNV *>(cur_pnext)); |
| 169 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 170 | } break; |
| 171 | |
| 172 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: { |
| 173 | safe_VkPhysicalDeviceFeatures2 *safe_struct = new safe_VkPhysicalDeviceFeatures2; |
| 174 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceFeatures2 *>(cur_pnext)); |
| 175 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 176 | } break; |
| 177 | |
| 178 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR: { |
| 179 | safe_VkPhysicalDeviceFloat16Int8FeaturesKHR *safe_struct = new safe_VkPhysicalDeviceFloat16Int8FeaturesKHR; |
| 180 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceFloat16Int8FeaturesKHR *>(cur_pnext)); |
| 181 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 182 | } break; |
| 183 | |
| 184 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: { |
| 185 | safe_VkPhysicalDeviceFragmentDensityMapFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceFragmentDensityMapFeaturesEXT; |
| 186 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *>(cur_pnext)); |
| 187 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 188 | } break; |
| 189 | |
| 190 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: { |
| 191 | safe_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV *safe_struct = new safe_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV; |
| 192 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV *>(cur_pnext)); |
| 193 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 194 | } break; |
| 195 | |
| 196 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: { |
| 197 | safe_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT; |
| 198 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *>(cur_pnext)); |
| 199 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 200 | } break; |
| 201 | |
| 202 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: { |
| 203 | safe_VkPhysicalDeviceHostQueryResetFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceHostQueryResetFeaturesEXT; |
| 204 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceHostQueryResetFeaturesEXT *>(cur_pnext)); |
| 205 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 206 | } break; |
| 207 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 208 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR: { |
| 209 | safe_VkPhysicalDeviceImagelessFramebufferFeaturesKHR *safe_struct = new safe_VkPhysicalDeviceImagelessFramebufferFeaturesKHR; |
| 210 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceImagelessFramebufferFeaturesKHR *>(cur_pnext)); |
| 211 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 212 | } break; |
| 213 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 214 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: { |
| 215 | safe_VkPhysicalDeviceInlineUniformBlockFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceInlineUniformBlockFeaturesEXT; |
| 216 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockFeaturesEXT *>(cur_pnext)); |
| 217 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 218 | } break; |
| 219 | |
| 220 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: { |
| 221 | safe_VkPhysicalDeviceMemoryPriorityFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceMemoryPriorityFeaturesEXT; |
| 222 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMemoryPriorityFeaturesEXT *>(cur_pnext)); |
| 223 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 224 | } break; |
| 225 | |
| 226 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: { |
| 227 | safe_VkPhysicalDeviceMeshShaderFeaturesNV *safe_struct = new safe_VkPhysicalDeviceMeshShaderFeaturesNV; |
| 228 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMeshShaderFeaturesNV *>(cur_pnext)); |
| 229 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 230 | } break; |
| 231 | |
| 232 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: { |
| 233 | safe_VkPhysicalDeviceMultiviewFeatures *safe_struct = new safe_VkPhysicalDeviceMultiviewFeatures; |
| 234 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMultiviewFeatures *>(cur_pnext)); |
| 235 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 236 | } break; |
| 237 | |
| 238 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: { |
| 239 | safe_VkPhysicalDeviceProtectedMemoryFeatures *safe_struct = new safe_VkPhysicalDeviceProtectedMemoryFeatures; |
| 240 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceProtectedMemoryFeatures *>(cur_pnext)); |
| 241 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 242 | } break; |
| 243 | |
| 244 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: { |
| 245 | safe_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *safe_struct = new safe_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV; |
| 246 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *>(cur_pnext)); |
| 247 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 248 | } break; |
| 249 | |
| 250 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: { |
| 251 | safe_VkPhysicalDeviceSamplerYcbcrConversionFeatures *safe_struct = new safe_VkPhysicalDeviceSamplerYcbcrConversionFeatures; |
| 252 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures *>(cur_pnext)); |
| 253 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 254 | } break; |
| 255 | |
| 256 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: { |
| 257 | safe_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT; |
| 258 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceScalarBlockLayoutFeaturesEXT *>(cur_pnext)); |
| 259 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 260 | } break; |
| 261 | |
| 262 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: { |
| 263 | safe_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *safe_struct = new safe_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR; |
| 264 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *>(cur_pnext)); |
| 265 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 266 | } break; |
| 267 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 268 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: { |
| 269 | safe_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT; |
| 270 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *>(cur_pnext)); |
| 271 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 272 | } break; |
| 273 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 274 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: { |
| 275 | safe_VkPhysicalDeviceShaderDrawParametersFeatures *safe_struct = new safe_VkPhysicalDeviceShaderDrawParametersFeatures; |
| 276 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderDrawParametersFeatures *>(cur_pnext)); |
| 277 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 278 | } break; |
| 279 | |
| 280 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: { |
| 281 | safe_VkPhysicalDeviceShaderImageFootprintFeaturesNV *safe_struct = new safe_VkPhysicalDeviceShaderImageFootprintFeaturesNV; |
| 282 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderImageFootprintFeaturesNV *>(cur_pnext)); |
| 283 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 284 | } break; |
| 285 | |
| 286 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS2_FEATURES_INTEL: { |
| 287 | safe_VkPhysicalDeviceShaderIntegerFunctions2INTEL *safe_struct = new safe_VkPhysicalDeviceShaderIntegerFunctions2INTEL; |
| 288 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderIntegerFunctions2INTEL *>(cur_pnext)); |
| 289 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 290 | } break; |
| 291 | |
| 292 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: { |
| 293 | safe_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *safe_struct = new safe_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV; |
| 294 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *>(cur_pnext)); |
| 295 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 296 | } break; |
| 297 | |
| 298 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: { |
| 299 | safe_VkPhysicalDeviceShadingRateImageFeaturesNV *safe_struct = new safe_VkPhysicalDeviceShadingRateImageFeaturesNV; |
| 300 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShadingRateImageFeaturesNV *>(cur_pnext)); |
| 301 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 302 | } break; |
| 303 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 304 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: { |
| 305 | safe_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT; |
| 306 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *>(cur_pnext)); |
| 307 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 308 | } break; |
| 309 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 310 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: { |
| 311 | safe_VkPhysicalDeviceTransformFeedbackFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceTransformFeedbackFeaturesEXT; |
| 312 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceTransformFeedbackFeaturesEXT *>(cur_pnext)); |
| 313 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 314 | } break; |
| 315 | |
| 316 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: { |
| 317 | safe_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *safe_struct = new safe_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR; |
| 318 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *>(cur_pnext)); |
| 319 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 320 | } break; |
| 321 | |
| 322 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: { |
| 323 | safe_VkPhysicalDeviceVariablePointersFeatures *safe_struct = new safe_VkPhysicalDeviceVariablePointersFeatures; |
| 324 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceVariablePointersFeatures *>(cur_pnext)); |
| 325 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 326 | } break; |
| 327 | |
| 328 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: { |
| 329 | safe_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; |
| 330 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *>(cur_pnext)); |
| 331 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 332 | } break; |
| 333 | |
| 334 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR: { |
| 335 | safe_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR *safe_struct = new safe_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR; |
| 336 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR *>(cur_pnext)); |
| 337 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 338 | } break; |
| 339 | |
| 340 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: { |
| 341 | safe_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *safe_struct = new safe_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT; |
| 342 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *>(cur_pnext)); |
| 343 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 344 | } break; |
| 345 | |
| 346 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 347 | case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: { |
| 348 | safe_VkD3D12FenceSubmitInfoKHR *safe_struct = new safe_VkD3D12FenceSubmitInfoKHR; |
| 349 | safe_struct->initialize(reinterpret_cast<const VkD3D12FenceSubmitInfoKHR *>(cur_pnext)); |
| 350 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 351 | } break; |
| 352 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 353 | |
| 354 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: { |
| 355 | safe_VkDeviceGroupSubmitInfo *safe_struct = new safe_VkDeviceGroupSubmitInfo; |
| 356 | safe_struct->initialize(reinterpret_cast<const VkDeviceGroupSubmitInfo *>(cur_pnext)); |
| 357 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 358 | } break; |
| 359 | |
| 360 | case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: { |
| 361 | safe_VkProtectedSubmitInfo *safe_struct = new safe_VkProtectedSubmitInfo; |
| 362 | safe_struct->initialize(reinterpret_cast<const VkProtectedSubmitInfo *>(cur_pnext)); |
| 363 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 364 | } break; |
| 365 | |
| 366 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 367 | case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: { |
| 368 | safe_VkWin32KeyedMutexAcquireReleaseInfoKHR *safe_struct = new safe_VkWin32KeyedMutexAcquireReleaseInfoKHR; |
| 369 | safe_struct->initialize(reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoKHR *>(cur_pnext)); |
| 370 | if (safe_struct->pAcquireSyncs) { |
| 371 | for (uint32_t index0 = 0; index0 < safe_struct->acquireCount; ++index0) { |
| 372 | safe_struct->pAcquireSyncs[index0] = layer_data->Unwrap(safe_struct->pAcquireSyncs[index0]); |
| 373 | } |
| 374 | } |
| 375 | if (safe_struct->pReleaseSyncs) { |
| 376 | for (uint32_t index0 = 0; index0 < safe_struct->releaseCount; ++index0) { |
| 377 | safe_struct->pReleaseSyncs[index0] = layer_data->Unwrap(safe_struct->pReleaseSyncs[index0]); |
| 378 | } |
| 379 | } |
| 380 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 381 | } break; |
| 382 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 383 | |
| 384 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 385 | case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: { |
| 386 | safe_VkWin32KeyedMutexAcquireReleaseInfoNV *safe_struct = new safe_VkWin32KeyedMutexAcquireReleaseInfoNV; |
| 387 | safe_struct->initialize(reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoNV *>(cur_pnext)); |
| 388 | if (safe_struct->pAcquireSyncs) { |
| 389 | for (uint32_t index0 = 0; index0 < safe_struct->acquireCount; ++index0) { |
| 390 | safe_struct->pAcquireSyncs[index0] = layer_data->Unwrap(safe_struct->pAcquireSyncs[index0]); |
| 391 | } |
| 392 | } |
| 393 | if (safe_struct->pReleaseSyncs) { |
| 394 | for (uint32_t index0 = 0; index0 < safe_struct->releaseCount; ++index0) { |
| 395 | safe_struct->pReleaseSyncs[index0] = layer_data->Unwrap(safe_struct->pReleaseSyncs[index0]); |
| 396 | } |
| 397 | } |
| 398 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 399 | } break; |
| 400 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 401 | |
| 402 | case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: { |
| 403 | safe_VkDedicatedAllocationMemoryAllocateInfoNV *safe_struct = new safe_VkDedicatedAllocationMemoryAllocateInfoNV; |
| 404 | safe_struct->initialize(reinterpret_cast<const VkDedicatedAllocationMemoryAllocateInfoNV *>(cur_pnext)); |
| 405 | if (safe_struct->image) { |
| 406 | safe_struct->image = layer_data->Unwrap(safe_struct->image); |
| 407 | } |
| 408 | if (safe_struct->buffer) { |
| 409 | safe_struct->buffer = layer_data->Unwrap(safe_struct->buffer); |
| 410 | } |
| 411 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 412 | } break; |
| 413 | |
| 414 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: { |
| 415 | safe_VkExportMemoryAllocateInfo *safe_struct = new safe_VkExportMemoryAllocateInfo; |
| 416 | safe_struct->initialize(reinterpret_cast<const VkExportMemoryAllocateInfo *>(cur_pnext)); |
| 417 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 418 | } break; |
| 419 | |
| 420 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: { |
| 421 | safe_VkExportMemoryAllocateInfoNV *safe_struct = new safe_VkExportMemoryAllocateInfoNV; |
| 422 | safe_struct->initialize(reinterpret_cast<const VkExportMemoryAllocateInfoNV *>(cur_pnext)); |
| 423 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 424 | } break; |
| 425 | |
| 426 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 427 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: { |
| 428 | safe_VkExportMemoryWin32HandleInfoKHR *safe_struct = new safe_VkExportMemoryWin32HandleInfoKHR; |
| 429 | safe_struct->initialize(reinterpret_cast<const VkExportMemoryWin32HandleInfoKHR *>(cur_pnext)); |
| 430 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 431 | } break; |
| 432 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 433 | |
| 434 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 435 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: { |
| 436 | safe_VkExportMemoryWin32HandleInfoNV *safe_struct = new safe_VkExportMemoryWin32HandleInfoNV; |
| 437 | safe_struct->initialize(reinterpret_cast<const VkExportMemoryWin32HandleInfoNV *>(cur_pnext)); |
| 438 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 439 | } break; |
| 440 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 441 | |
| 442 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 443 | case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: { |
| 444 | safe_VkImportAndroidHardwareBufferInfoANDROID *safe_struct = new safe_VkImportAndroidHardwareBufferInfoANDROID; |
| 445 | safe_struct->initialize(reinterpret_cast<const VkImportAndroidHardwareBufferInfoANDROID *>(cur_pnext)); |
| 446 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 447 | } break; |
| 448 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 449 | |
| 450 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: { |
| 451 | safe_VkImportMemoryFdInfoKHR *safe_struct = new safe_VkImportMemoryFdInfoKHR; |
| 452 | safe_struct->initialize(reinterpret_cast<const VkImportMemoryFdInfoKHR *>(cur_pnext)); |
| 453 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 454 | } break; |
| 455 | |
| 456 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: { |
| 457 | safe_VkImportMemoryHostPointerInfoEXT *safe_struct = new safe_VkImportMemoryHostPointerInfoEXT; |
| 458 | safe_struct->initialize(reinterpret_cast<const VkImportMemoryHostPointerInfoEXT *>(cur_pnext)); |
| 459 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 460 | } break; |
| 461 | |
| 462 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 463 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: { |
| 464 | safe_VkImportMemoryWin32HandleInfoKHR *safe_struct = new safe_VkImportMemoryWin32HandleInfoKHR; |
| 465 | safe_struct->initialize(reinterpret_cast<const VkImportMemoryWin32HandleInfoKHR *>(cur_pnext)); |
| 466 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 467 | } break; |
| 468 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 469 | |
| 470 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 471 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: { |
| 472 | safe_VkImportMemoryWin32HandleInfoNV *safe_struct = new safe_VkImportMemoryWin32HandleInfoNV; |
| 473 | safe_struct->initialize(reinterpret_cast<const VkImportMemoryWin32HandleInfoNV *>(cur_pnext)); |
| 474 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 475 | } break; |
| 476 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 477 | |
| 478 | case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: { |
| 479 | safe_VkMemoryAllocateFlagsInfo *safe_struct = new safe_VkMemoryAllocateFlagsInfo; |
| 480 | safe_struct->initialize(reinterpret_cast<const VkMemoryAllocateFlagsInfo *>(cur_pnext)); |
| 481 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 482 | } break; |
| 483 | |
| 484 | case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: { |
| 485 | safe_VkMemoryDedicatedAllocateInfo *safe_struct = new safe_VkMemoryDedicatedAllocateInfo; |
| 486 | safe_struct->initialize(reinterpret_cast<const VkMemoryDedicatedAllocateInfo *>(cur_pnext)); |
| 487 | if (safe_struct->image) { |
| 488 | safe_struct->image = layer_data->Unwrap(safe_struct->image); |
| 489 | } |
| 490 | if (safe_struct->buffer) { |
| 491 | safe_struct->buffer = layer_data->Unwrap(safe_struct->buffer); |
| 492 | } |
| 493 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 494 | } break; |
| 495 | |
| 496 | case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: { |
| 497 | safe_VkMemoryPriorityAllocateInfoEXT *safe_struct = new safe_VkMemoryPriorityAllocateInfoEXT; |
| 498 | safe_struct->initialize(reinterpret_cast<const VkMemoryPriorityAllocateInfoEXT *>(cur_pnext)); |
| 499 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 500 | } break; |
| 501 | |
| 502 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: { |
| 503 | safe_VkDeviceGroupBindSparseInfo *safe_struct = new safe_VkDeviceGroupBindSparseInfo; |
| 504 | safe_struct->initialize(reinterpret_cast<const VkDeviceGroupBindSparseInfo *>(cur_pnext)); |
| 505 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 506 | } break; |
| 507 | |
| 508 | case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: { |
| 509 | safe_VkExportFenceCreateInfo *safe_struct = new safe_VkExportFenceCreateInfo; |
| 510 | safe_struct->initialize(reinterpret_cast<const VkExportFenceCreateInfo *>(cur_pnext)); |
| 511 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 512 | } break; |
| 513 | |
| 514 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 515 | case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: { |
| 516 | safe_VkExportFenceWin32HandleInfoKHR *safe_struct = new safe_VkExportFenceWin32HandleInfoKHR; |
| 517 | safe_struct->initialize(reinterpret_cast<const VkExportFenceWin32HandleInfoKHR *>(cur_pnext)); |
| 518 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 519 | } break; |
| 520 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 521 | |
| 522 | case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: { |
| 523 | safe_VkExportSemaphoreCreateInfo *safe_struct = new safe_VkExportSemaphoreCreateInfo; |
| 524 | safe_struct->initialize(reinterpret_cast<const VkExportSemaphoreCreateInfo *>(cur_pnext)); |
| 525 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 526 | } break; |
| 527 | |
| 528 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 529 | case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: { |
| 530 | safe_VkExportSemaphoreWin32HandleInfoKHR *safe_struct = new safe_VkExportSemaphoreWin32HandleInfoKHR; |
| 531 | safe_struct->initialize(reinterpret_cast<const VkExportSemaphoreWin32HandleInfoKHR *>(cur_pnext)); |
| 532 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 533 | } break; |
| 534 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 535 | |
| 536 | case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: { |
| 537 | safe_VkBufferDeviceAddressCreateInfoEXT *safe_struct = new safe_VkBufferDeviceAddressCreateInfoEXT; |
| 538 | safe_struct->initialize(reinterpret_cast<const VkBufferDeviceAddressCreateInfoEXT *>(cur_pnext)); |
| 539 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 540 | } break; |
| 541 | |
| 542 | case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: { |
| 543 | safe_VkDedicatedAllocationBufferCreateInfoNV *safe_struct = new safe_VkDedicatedAllocationBufferCreateInfoNV; |
| 544 | safe_struct->initialize(reinterpret_cast<const VkDedicatedAllocationBufferCreateInfoNV *>(cur_pnext)); |
| 545 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 546 | } break; |
| 547 | |
| 548 | case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: { |
| 549 | safe_VkExternalMemoryBufferCreateInfo *safe_struct = new safe_VkExternalMemoryBufferCreateInfo; |
| 550 | safe_struct->initialize(reinterpret_cast<const VkExternalMemoryBufferCreateInfo *>(cur_pnext)); |
| 551 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 552 | } break; |
| 553 | |
| 554 | case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: { |
| 555 | safe_VkDedicatedAllocationImageCreateInfoNV *safe_struct = new safe_VkDedicatedAllocationImageCreateInfoNV; |
| 556 | safe_struct->initialize(reinterpret_cast<const VkDedicatedAllocationImageCreateInfoNV *>(cur_pnext)); |
| 557 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 558 | } break; |
| 559 | |
| 560 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 561 | case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: { |
| 562 | safe_VkExternalFormatANDROID *safe_struct = new safe_VkExternalFormatANDROID; |
| 563 | safe_struct->initialize(reinterpret_cast<const VkExternalFormatANDROID *>(cur_pnext)); |
| 564 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 565 | } break; |
| 566 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 567 | |
| 568 | case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: { |
| 569 | safe_VkExternalMemoryImageCreateInfo *safe_struct = new safe_VkExternalMemoryImageCreateInfo; |
| 570 | safe_struct->initialize(reinterpret_cast<const VkExternalMemoryImageCreateInfo *>(cur_pnext)); |
| 571 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 572 | } break; |
| 573 | |
| 574 | case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: { |
| 575 | safe_VkExternalMemoryImageCreateInfoNV *safe_struct = new safe_VkExternalMemoryImageCreateInfoNV; |
| 576 | safe_struct->initialize(reinterpret_cast<const VkExternalMemoryImageCreateInfoNV *>(cur_pnext)); |
| 577 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 578 | } break; |
| 579 | |
| 580 | case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: { |
| 581 | safe_VkImageDrmFormatModifierExplicitCreateInfoEXT *safe_struct = new safe_VkImageDrmFormatModifierExplicitCreateInfoEXT; |
| 582 | safe_struct->initialize(reinterpret_cast<const VkImageDrmFormatModifierExplicitCreateInfoEXT *>(cur_pnext)); |
| 583 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 584 | } break; |
| 585 | |
| 586 | case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: { |
| 587 | safe_VkImageDrmFormatModifierListCreateInfoEXT *safe_struct = new safe_VkImageDrmFormatModifierListCreateInfoEXT; |
| 588 | safe_struct->initialize(reinterpret_cast<const VkImageDrmFormatModifierListCreateInfoEXT *>(cur_pnext)); |
| 589 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 590 | } break; |
| 591 | |
| 592 | case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR: { |
| 593 | safe_VkImageFormatListCreateInfoKHR *safe_struct = new safe_VkImageFormatListCreateInfoKHR; |
| 594 | safe_struct->initialize(reinterpret_cast<const VkImageFormatListCreateInfoKHR *>(cur_pnext)); |
| 595 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 596 | } break; |
| 597 | |
| 598 | case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT: { |
| 599 | safe_VkImageStencilUsageCreateInfoEXT *safe_struct = new safe_VkImageStencilUsageCreateInfoEXT; |
| 600 | safe_struct->initialize(reinterpret_cast<const VkImageStencilUsageCreateInfoEXT *>(cur_pnext)); |
| 601 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 602 | } break; |
| 603 | |
| 604 | case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: { |
| 605 | safe_VkImageSwapchainCreateInfoKHR *safe_struct = new safe_VkImageSwapchainCreateInfoKHR; |
| 606 | safe_struct->initialize(reinterpret_cast<const VkImageSwapchainCreateInfoKHR *>(cur_pnext)); |
| 607 | if (safe_struct->swapchain) { |
| 608 | safe_struct->swapchain = layer_data->Unwrap(safe_struct->swapchain); |
| 609 | } |
| 610 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 611 | } break; |
| 612 | |
| 613 | case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: { |
| 614 | safe_VkImageViewASTCDecodeModeEXT *safe_struct = new safe_VkImageViewASTCDecodeModeEXT; |
| 615 | safe_struct->initialize(reinterpret_cast<const VkImageViewASTCDecodeModeEXT *>(cur_pnext)); |
| 616 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 617 | } break; |
| 618 | |
| 619 | case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: { |
| 620 | safe_VkImageViewUsageCreateInfo *safe_struct = new safe_VkImageViewUsageCreateInfo; |
| 621 | safe_struct->initialize(reinterpret_cast<const VkImageViewUsageCreateInfo *>(cur_pnext)); |
| 622 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 623 | } break; |
| 624 | |
| 625 | case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: { |
| 626 | safe_VkSamplerYcbcrConversionInfo *safe_struct = new safe_VkSamplerYcbcrConversionInfo; |
| 627 | safe_struct->initialize(reinterpret_cast<const VkSamplerYcbcrConversionInfo *>(cur_pnext)); |
| 628 | if (safe_struct->conversion) { |
| 629 | safe_struct->conversion = layer_data->Unwrap(safe_struct->conversion); |
| 630 | } |
| 631 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 632 | } break; |
| 633 | |
| 634 | case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: { |
| 635 | safe_VkShaderModuleValidationCacheCreateInfoEXT *safe_struct = new safe_VkShaderModuleValidationCacheCreateInfoEXT; |
| 636 | safe_struct->initialize(reinterpret_cast<const VkShaderModuleValidationCacheCreateInfoEXT *>(cur_pnext)); |
| 637 | if (safe_struct->validationCache) { |
| 638 | safe_struct->validationCache = layer_data->Unwrap(safe_struct->validationCache); |
| 639 | } |
| 640 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 641 | } break; |
| 642 | |
| 643 | case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: { |
| 644 | safe_VkPipelineVertexInputDivisorStateCreateInfoEXT *safe_struct = new safe_VkPipelineVertexInputDivisorStateCreateInfoEXT; |
| 645 | safe_struct->initialize(reinterpret_cast<const VkPipelineVertexInputDivisorStateCreateInfoEXT *>(cur_pnext)); |
| 646 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 647 | } break; |
| 648 | |
| 649 | case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: { |
| 650 | safe_VkPipelineTessellationDomainOriginStateCreateInfo *safe_struct = new safe_VkPipelineTessellationDomainOriginStateCreateInfo; |
| 651 | safe_struct->initialize(reinterpret_cast<const VkPipelineTessellationDomainOriginStateCreateInfo *>(cur_pnext)); |
| 652 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 653 | } break; |
| 654 | |
| 655 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: { |
| 656 | safe_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV *safe_struct = new safe_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV; |
| 657 | safe_struct->initialize(reinterpret_cast<const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV *>(cur_pnext)); |
| 658 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 659 | } break; |
| 660 | |
| 661 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: { |
| 662 | safe_VkPipelineViewportExclusiveScissorStateCreateInfoNV *safe_struct = new safe_VkPipelineViewportExclusiveScissorStateCreateInfoNV; |
| 663 | safe_struct->initialize(reinterpret_cast<const VkPipelineViewportExclusiveScissorStateCreateInfoNV *>(cur_pnext)); |
| 664 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 665 | } break; |
| 666 | |
| 667 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: { |
| 668 | safe_VkPipelineViewportShadingRateImageStateCreateInfoNV *safe_struct = new safe_VkPipelineViewportShadingRateImageStateCreateInfoNV; |
| 669 | safe_struct->initialize(reinterpret_cast<const VkPipelineViewportShadingRateImageStateCreateInfoNV *>(cur_pnext)); |
| 670 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 671 | } break; |
| 672 | |
| 673 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: { |
| 674 | safe_VkPipelineViewportSwizzleStateCreateInfoNV *safe_struct = new safe_VkPipelineViewportSwizzleStateCreateInfoNV; |
| 675 | safe_struct->initialize(reinterpret_cast<const VkPipelineViewportSwizzleStateCreateInfoNV *>(cur_pnext)); |
| 676 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 677 | } break; |
| 678 | |
| 679 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: { |
| 680 | safe_VkPipelineViewportWScalingStateCreateInfoNV *safe_struct = new safe_VkPipelineViewportWScalingStateCreateInfoNV; |
| 681 | safe_struct->initialize(reinterpret_cast<const VkPipelineViewportWScalingStateCreateInfoNV *>(cur_pnext)); |
| 682 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 683 | } break; |
| 684 | |
| 685 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: { |
| 686 | safe_VkPipelineRasterizationConservativeStateCreateInfoEXT *safe_struct = new safe_VkPipelineRasterizationConservativeStateCreateInfoEXT; |
| 687 | safe_struct->initialize(reinterpret_cast<const VkPipelineRasterizationConservativeStateCreateInfoEXT *>(cur_pnext)); |
| 688 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 689 | } break; |
| 690 | |
| 691 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: { |
| 692 | safe_VkPipelineRasterizationDepthClipStateCreateInfoEXT *safe_struct = new safe_VkPipelineRasterizationDepthClipStateCreateInfoEXT; |
| 693 | safe_struct->initialize(reinterpret_cast<const VkPipelineRasterizationDepthClipStateCreateInfoEXT *>(cur_pnext)); |
| 694 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 695 | } break; |
| 696 | |
| 697 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: { |
| 698 | safe_VkPipelineRasterizationStateRasterizationOrderAMD *safe_struct = new safe_VkPipelineRasterizationStateRasterizationOrderAMD; |
| 699 | safe_struct->initialize(reinterpret_cast<const VkPipelineRasterizationStateRasterizationOrderAMD *>(cur_pnext)); |
| 700 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 701 | } break; |
| 702 | |
| 703 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: { |
| 704 | safe_VkPipelineRasterizationStateStreamCreateInfoEXT *safe_struct = new safe_VkPipelineRasterizationStateStreamCreateInfoEXT; |
| 705 | safe_struct->initialize(reinterpret_cast<const VkPipelineRasterizationStateStreamCreateInfoEXT *>(cur_pnext)); |
| 706 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 707 | } break; |
| 708 | |
| 709 | case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: { |
| 710 | safe_VkPipelineCoverageModulationStateCreateInfoNV *safe_struct = new safe_VkPipelineCoverageModulationStateCreateInfoNV; |
| 711 | safe_struct->initialize(reinterpret_cast<const VkPipelineCoverageModulationStateCreateInfoNV *>(cur_pnext)); |
| 712 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 713 | } break; |
| 714 | |
| 715 | case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: { |
| 716 | safe_VkPipelineCoverageReductionStateCreateInfoNV *safe_struct = new safe_VkPipelineCoverageReductionStateCreateInfoNV; |
| 717 | safe_struct->initialize(reinterpret_cast<const VkPipelineCoverageReductionStateCreateInfoNV *>(cur_pnext)); |
| 718 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 719 | } break; |
| 720 | |
| 721 | case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: { |
| 722 | safe_VkPipelineCoverageToColorStateCreateInfoNV *safe_struct = new safe_VkPipelineCoverageToColorStateCreateInfoNV; |
| 723 | safe_struct->initialize(reinterpret_cast<const VkPipelineCoverageToColorStateCreateInfoNV *>(cur_pnext)); |
| 724 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 725 | } break; |
| 726 | |
| 727 | case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: { |
| 728 | safe_VkPipelineSampleLocationsStateCreateInfoEXT *safe_struct = new safe_VkPipelineSampleLocationsStateCreateInfoEXT; |
| 729 | safe_struct->initialize(reinterpret_cast<const VkPipelineSampleLocationsStateCreateInfoEXT *>(cur_pnext)); |
| 730 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 731 | } break; |
| 732 | |
| 733 | case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: { |
| 734 | safe_VkPipelineColorBlendAdvancedStateCreateInfoEXT *safe_struct = new safe_VkPipelineColorBlendAdvancedStateCreateInfoEXT; |
| 735 | safe_struct->initialize(reinterpret_cast<const VkPipelineColorBlendAdvancedStateCreateInfoEXT *>(cur_pnext)); |
| 736 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 737 | } break; |
| 738 | |
| 739 | case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: { |
| 740 | safe_VkPipelineCreationFeedbackCreateInfoEXT *safe_struct = new safe_VkPipelineCreationFeedbackCreateInfoEXT; |
| 741 | safe_struct->initialize(reinterpret_cast<const VkPipelineCreationFeedbackCreateInfoEXT *>(cur_pnext)); |
| 742 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 743 | } break; |
| 744 | |
| 745 | case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: { |
| 746 | safe_VkPipelineDiscardRectangleStateCreateInfoEXT *safe_struct = new safe_VkPipelineDiscardRectangleStateCreateInfoEXT; |
| 747 | safe_struct->initialize(reinterpret_cast<const VkPipelineDiscardRectangleStateCreateInfoEXT *>(cur_pnext)); |
| 748 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 749 | } break; |
| 750 | |
| 751 | case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: { |
| 752 | safe_VkPipelineRepresentativeFragmentTestStateCreateInfoNV *safe_struct = new safe_VkPipelineRepresentativeFragmentTestStateCreateInfoNV; |
| 753 | safe_struct->initialize(reinterpret_cast<const VkPipelineRepresentativeFragmentTestStateCreateInfoNV *>(cur_pnext)); |
| 754 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 755 | } break; |
| 756 | |
| 757 | case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT: { |
| 758 | safe_VkSamplerReductionModeCreateInfoEXT *safe_struct = new safe_VkSamplerReductionModeCreateInfoEXT; |
| 759 | safe_struct->initialize(reinterpret_cast<const VkSamplerReductionModeCreateInfoEXT *>(cur_pnext)); |
| 760 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 761 | } break; |
| 762 | |
| 763 | case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT: { |
| 764 | safe_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT *safe_struct = new safe_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT; |
| 765 | safe_struct->initialize(reinterpret_cast<const VkDescriptorSetLayoutBindingFlagsCreateInfoEXT *>(cur_pnext)); |
| 766 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 767 | } break; |
| 768 | |
| 769 | case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: { |
| 770 | safe_VkDescriptorPoolInlineUniformBlockCreateInfoEXT *safe_struct = new safe_VkDescriptorPoolInlineUniformBlockCreateInfoEXT; |
| 771 | safe_struct->initialize(reinterpret_cast<const VkDescriptorPoolInlineUniformBlockCreateInfoEXT *>(cur_pnext)); |
| 772 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 773 | } break; |
| 774 | |
| 775 | case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT: { |
| 776 | safe_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT *safe_struct = new safe_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT; |
| 777 | safe_struct->initialize(reinterpret_cast<const VkDescriptorSetVariableDescriptorCountAllocateInfoEXT *>(cur_pnext)); |
| 778 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 779 | } break; |
| 780 | |
| 781 | case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: { |
| 782 | safe_VkWriteDescriptorSetAccelerationStructureNV *safe_struct = new safe_VkWriteDescriptorSetAccelerationStructureNV; |
| 783 | safe_struct->initialize(reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureNV *>(cur_pnext)); |
| 784 | if (safe_struct->pAccelerationStructures) { |
| 785 | for (uint32_t index0 = 0; index0 < safe_struct->accelerationStructureCount; ++index0) { |
| 786 | safe_struct->pAccelerationStructures[index0] = layer_data->Unwrap(safe_struct->pAccelerationStructures[index0]); |
| 787 | } |
| 788 | } |
| 789 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 790 | } break; |
| 791 | |
| 792 | case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: { |
| 793 | safe_VkWriteDescriptorSetInlineUniformBlockEXT *safe_struct = new safe_VkWriteDescriptorSetInlineUniformBlockEXT; |
| 794 | safe_struct->initialize(reinterpret_cast<const VkWriteDescriptorSetInlineUniformBlockEXT *>(cur_pnext)); |
| 795 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 796 | } break; |
| 797 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 798 | case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR: { |
| 799 | safe_VkFramebufferAttachmentsCreateInfoKHR *safe_struct = new safe_VkFramebufferAttachmentsCreateInfoKHR; |
| 800 | safe_struct->initialize(reinterpret_cast<const VkFramebufferAttachmentsCreateInfoKHR *>(cur_pnext)); |
| 801 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 802 | } break; |
| 803 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 804 | case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: { |
| 805 | safe_VkRenderPassFragmentDensityMapCreateInfoEXT *safe_struct = new safe_VkRenderPassFragmentDensityMapCreateInfoEXT; |
| 806 | safe_struct->initialize(reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT *>(cur_pnext)); |
| 807 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 808 | } break; |
| 809 | |
| 810 | case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: { |
| 811 | safe_VkRenderPassInputAttachmentAspectCreateInfo *safe_struct = new safe_VkRenderPassInputAttachmentAspectCreateInfo; |
| 812 | safe_struct->initialize(reinterpret_cast<const VkRenderPassInputAttachmentAspectCreateInfo *>(cur_pnext)); |
| 813 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 814 | } break; |
| 815 | |
| 816 | case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: { |
| 817 | safe_VkRenderPassMultiviewCreateInfo *safe_struct = new safe_VkRenderPassMultiviewCreateInfo; |
| 818 | safe_struct->initialize(reinterpret_cast<const VkRenderPassMultiviewCreateInfo *>(cur_pnext)); |
| 819 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 820 | } break; |
| 821 | |
| 822 | case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: { |
| 823 | safe_VkCommandBufferInheritanceConditionalRenderingInfoEXT *safe_struct = new safe_VkCommandBufferInheritanceConditionalRenderingInfoEXT; |
| 824 | safe_struct->initialize(reinterpret_cast<const VkCommandBufferInheritanceConditionalRenderingInfoEXT *>(cur_pnext)); |
| 825 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 826 | } break; |
| 827 | |
| 828 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: { |
| 829 | safe_VkDeviceGroupCommandBufferBeginInfo *safe_struct = new safe_VkDeviceGroupCommandBufferBeginInfo; |
| 830 | safe_struct->initialize(reinterpret_cast<const VkDeviceGroupCommandBufferBeginInfo *>(cur_pnext)); |
| 831 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 832 | } break; |
| 833 | |
| 834 | case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: { |
| 835 | safe_VkSampleLocationsInfoEXT *safe_struct = new safe_VkSampleLocationsInfoEXT; |
| 836 | safe_struct->initialize(reinterpret_cast<const VkSampleLocationsInfoEXT *>(cur_pnext)); |
| 837 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 838 | } break; |
| 839 | |
| 840 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: { |
| 841 | safe_VkDeviceGroupRenderPassBeginInfo *safe_struct = new safe_VkDeviceGroupRenderPassBeginInfo; |
| 842 | safe_struct->initialize(reinterpret_cast<const VkDeviceGroupRenderPassBeginInfo *>(cur_pnext)); |
| 843 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 844 | } break; |
| 845 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 846 | case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR: { |
| 847 | safe_VkRenderPassAttachmentBeginInfoKHR *safe_struct = new safe_VkRenderPassAttachmentBeginInfoKHR; |
| 848 | safe_struct->initialize(reinterpret_cast<const VkRenderPassAttachmentBeginInfoKHR *>(cur_pnext)); |
| 849 | if (safe_struct->pAttachments) { |
| 850 | for (uint32_t index0 = 0; index0 < safe_struct->attachmentCount; ++index0) { |
| 851 | safe_struct->pAttachments[index0] = layer_data->Unwrap(safe_struct->pAttachments[index0]); |
| 852 | } |
| 853 | } |
| 854 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 855 | } break; |
| 856 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 857 | case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: { |
| 858 | safe_VkRenderPassSampleLocationsBeginInfoEXT *safe_struct = new safe_VkRenderPassSampleLocationsBeginInfoEXT; |
| 859 | safe_struct->initialize(reinterpret_cast<const VkRenderPassSampleLocationsBeginInfoEXT *>(cur_pnext)); |
| 860 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 861 | } break; |
| 862 | |
| 863 | case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: { |
| 864 | safe_VkBindBufferMemoryDeviceGroupInfo *safe_struct = new safe_VkBindBufferMemoryDeviceGroupInfo; |
| 865 | safe_struct->initialize(reinterpret_cast<const VkBindBufferMemoryDeviceGroupInfo *>(cur_pnext)); |
| 866 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 867 | } break; |
| 868 | |
| 869 | case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: { |
| 870 | safe_VkBindImageMemoryDeviceGroupInfo *safe_struct = new safe_VkBindImageMemoryDeviceGroupInfo; |
| 871 | safe_struct->initialize(reinterpret_cast<const VkBindImageMemoryDeviceGroupInfo *>(cur_pnext)); |
| 872 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 873 | } break; |
| 874 | |
| 875 | case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: { |
| 876 | safe_VkBindImageMemorySwapchainInfoKHR *safe_struct = new safe_VkBindImageMemorySwapchainInfoKHR; |
| 877 | safe_struct->initialize(reinterpret_cast<const VkBindImageMemorySwapchainInfoKHR *>(cur_pnext)); |
| 878 | if (safe_struct->swapchain) { |
| 879 | safe_struct->swapchain = layer_data->Unwrap(safe_struct->swapchain); |
| 880 | } |
| 881 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 882 | } break; |
| 883 | |
| 884 | case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: { |
| 885 | safe_VkBindImagePlaneMemoryInfo *safe_struct = new safe_VkBindImagePlaneMemoryInfo; |
| 886 | safe_struct->initialize(reinterpret_cast<const VkBindImagePlaneMemoryInfo *>(cur_pnext)); |
| 887 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 888 | } break; |
| 889 | |
| 890 | case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: { |
| 891 | safe_VkImagePlaneMemoryRequirementsInfo *safe_struct = new safe_VkImagePlaneMemoryRequirementsInfo; |
| 892 | safe_struct->initialize(reinterpret_cast<const VkImagePlaneMemoryRequirementsInfo *>(cur_pnext)); |
| 893 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 894 | } break; |
| 895 | |
| 896 | case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: { |
| 897 | safe_VkMemoryDedicatedRequirements *safe_struct = new safe_VkMemoryDedicatedRequirements; |
| 898 | safe_struct->initialize(reinterpret_cast<const VkMemoryDedicatedRequirements *>(cur_pnext)); |
| 899 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 900 | } break; |
| 901 | |
| 902 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: { |
| 903 | safe_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; |
| 904 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *>(cur_pnext)); |
| 905 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 906 | } break; |
| 907 | |
| 908 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: { |
| 909 | safe_VkPhysicalDeviceConservativeRasterizationPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceConservativeRasterizationPropertiesEXT; |
| 910 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceConservativeRasterizationPropertiesEXT *>(cur_pnext)); |
| 911 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 912 | } break; |
| 913 | |
| 914 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: { |
| 915 | safe_VkPhysicalDeviceCooperativeMatrixPropertiesNV *safe_struct = new safe_VkPhysicalDeviceCooperativeMatrixPropertiesNV; |
| 916 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixPropertiesNV *>(cur_pnext)); |
| 917 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 918 | } break; |
| 919 | |
| 920 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR: { |
| 921 | safe_VkPhysicalDeviceDepthStencilResolvePropertiesKHR *safe_struct = new safe_VkPhysicalDeviceDepthStencilResolvePropertiesKHR; |
| 922 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceDepthStencilResolvePropertiesKHR *>(cur_pnext)); |
| 923 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 924 | } break; |
| 925 | |
| 926 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT: { |
| 927 | safe_VkPhysicalDeviceDescriptorIndexingPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceDescriptorIndexingPropertiesEXT; |
| 928 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingPropertiesEXT *>(cur_pnext)); |
| 929 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 930 | } break; |
| 931 | |
| 932 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: { |
| 933 | safe_VkPhysicalDeviceDiscardRectanglePropertiesEXT *safe_struct = new safe_VkPhysicalDeviceDiscardRectanglePropertiesEXT; |
| 934 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceDiscardRectanglePropertiesEXT *>(cur_pnext)); |
| 935 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 936 | } break; |
| 937 | |
| 938 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR: { |
| 939 | safe_VkPhysicalDeviceDriverPropertiesKHR *safe_struct = new safe_VkPhysicalDeviceDriverPropertiesKHR; |
| 940 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceDriverPropertiesKHR *>(cur_pnext)); |
| 941 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 942 | } break; |
| 943 | |
| 944 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: { |
| 945 | safe_VkPhysicalDeviceExternalMemoryHostPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceExternalMemoryHostPropertiesEXT; |
| 946 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceExternalMemoryHostPropertiesEXT *>(cur_pnext)); |
| 947 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 948 | } break; |
| 949 | |
| 950 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR: { |
| 951 | safe_VkPhysicalDeviceFloatControlsPropertiesKHR *safe_struct = new safe_VkPhysicalDeviceFloatControlsPropertiesKHR; |
| 952 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceFloatControlsPropertiesKHR *>(cur_pnext)); |
| 953 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 954 | } break; |
| 955 | |
| 956 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: { |
| 957 | safe_VkPhysicalDeviceFragmentDensityMapPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceFragmentDensityMapPropertiesEXT; |
| 958 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT *>(cur_pnext)); |
| 959 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 960 | } break; |
| 961 | |
| 962 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: { |
| 963 | safe_VkPhysicalDeviceIDProperties *safe_struct = new safe_VkPhysicalDeviceIDProperties; |
| 964 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceIDProperties *>(cur_pnext)); |
| 965 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 966 | } break; |
| 967 | |
| 968 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: { |
| 969 | safe_VkPhysicalDeviceInlineUniformBlockPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceInlineUniformBlockPropertiesEXT; |
| 970 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockPropertiesEXT *>(cur_pnext)); |
| 971 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 972 | } break; |
| 973 | |
| 974 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: { |
| 975 | safe_VkPhysicalDeviceMaintenance3Properties *safe_struct = new safe_VkPhysicalDeviceMaintenance3Properties; |
| 976 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMaintenance3Properties *>(cur_pnext)); |
| 977 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 978 | } break; |
| 979 | |
| 980 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: { |
| 981 | safe_VkPhysicalDeviceMeshShaderPropertiesNV *safe_struct = new safe_VkPhysicalDeviceMeshShaderPropertiesNV; |
| 982 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMeshShaderPropertiesNV *>(cur_pnext)); |
| 983 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 984 | } break; |
| 985 | |
| 986 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: { |
| 987 | safe_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX *safe_struct = new safe_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; |
| 988 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX *>(cur_pnext)); |
| 989 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 990 | } break; |
| 991 | |
| 992 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: { |
| 993 | safe_VkPhysicalDeviceMultiviewProperties *safe_struct = new safe_VkPhysicalDeviceMultiviewProperties; |
| 994 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMultiviewProperties *>(cur_pnext)); |
| 995 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 996 | } break; |
| 997 | |
| 998 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: { |
| 999 | safe_VkPhysicalDevicePCIBusInfoPropertiesEXT *safe_struct = new safe_VkPhysicalDevicePCIBusInfoPropertiesEXT; |
| 1000 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDevicePCIBusInfoPropertiesEXT *>(cur_pnext)); |
| 1001 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1002 | } break; |
| 1003 | |
| 1004 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: { |
| 1005 | safe_VkPhysicalDevicePointClippingProperties *safe_struct = new safe_VkPhysicalDevicePointClippingProperties; |
| 1006 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDevicePointClippingProperties *>(cur_pnext)); |
| 1007 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1008 | } break; |
| 1009 | |
| 1010 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: { |
| 1011 | safe_VkPhysicalDeviceProtectedMemoryProperties *safe_struct = new safe_VkPhysicalDeviceProtectedMemoryProperties; |
| 1012 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceProtectedMemoryProperties *>(cur_pnext)); |
| 1013 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1014 | } break; |
| 1015 | |
| 1016 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: { |
| 1017 | safe_VkPhysicalDevicePushDescriptorPropertiesKHR *safe_struct = new safe_VkPhysicalDevicePushDescriptorPropertiesKHR; |
| 1018 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDevicePushDescriptorPropertiesKHR *>(cur_pnext)); |
| 1019 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1020 | } break; |
| 1021 | |
| 1022 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: { |
| 1023 | safe_VkPhysicalDeviceRayTracingPropertiesNV *safe_struct = new safe_VkPhysicalDeviceRayTracingPropertiesNV; |
| 1024 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceRayTracingPropertiesNV *>(cur_pnext)); |
| 1025 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1026 | } break; |
| 1027 | |
| 1028 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: { |
| 1029 | safe_VkPhysicalDeviceSampleLocationsPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceSampleLocationsPropertiesEXT; |
| 1030 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceSampleLocationsPropertiesEXT *>(cur_pnext)); |
| 1031 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1032 | } break; |
| 1033 | |
| 1034 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT: { |
| 1035 | safe_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT; |
| 1036 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT *>(cur_pnext)); |
| 1037 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1038 | } break; |
| 1039 | |
| 1040 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: { |
| 1041 | safe_VkPhysicalDeviceShaderCorePropertiesAMD *safe_struct = new safe_VkPhysicalDeviceShaderCorePropertiesAMD; |
| 1042 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderCorePropertiesAMD *>(cur_pnext)); |
| 1043 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1044 | } break; |
| 1045 | |
| 1046 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: { |
| 1047 | safe_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *safe_struct = new safe_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV; |
| 1048 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *>(cur_pnext)); |
| 1049 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1050 | } break; |
| 1051 | |
| 1052 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: { |
| 1053 | safe_VkPhysicalDeviceShadingRateImagePropertiesNV *safe_struct = new safe_VkPhysicalDeviceShadingRateImagePropertiesNV; |
| 1054 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceShadingRateImagePropertiesNV *>(cur_pnext)); |
| 1055 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1056 | } break; |
| 1057 | |
| 1058 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: { |
| 1059 | safe_VkPhysicalDeviceSubgroupProperties *safe_struct = new safe_VkPhysicalDeviceSubgroupProperties; |
| 1060 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceSubgroupProperties *>(cur_pnext)); |
| 1061 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1062 | } break; |
| 1063 | |
| 1064 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: { |
| 1065 | safe_VkPhysicalDeviceTransformFeedbackPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceTransformFeedbackPropertiesEXT; |
| 1066 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceTransformFeedbackPropertiesEXT *>(cur_pnext)); |
| 1067 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1068 | } break; |
| 1069 | |
| 1070 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: { |
| 1071 | safe_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; |
| 1072 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *>(cur_pnext)); |
| 1073 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1074 | } break; |
| 1075 | |
| 1076 | case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: { |
| 1077 | safe_VkDrmFormatModifierPropertiesListEXT *safe_struct = new safe_VkDrmFormatModifierPropertiesListEXT; |
| 1078 | safe_struct->initialize(reinterpret_cast<const VkDrmFormatModifierPropertiesListEXT *>(cur_pnext)); |
| 1079 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1080 | } break; |
| 1081 | |
| 1082 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 1083 | case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: { |
| 1084 | safe_VkAndroidHardwareBufferUsageANDROID *safe_struct = new safe_VkAndroidHardwareBufferUsageANDROID; |
| 1085 | safe_struct->initialize(reinterpret_cast<const VkAndroidHardwareBufferUsageANDROID *>(cur_pnext)); |
| 1086 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1087 | } break; |
| 1088 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 1089 | |
| 1090 | case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: { |
| 1091 | safe_VkExternalImageFormatProperties *safe_struct = new safe_VkExternalImageFormatProperties; |
| 1092 | safe_struct->initialize(reinterpret_cast<const VkExternalImageFormatProperties *>(cur_pnext)); |
| 1093 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1094 | } break; |
| 1095 | |
| 1096 | case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: { |
| 1097 | safe_VkFilterCubicImageViewImageFormatPropertiesEXT *safe_struct = new safe_VkFilterCubicImageViewImageFormatPropertiesEXT; |
| 1098 | safe_struct->initialize(reinterpret_cast<const VkFilterCubicImageViewImageFormatPropertiesEXT *>(cur_pnext)); |
| 1099 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1100 | } break; |
| 1101 | |
| 1102 | case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: { |
| 1103 | safe_VkSamplerYcbcrConversionImageFormatProperties *safe_struct = new safe_VkSamplerYcbcrConversionImageFormatProperties; |
| 1104 | safe_struct->initialize(reinterpret_cast<const VkSamplerYcbcrConversionImageFormatProperties *>(cur_pnext)); |
| 1105 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1106 | } break; |
| 1107 | |
| 1108 | case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: { |
| 1109 | safe_VkTextureLODGatherFormatPropertiesAMD *safe_struct = new safe_VkTextureLODGatherFormatPropertiesAMD; |
| 1110 | safe_struct->initialize(reinterpret_cast<const VkTextureLODGatherFormatPropertiesAMD *>(cur_pnext)); |
| 1111 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1112 | } break; |
| 1113 | |
| 1114 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: { |
| 1115 | safe_VkPhysicalDeviceExternalImageFormatInfo *safe_struct = new safe_VkPhysicalDeviceExternalImageFormatInfo; |
| 1116 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfo *>(cur_pnext)); |
| 1117 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1118 | } break; |
| 1119 | |
| 1120 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: { |
| 1121 | safe_VkPhysicalDeviceImageDrmFormatModifierInfoEXT *safe_struct = new safe_VkPhysicalDeviceImageDrmFormatModifierInfoEXT; |
| 1122 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceImageDrmFormatModifierInfoEXT *>(cur_pnext)); |
| 1123 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1124 | } break; |
| 1125 | |
| 1126 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: { |
| 1127 | safe_VkPhysicalDeviceImageViewImageFormatInfoEXT *safe_struct = new safe_VkPhysicalDeviceImageViewImageFormatInfoEXT; |
| 1128 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceImageViewImageFormatInfoEXT *>(cur_pnext)); |
| 1129 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1130 | } break; |
| 1131 | |
| 1132 | case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: { |
| 1133 | safe_VkQueueFamilyCheckpointPropertiesNV *safe_struct = new safe_VkQueueFamilyCheckpointPropertiesNV; |
| 1134 | safe_struct->initialize(reinterpret_cast<const VkQueueFamilyCheckpointPropertiesNV *>(cur_pnext)); |
| 1135 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1136 | } break; |
| 1137 | |
| 1138 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: { |
| 1139 | safe_VkPhysicalDeviceMemoryBudgetPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceMemoryBudgetPropertiesEXT; |
| 1140 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceMemoryBudgetPropertiesEXT *>(cur_pnext)); |
| 1141 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1142 | } break; |
| 1143 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 1144 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: { |
| 1145 | safe_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *safe_struct = new safe_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT; |
| 1146 | safe_struct->initialize(reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *>(cur_pnext)); |
| 1147 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1148 | } break; |
| 1149 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1150 | case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT: { |
| 1151 | safe_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT *safe_struct = new safe_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT; |
| 1152 | safe_struct->initialize(reinterpret_cast<const VkDescriptorSetVariableDescriptorCountLayoutSupportEXT *>(cur_pnext)); |
| 1153 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1154 | } break; |
| 1155 | |
| 1156 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: { |
| 1157 | safe_VkDeviceGroupSwapchainCreateInfoKHR *safe_struct = new safe_VkDeviceGroupSwapchainCreateInfoKHR; |
| 1158 | safe_struct->initialize(reinterpret_cast<const VkDeviceGroupSwapchainCreateInfoKHR *>(cur_pnext)); |
| 1159 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1160 | } break; |
| 1161 | |
| 1162 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1163 | case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: { |
| 1164 | safe_VkSurfaceFullScreenExclusiveInfoEXT *safe_struct = new safe_VkSurfaceFullScreenExclusiveInfoEXT; |
| 1165 | safe_struct->initialize(reinterpret_cast<const VkSurfaceFullScreenExclusiveInfoEXT *>(cur_pnext)); |
| 1166 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1167 | } break; |
| 1168 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1169 | |
| 1170 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1171 | case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: { |
| 1172 | safe_VkSurfaceFullScreenExclusiveWin32InfoEXT *safe_struct = new safe_VkSurfaceFullScreenExclusiveWin32InfoEXT; |
| 1173 | safe_struct->initialize(reinterpret_cast<const VkSurfaceFullScreenExclusiveWin32InfoEXT *>(cur_pnext)); |
| 1174 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1175 | } break; |
| 1176 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1177 | |
| 1178 | case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: { |
| 1179 | safe_VkSwapchainCounterCreateInfoEXT *safe_struct = new safe_VkSwapchainCounterCreateInfoEXT; |
| 1180 | safe_struct->initialize(reinterpret_cast<const VkSwapchainCounterCreateInfoEXT *>(cur_pnext)); |
| 1181 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1182 | } break; |
| 1183 | |
| 1184 | case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: { |
| 1185 | safe_VkSwapchainDisplayNativeHdrCreateInfoAMD *safe_struct = new safe_VkSwapchainDisplayNativeHdrCreateInfoAMD; |
| 1186 | safe_struct->initialize(reinterpret_cast<const VkSwapchainDisplayNativeHdrCreateInfoAMD *>(cur_pnext)); |
| 1187 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1188 | } break; |
| 1189 | |
| 1190 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: { |
| 1191 | safe_VkDeviceGroupPresentInfoKHR *safe_struct = new safe_VkDeviceGroupPresentInfoKHR; |
| 1192 | safe_struct->initialize(reinterpret_cast<const VkDeviceGroupPresentInfoKHR *>(cur_pnext)); |
| 1193 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1194 | } break; |
| 1195 | |
| 1196 | case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: { |
| 1197 | safe_VkDisplayPresentInfoKHR *safe_struct = new safe_VkDisplayPresentInfoKHR; |
| 1198 | safe_struct->initialize(reinterpret_cast<const VkDisplayPresentInfoKHR *>(cur_pnext)); |
| 1199 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1200 | } break; |
| 1201 | |
| 1202 | #ifdef VK_USE_PLATFORM_GGP |
| 1203 | case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: { |
| 1204 | safe_VkPresentFrameTokenGGP *safe_struct = new safe_VkPresentFrameTokenGGP; |
| 1205 | safe_struct->initialize(reinterpret_cast<const VkPresentFrameTokenGGP *>(cur_pnext)); |
| 1206 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1207 | } break; |
| 1208 | #endif // VK_USE_PLATFORM_GGP |
| 1209 | |
| 1210 | case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: { |
| 1211 | safe_VkPresentRegionsKHR *safe_struct = new safe_VkPresentRegionsKHR; |
| 1212 | safe_struct->initialize(reinterpret_cast<const VkPresentRegionsKHR *>(cur_pnext)); |
| 1213 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1214 | } break; |
| 1215 | |
| 1216 | case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: { |
| 1217 | safe_VkPresentTimesInfoGOOGLE *safe_struct = new safe_VkPresentTimesInfoGOOGLE; |
| 1218 | safe_struct->initialize(reinterpret_cast<const VkPresentTimesInfoGOOGLE *>(cur_pnext)); |
| 1219 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1220 | } break; |
| 1221 | |
| 1222 | case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR: { |
| 1223 | safe_VkSubpassDescriptionDepthStencilResolveKHR *safe_struct = new safe_VkSubpassDescriptionDepthStencilResolveKHR; |
| 1224 | safe_struct->initialize(reinterpret_cast<const VkSubpassDescriptionDepthStencilResolveKHR *>(cur_pnext)); |
| 1225 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1226 | } break; |
| 1227 | |
| 1228 | case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: { |
| 1229 | safe_VkDisplayNativeHdrSurfaceCapabilitiesAMD *safe_struct = new safe_VkDisplayNativeHdrSurfaceCapabilitiesAMD; |
| 1230 | safe_struct->initialize(reinterpret_cast<const VkDisplayNativeHdrSurfaceCapabilitiesAMD *>(cur_pnext)); |
| 1231 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1232 | } break; |
| 1233 | |
| 1234 | case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: { |
| 1235 | safe_VkSharedPresentSurfaceCapabilitiesKHR *safe_struct = new safe_VkSharedPresentSurfaceCapabilitiesKHR; |
| 1236 | safe_struct->initialize(reinterpret_cast<const VkSharedPresentSurfaceCapabilitiesKHR *>(cur_pnext)); |
| 1237 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1238 | } break; |
| 1239 | |
| 1240 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1241 | case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: { |
| 1242 | safe_VkSurfaceCapabilitiesFullScreenExclusiveEXT *safe_struct = new safe_VkSurfaceCapabilitiesFullScreenExclusiveEXT; |
| 1243 | safe_struct->initialize(reinterpret_cast<const VkSurfaceCapabilitiesFullScreenExclusiveEXT *>(cur_pnext)); |
| 1244 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1245 | } break; |
| 1246 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1247 | |
| 1248 | case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: { |
| 1249 | safe_VkSurfaceProtectedCapabilitiesKHR *safe_struct = new safe_VkSurfaceProtectedCapabilitiesKHR; |
| 1250 | safe_struct->initialize(reinterpret_cast<const VkSurfaceProtectedCapabilitiesKHR *>(cur_pnext)); |
| 1251 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1252 | } break; |
| 1253 | |
| 1254 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 1255 | case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: { |
| 1256 | safe_VkAndroidHardwareBufferFormatPropertiesANDROID *safe_struct = new safe_VkAndroidHardwareBufferFormatPropertiesANDROID; |
| 1257 | safe_struct->initialize(reinterpret_cast<const VkAndroidHardwareBufferFormatPropertiesANDROID *>(cur_pnext)); |
| 1258 | cur_ext_struct = reinterpret_cast<void *>(safe_struct); |
| 1259 | } break; |
| 1260 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 1261 | |
| 1262 | default: |
| 1263 | break; |
| 1264 | } |
| 1265 | |
| 1266 | // Save pointer to the first structure in the pNext chain |
| 1267 | head_pnext = (head_pnext ? head_pnext : cur_ext_struct); |
| 1268 | |
| 1269 | // For any extension structure but the first, link the last struct's pNext to the current ext struct |
| 1270 | if (prev_ext_struct) { |
| 1271 | reinterpret_cast<VkBaseOutStructure *>(prev_ext_struct)->pNext = reinterpret_cast<VkBaseOutStructure *>(cur_ext_struct); |
| 1272 | } |
| 1273 | prev_ext_struct = cur_ext_struct; |
| 1274 | |
| 1275 | // Process the next structure in the chain |
| 1276 | cur_pnext = header->pNext; |
| 1277 | } |
| 1278 | return head_pnext; |
| 1279 | } |
| 1280 | |
| 1281 | // Free a pNext extension chain |
| 1282 | void FreeUnwrappedExtensionStructs(void *head) { |
| 1283 | VkBaseOutStructure *curr_ptr = reinterpret_cast<VkBaseOutStructure *>(head); |
| 1284 | while (curr_ptr) { |
| 1285 | VkBaseOutStructure *header = curr_ptr; |
| 1286 | curr_ptr = reinterpret_cast<VkBaseOutStructure *>(header->pNext); |
| 1287 | |
| 1288 | switch (header->sType) { |
| 1289 | case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: |
| 1290 | delete reinterpret_cast<safe_VkDebugReportCallbackCreateInfoEXT *>(header); |
| 1291 | break; |
| 1292 | |
| 1293 | case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: |
| 1294 | delete reinterpret_cast<safe_VkDebugUtilsMessengerCreateInfoEXT *>(header); |
| 1295 | break; |
| 1296 | |
| 1297 | case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: |
| 1298 | delete reinterpret_cast<safe_VkValidationFeaturesEXT *>(header); |
| 1299 | break; |
| 1300 | |
| 1301 | case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: |
| 1302 | delete reinterpret_cast<safe_VkValidationFlagsEXT *>(header); |
| 1303 | break; |
| 1304 | |
| 1305 | case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: |
| 1306 | delete reinterpret_cast<safe_VkDeviceQueueGlobalPriorityCreateInfoEXT *>(header); |
| 1307 | break; |
| 1308 | |
| 1309 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: |
| 1310 | delete reinterpret_cast<safe_VkDeviceGroupDeviceCreateInfo *>(header); |
| 1311 | break; |
| 1312 | |
| 1313 | case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: |
| 1314 | delete reinterpret_cast<safe_VkDeviceMemoryOverallocationCreateInfoAMD *>(header); |
| 1315 | break; |
| 1316 | |
| 1317 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: |
| 1318 | delete reinterpret_cast<safe_VkPhysicalDevice16BitStorageFeatures *>(header); |
| 1319 | break; |
| 1320 | |
| 1321 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: |
| 1322 | delete reinterpret_cast<safe_VkPhysicalDevice8BitStorageFeaturesKHR *>(header); |
| 1323 | break; |
| 1324 | |
| 1325 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: |
| 1326 | delete reinterpret_cast<safe_VkPhysicalDeviceASTCDecodeFeaturesEXT *>(header); |
| 1327 | break; |
| 1328 | |
| 1329 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: |
| 1330 | delete reinterpret_cast<safe_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *>(header); |
| 1331 | break; |
| 1332 | |
| 1333 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: |
| 1334 | delete reinterpret_cast<safe_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *>(header); |
| 1335 | break; |
| 1336 | |
| 1337 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: |
| 1338 | delete reinterpret_cast<safe_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *>(header); |
| 1339 | break; |
| 1340 | |
| 1341 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: |
| 1342 | delete reinterpret_cast<safe_VkPhysicalDeviceConditionalRenderingFeaturesEXT *>(header); |
| 1343 | break; |
| 1344 | |
| 1345 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: |
| 1346 | delete reinterpret_cast<safe_VkPhysicalDeviceCooperativeMatrixFeaturesNV *>(header); |
| 1347 | break; |
| 1348 | |
| 1349 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: |
| 1350 | delete reinterpret_cast<safe_VkPhysicalDeviceCornerSampledImageFeaturesNV *>(header); |
| 1351 | break; |
| 1352 | |
| 1353 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: |
| 1354 | delete reinterpret_cast<safe_VkPhysicalDeviceCoverageReductionModeFeaturesNV *>(header); |
| 1355 | break; |
| 1356 | |
| 1357 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: |
| 1358 | delete reinterpret_cast<safe_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *>(header); |
| 1359 | break; |
| 1360 | |
| 1361 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: |
| 1362 | delete reinterpret_cast<safe_VkPhysicalDeviceDepthClipEnableFeaturesEXT *>(header); |
| 1363 | break; |
| 1364 | |
| 1365 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT: |
| 1366 | delete reinterpret_cast<safe_VkPhysicalDeviceDescriptorIndexingFeaturesEXT *>(header); |
| 1367 | break; |
| 1368 | |
| 1369 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: |
| 1370 | delete reinterpret_cast<safe_VkPhysicalDeviceExclusiveScissorFeaturesNV *>(header); |
| 1371 | break; |
| 1372 | |
| 1373 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: |
| 1374 | delete reinterpret_cast<safe_VkPhysicalDeviceFeatures2 *>(header); |
| 1375 | break; |
| 1376 | |
| 1377 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR: |
| 1378 | delete reinterpret_cast<safe_VkPhysicalDeviceFloat16Int8FeaturesKHR *>(header); |
| 1379 | break; |
| 1380 | |
| 1381 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: |
| 1382 | delete reinterpret_cast<safe_VkPhysicalDeviceFragmentDensityMapFeaturesEXT *>(header); |
| 1383 | break; |
| 1384 | |
| 1385 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: |
| 1386 | delete reinterpret_cast<safe_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV *>(header); |
| 1387 | break; |
| 1388 | |
| 1389 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: |
| 1390 | delete reinterpret_cast<safe_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *>(header); |
| 1391 | break; |
| 1392 | |
| 1393 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: |
| 1394 | delete reinterpret_cast<safe_VkPhysicalDeviceHostQueryResetFeaturesEXT *>(header); |
| 1395 | break; |
| 1396 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 1397 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR: |
| 1398 | delete reinterpret_cast<safe_VkPhysicalDeviceImagelessFramebufferFeaturesKHR *>(header); |
| 1399 | break; |
| 1400 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1401 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: |
| 1402 | delete reinterpret_cast<safe_VkPhysicalDeviceInlineUniformBlockFeaturesEXT *>(header); |
| 1403 | break; |
| 1404 | |
| 1405 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: |
| 1406 | delete reinterpret_cast<safe_VkPhysicalDeviceMemoryPriorityFeaturesEXT *>(header); |
| 1407 | break; |
| 1408 | |
| 1409 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: |
| 1410 | delete reinterpret_cast<safe_VkPhysicalDeviceMeshShaderFeaturesNV *>(header); |
| 1411 | break; |
| 1412 | |
| 1413 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: |
| 1414 | delete reinterpret_cast<safe_VkPhysicalDeviceMultiviewFeatures *>(header); |
| 1415 | break; |
| 1416 | |
| 1417 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: |
| 1418 | delete reinterpret_cast<safe_VkPhysicalDeviceProtectedMemoryFeatures *>(header); |
| 1419 | break; |
| 1420 | |
| 1421 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: |
| 1422 | delete reinterpret_cast<safe_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *>(header); |
| 1423 | break; |
| 1424 | |
| 1425 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: |
| 1426 | delete reinterpret_cast<safe_VkPhysicalDeviceSamplerYcbcrConversionFeatures *>(header); |
| 1427 | break; |
| 1428 | |
| 1429 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: |
| 1430 | delete reinterpret_cast<safe_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT *>(header); |
| 1431 | break; |
| 1432 | |
| 1433 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: |
| 1434 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *>(header); |
| 1435 | break; |
| 1436 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 1437 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: |
| 1438 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *>(header); |
| 1439 | break; |
| 1440 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1441 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: |
| 1442 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderDrawParametersFeatures *>(header); |
| 1443 | break; |
| 1444 | |
| 1445 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: |
| 1446 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderImageFootprintFeaturesNV *>(header); |
| 1447 | break; |
| 1448 | |
| 1449 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS2_FEATURES_INTEL: |
| 1450 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderIntegerFunctions2INTEL *>(header); |
| 1451 | break; |
| 1452 | |
| 1453 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: |
| 1454 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *>(header); |
| 1455 | break; |
| 1456 | |
| 1457 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: |
| 1458 | delete reinterpret_cast<safe_VkPhysicalDeviceShadingRateImageFeaturesNV *>(header); |
| 1459 | break; |
| 1460 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 1461 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: |
| 1462 | delete reinterpret_cast<safe_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *>(header); |
| 1463 | break; |
| 1464 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1465 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: |
| 1466 | delete reinterpret_cast<safe_VkPhysicalDeviceTransformFeedbackFeaturesEXT *>(header); |
| 1467 | break; |
| 1468 | |
| 1469 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: |
| 1470 | delete reinterpret_cast<safe_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *>(header); |
| 1471 | break; |
| 1472 | |
| 1473 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: |
| 1474 | delete reinterpret_cast<safe_VkPhysicalDeviceVariablePointersFeatures *>(header); |
| 1475 | break; |
| 1476 | |
| 1477 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: |
| 1478 | delete reinterpret_cast<safe_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *>(header); |
| 1479 | break; |
| 1480 | |
| 1481 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR: |
| 1482 | delete reinterpret_cast<safe_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR *>(header); |
| 1483 | break; |
| 1484 | |
| 1485 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: |
| 1486 | delete reinterpret_cast<safe_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *>(header); |
| 1487 | break; |
| 1488 | |
| 1489 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1490 | case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: |
| 1491 | delete reinterpret_cast<safe_VkD3D12FenceSubmitInfoKHR *>(header); |
| 1492 | break; |
| 1493 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1494 | |
| 1495 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: |
| 1496 | delete reinterpret_cast<safe_VkDeviceGroupSubmitInfo *>(header); |
| 1497 | break; |
| 1498 | |
| 1499 | case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: |
| 1500 | delete reinterpret_cast<safe_VkProtectedSubmitInfo *>(header); |
| 1501 | break; |
| 1502 | |
| 1503 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1504 | case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: |
| 1505 | delete reinterpret_cast<safe_VkWin32KeyedMutexAcquireReleaseInfoKHR *>(header); |
| 1506 | break; |
| 1507 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1508 | |
| 1509 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1510 | case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: |
| 1511 | delete reinterpret_cast<safe_VkWin32KeyedMutexAcquireReleaseInfoNV *>(header); |
| 1512 | break; |
| 1513 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1514 | |
| 1515 | case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: |
| 1516 | delete reinterpret_cast<safe_VkDedicatedAllocationMemoryAllocateInfoNV *>(header); |
| 1517 | break; |
| 1518 | |
| 1519 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: |
| 1520 | delete reinterpret_cast<safe_VkExportMemoryAllocateInfo *>(header); |
| 1521 | break; |
| 1522 | |
| 1523 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: |
| 1524 | delete reinterpret_cast<safe_VkExportMemoryAllocateInfoNV *>(header); |
| 1525 | break; |
| 1526 | |
| 1527 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1528 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: |
| 1529 | delete reinterpret_cast<safe_VkExportMemoryWin32HandleInfoKHR *>(header); |
| 1530 | break; |
| 1531 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1532 | |
| 1533 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1534 | case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: |
| 1535 | delete reinterpret_cast<safe_VkExportMemoryWin32HandleInfoNV *>(header); |
| 1536 | break; |
| 1537 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1538 | |
| 1539 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 1540 | case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: |
| 1541 | delete reinterpret_cast<safe_VkImportAndroidHardwareBufferInfoANDROID *>(header); |
| 1542 | break; |
| 1543 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 1544 | |
| 1545 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: |
| 1546 | delete reinterpret_cast<safe_VkImportMemoryFdInfoKHR *>(header); |
| 1547 | break; |
| 1548 | |
| 1549 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: |
| 1550 | delete reinterpret_cast<safe_VkImportMemoryHostPointerInfoEXT *>(header); |
| 1551 | break; |
| 1552 | |
| 1553 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1554 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: |
| 1555 | delete reinterpret_cast<safe_VkImportMemoryWin32HandleInfoKHR *>(header); |
| 1556 | break; |
| 1557 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1558 | |
| 1559 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1560 | case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: |
| 1561 | delete reinterpret_cast<safe_VkImportMemoryWin32HandleInfoNV *>(header); |
| 1562 | break; |
| 1563 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1564 | |
| 1565 | case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: |
| 1566 | delete reinterpret_cast<safe_VkMemoryAllocateFlagsInfo *>(header); |
| 1567 | break; |
| 1568 | |
| 1569 | case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: |
| 1570 | delete reinterpret_cast<safe_VkMemoryDedicatedAllocateInfo *>(header); |
| 1571 | break; |
| 1572 | |
| 1573 | case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: |
| 1574 | delete reinterpret_cast<safe_VkMemoryPriorityAllocateInfoEXT *>(header); |
| 1575 | break; |
| 1576 | |
| 1577 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: |
| 1578 | delete reinterpret_cast<safe_VkDeviceGroupBindSparseInfo *>(header); |
| 1579 | break; |
| 1580 | |
| 1581 | case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: |
| 1582 | delete reinterpret_cast<safe_VkExportFenceCreateInfo *>(header); |
| 1583 | break; |
| 1584 | |
| 1585 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1586 | case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: |
| 1587 | delete reinterpret_cast<safe_VkExportFenceWin32HandleInfoKHR *>(header); |
| 1588 | break; |
| 1589 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1590 | |
| 1591 | case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: |
| 1592 | delete reinterpret_cast<safe_VkExportSemaphoreCreateInfo *>(header); |
| 1593 | break; |
| 1594 | |
| 1595 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1596 | case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: |
| 1597 | delete reinterpret_cast<safe_VkExportSemaphoreWin32HandleInfoKHR *>(header); |
| 1598 | break; |
| 1599 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1600 | |
| 1601 | case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: |
| 1602 | delete reinterpret_cast<safe_VkBufferDeviceAddressCreateInfoEXT *>(header); |
| 1603 | break; |
| 1604 | |
| 1605 | case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: |
| 1606 | delete reinterpret_cast<safe_VkDedicatedAllocationBufferCreateInfoNV *>(header); |
| 1607 | break; |
| 1608 | |
| 1609 | case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: |
| 1610 | delete reinterpret_cast<safe_VkExternalMemoryBufferCreateInfo *>(header); |
| 1611 | break; |
| 1612 | |
| 1613 | case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: |
| 1614 | delete reinterpret_cast<safe_VkDedicatedAllocationImageCreateInfoNV *>(header); |
| 1615 | break; |
| 1616 | |
| 1617 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 1618 | case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: |
| 1619 | delete reinterpret_cast<safe_VkExternalFormatANDROID *>(header); |
| 1620 | break; |
| 1621 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 1622 | |
| 1623 | case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: |
| 1624 | delete reinterpret_cast<safe_VkExternalMemoryImageCreateInfo *>(header); |
| 1625 | break; |
| 1626 | |
| 1627 | case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: |
| 1628 | delete reinterpret_cast<safe_VkExternalMemoryImageCreateInfoNV *>(header); |
| 1629 | break; |
| 1630 | |
| 1631 | case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: |
| 1632 | delete reinterpret_cast<safe_VkImageDrmFormatModifierExplicitCreateInfoEXT *>(header); |
| 1633 | break; |
| 1634 | |
| 1635 | case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: |
| 1636 | delete reinterpret_cast<safe_VkImageDrmFormatModifierListCreateInfoEXT *>(header); |
| 1637 | break; |
| 1638 | |
| 1639 | case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR: |
| 1640 | delete reinterpret_cast<safe_VkImageFormatListCreateInfoKHR *>(header); |
| 1641 | break; |
| 1642 | |
| 1643 | case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT: |
| 1644 | delete reinterpret_cast<safe_VkImageStencilUsageCreateInfoEXT *>(header); |
| 1645 | break; |
| 1646 | |
| 1647 | case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: |
| 1648 | delete reinterpret_cast<safe_VkImageSwapchainCreateInfoKHR *>(header); |
| 1649 | break; |
| 1650 | |
| 1651 | case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: |
| 1652 | delete reinterpret_cast<safe_VkImageViewASTCDecodeModeEXT *>(header); |
| 1653 | break; |
| 1654 | |
| 1655 | case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: |
| 1656 | delete reinterpret_cast<safe_VkImageViewUsageCreateInfo *>(header); |
| 1657 | break; |
| 1658 | |
| 1659 | case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: |
| 1660 | delete reinterpret_cast<safe_VkSamplerYcbcrConversionInfo *>(header); |
| 1661 | break; |
| 1662 | |
| 1663 | case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: |
| 1664 | delete reinterpret_cast<safe_VkShaderModuleValidationCacheCreateInfoEXT *>(header); |
| 1665 | break; |
| 1666 | |
| 1667 | case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: |
| 1668 | delete reinterpret_cast<safe_VkPipelineVertexInputDivisorStateCreateInfoEXT *>(header); |
| 1669 | break; |
| 1670 | |
| 1671 | case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: |
| 1672 | delete reinterpret_cast<safe_VkPipelineTessellationDomainOriginStateCreateInfo *>(header); |
| 1673 | break; |
| 1674 | |
| 1675 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: |
| 1676 | delete reinterpret_cast<safe_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV *>(header); |
| 1677 | break; |
| 1678 | |
| 1679 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: |
| 1680 | delete reinterpret_cast<safe_VkPipelineViewportExclusiveScissorStateCreateInfoNV *>(header); |
| 1681 | break; |
| 1682 | |
| 1683 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: |
| 1684 | delete reinterpret_cast<safe_VkPipelineViewportShadingRateImageStateCreateInfoNV *>(header); |
| 1685 | break; |
| 1686 | |
| 1687 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: |
| 1688 | delete reinterpret_cast<safe_VkPipelineViewportSwizzleStateCreateInfoNV *>(header); |
| 1689 | break; |
| 1690 | |
| 1691 | case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: |
| 1692 | delete reinterpret_cast<safe_VkPipelineViewportWScalingStateCreateInfoNV *>(header); |
| 1693 | break; |
| 1694 | |
| 1695 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: |
| 1696 | delete reinterpret_cast<safe_VkPipelineRasterizationConservativeStateCreateInfoEXT *>(header); |
| 1697 | break; |
| 1698 | |
| 1699 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: |
| 1700 | delete reinterpret_cast<safe_VkPipelineRasterizationDepthClipStateCreateInfoEXT *>(header); |
| 1701 | break; |
| 1702 | |
| 1703 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: |
| 1704 | delete reinterpret_cast<safe_VkPipelineRasterizationStateRasterizationOrderAMD *>(header); |
| 1705 | break; |
| 1706 | |
| 1707 | case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: |
| 1708 | delete reinterpret_cast<safe_VkPipelineRasterizationStateStreamCreateInfoEXT *>(header); |
| 1709 | break; |
| 1710 | |
| 1711 | case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: |
| 1712 | delete reinterpret_cast<safe_VkPipelineCoverageModulationStateCreateInfoNV *>(header); |
| 1713 | break; |
| 1714 | |
| 1715 | case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: |
| 1716 | delete reinterpret_cast<safe_VkPipelineCoverageReductionStateCreateInfoNV *>(header); |
| 1717 | break; |
| 1718 | |
| 1719 | case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: |
| 1720 | delete reinterpret_cast<safe_VkPipelineCoverageToColorStateCreateInfoNV *>(header); |
| 1721 | break; |
| 1722 | |
| 1723 | case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: |
| 1724 | delete reinterpret_cast<safe_VkPipelineSampleLocationsStateCreateInfoEXT *>(header); |
| 1725 | break; |
| 1726 | |
| 1727 | case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: |
| 1728 | delete reinterpret_cast<safe_VkPipelineColorBlendAdvancedStateCreateInfoEXT *>(header); |
| 1729 | break; |
| 1730 | |
| 1731 | case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: |
| 1732 | delete reinterpret_cast<safe_VkPipelineCreationFeedbackCreateInfoEXT *>(header); |
| 1733 | break; |
| 1734 | |
| 1735 | case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: |
| 1736 | delete reinterpret_cast<safe_VkPipelineDiscardRectangleStateCreateInfoEXT *>(header); |
| 1737 | break; |
| 1738 | |
| 1739 | case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: |
| 1740 | delete reinterpret_cast<safe_VkPipelineRepresentativeFragmentTestStateCreateInfoNV *>(header); |
| 1741 | break; |
| 1742 | |
| 1743 | case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT: |
| 1744 | delete reinterpret_cast<safe_VkSamplerReductionModeCreateInfoEXT *>(header); |
| 1745 | break; |
| 1746 | |
| 1747 | case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT: |
| 1748 | delete reinterpret_cast<safe_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT *>(header); |
| 1749 | break; |
| 1750 | |
| 1751 | case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: |
| 1752 | delete reinterpret_cast<safe_VkDescriptorPoolInlineUniformBlockCreateInfoEXT *>(header); |
| 1753 | break; |
| 1754 | |
| 1755 | case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT: |
| 1756 | delete reinterpret_cast<safe_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT *>(header); |
| 1757 | break; |
| 1758 | |
| 1759 | case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: |
| 1760 | delete reinterpret_cast<safe_VkWriteDescriptorSetAccelerationStructureNV *>(header); |
| 1761 | break; |
| 1762 | |
| 1763 | case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: |
| 1764 | delete reinterpret_cast<safe_VkWriteDescriptorSetInlineUniformBlockEXT *>(header); |
| 1765 | break; |
| 1766 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 1767 | case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR: |
| 1768 | delete reinterpret_cast<safe_VkFramebufferAttachmentsCreateInfoKHR *>(header); |
| 1769 | break; |
| 1770 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1771 | case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: |
| 1772 | delete reinterpret_cast<safe_VkRenderPassFragmentDensityMapCreateInfoEXT *>(header); |
| 1773 | break; |
| 1774 | |
| 1775 | case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: |
| 1776 | delete reinterpret_cast<safe_VkRenderPassInputAttachmentAspectCreateInfo *>(header); |
| 1777 | break; |
| 1778 | |
| 1779 | case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: |
| 1780 | delete reinterpret_cast<safe_VkRenderPassMultiviewCreateInfo *>(header); |
| 1781 | break; |
| 1782 | |
| 1783 | case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: |
| 1784 | delete reinterpret_cast<safe_VkCommandBufferInheritanceConditionalRenderingInfoEXT *>(header); |
| 1785 | break; |
| 1786 | |
| 1787 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: |
| 1788 | delete reinterpret_cast<safe_VkDeviceGroupCommandBufferBeginInfo *>(header); |
| 1789 | break; |
| 1790 | |
| 1791 | case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: |
| 1792 | delete reinterpret_cast<safe_VkSampleLocationsInfoEXT *>(header); |
| 1793 | break; |
| 1794 | |
| 1795 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: |
| 1796 | delete reinterpret_cast<safe_VkDeviceGroupRenderPassBeginInfo *>(header); |
| 1797 | break; |
| 1798 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 1799 | case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR: |
| 1800 | delete reinterpret_cast<safe_VkRenderPassAttachmentBeginInfoKHR *>(header); |
| 1801 | break; |
| 1802 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1803 | case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: |
| 1804 | delete reinterpret_cast<safe_VkRenderPassSampleLocationsBeginInfoEXT *>(header); |
| 1805 | break; |
| 1806 | |
| 1807 | case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: |
| 1808 | delete reinterpret_cast<safe_VkBindBufferMemoryDeviceGroupInfo *>(header); |
| 1809 | break; |
| 1810 | |
| 1811 | case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: |
| 1812 | delete reinterpret_cast<safe_VkBindImageMemoryDeviceGroupInfo *>(header); |
| 1813 | break; |
| 1814 | |
| 1815 | case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: |
| 1816 | delete reinterpret_cast<safe_VkBindImageMemorySwapchainInfoKHR *>(header); |
| 1817 | break; |
| 1818 | |
| 1819 | case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: |
| 1820 | delete reinterpret_cast<safe_VkBindImagePlaneMemoryInfo *>(header); |
| 1821 | break; |
| 1822 | |
| 1823 | case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: |
| 1824 | delete reinterpret_cast<safe_VkImagePlaneMemoryRequirementsInfo *>(header); |
| 1825 | break; |
| 1826 | |
| 1827 | case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: |
| 1828 | delete reinterpret_cast<safe_VkMemoryDedicatedRequirements *>(header); |
| 1829 | break; |
| 1830 | |
| 1831 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: |
| 1832 | delete reinterpret_cast<safe_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *>(header); |
| 1833 | break; |
| 1834 | |
| 1835 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: |
| 1836 | delete reinterpret_cast<safe_VkPhysicalDeviceConservativeRasterizationPropertiesEXT *>(header); |
| 1837 | break; |
| 1838 | |
| 1839 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: |
| 1840 | delete reinterpret_cast<safe_VkPhysicalDeviceCooperativeMatrixPropertiesNV *>(header); |
| 1841 | break; |
| 1842 | |
| 1843 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR: |
| 1844 | delete reinterpret_cast<safe_VkPhysicalDeviceDepthStencilResolvePropertiesKHR *>(header); |
| 1845 | break; |
| 1846 | |
| 1847 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT: |
| 1848 | delete reinterpret_cast<safe_VkPhysicalDeviceDescriptorIndexingPropertiesEXT *>(header); |
| 1849 | break; |
| 1850 | |
| 1851 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: |
| 1852 | delete reinterpret_cast<safe_VkPhysicalDeviceDiscardRectanglePropertiesEXT *>(header); |
| 1853 | break; |
| 1854 | |
| 1855 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR: |
| 1856 | delete reinterpret_cast<safe_VkPhysicalDeviceDriverPropertiesKHR *>(header); |
| 1857 | break; |
| 1858 | |
| 1859 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: |
| 1860 | delete reinterpret_cast<safe_VkPhysicalDeviceExternalMemoryHostPropertiesEXT *>(header); |
| 1861 | break; |
| 1862 | |
| 1863 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR: |
| 1864 | delete reinterpret_cast<safe_VkPhysicalDeviceFloatControlsPropertiesKHR *>(header); |
| 1865 | break; |
| 1866 | |
| 1867 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: |
| 1868 | delete reinterpret_cast<safe_VkPhysicalDeviceFragmentDensityMapPropertiesEXT *>(header); |
| 1869 | break; |
| 1870 | |
| 1871 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: |
| 1872 | delete reinterpret_cast<safe_VkPhysicalDeviceIDProperties *>(header); |
| 1873 | break; |
| 1874 | |
| 1875 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: |
| 1876 | delete reinterpret_cast<safe_VkPhysicalDeviceInlineUniformBlockPropertiesEXT *>(header); |
| 1877 | break; |
| 1878 | |
| 1879 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: |
| 1880 | delete reinterpret_cast<safe_VkPhysicalDeviceMaintenance3Properties *>(header); |
| 1881 | break; |
| 1882 | |
| 1883 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: |
| 1884 | delete reinterpret_cast<safe_VkPhysicalDeviceMeshShaderPropertiesNV *>(header); |
| 1885 | break; |
| 1886 | |
| 1887 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: |
| 1888 | delete reinterpret_cast<safe_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX *>(header); |
| 1889 | break; |
| 1890 | |
| 1891 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: |
| 1892 | delete reinterpret_cast<safe_VkPhysicalDeviceMultiviewProperties *>(header); |
| 1893 | break; |
| 1894 | |
| 1895 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: |
| 1896 | delete reinterpret_cast<safe_VkPhysicalDevicePCIBusInfoPropertiesEXT *>(header); |
| 1897 | break; |
| 1898 | |
| 1899 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: |
| 1900 | delete reinterpret_cast<safe_VkPhysicalDevicePointClippingProperties *>(header); |
| 1901 | break; |
| 1902 | |
| 1903 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: |
| 1904 | delete reinterpret_cast<safe_VkPhysicalDeviceProtectedMemoryProperties *>(header); |
| 1905 | break; |
| 1906 | |
| 1907 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: |
| 1908 | delete reinterpret_cast<safe_VkPhysicalDevicePushDescriptorPropertiesKHR *>(header); |
| 1909 | break; |
| 1910 | |
| 1911 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: |
| 1912 | delete reinterpret_cast<safe_VkPhysicalDeviceRayTracingPropertiesNV *>(header); |
| 1913 | break; |
| 1914 | |
| 1915 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: |
| 1916 | delete reinterpret_cast<safe_VkPhysicalDeviceSampleLocationsPropertiesEXT *>(header); |
| 1917 | break; |
| 1918 | |
| 1919 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT: |
| 1920 | delete reinterpret_cast<safe_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT *>(header); |
| 1921 | break; |
| 1922 | |
| 1923 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: |
| 1924 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderCorePropertiesAMD *>(header); |
| 1925 | break; |
| 1926 | |
| 1927 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: |
| 1928 | delete reinterpret_cast<safe_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *>(header); |
| 1929 | break; |
| 1930 | |
| 1931 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: |
| 1932 | delete reinterpret_cast<safe_VkPhysicalDeviceShadingRateImagePropertiesNV *>(header); |
| 1933 | break; |
| 1934 | |
| 1935 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: |
| 1936 | delete reinterpret_cast<safe_VkPhysicalDeviceSubgroupProperties *>(header); |
| 1937 | break; |
| 1938 | |
| 1939 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: |
| 1940 | delete reinterpret_cast<safe_VkPhysicalDeviceTransformFeedbackPropertiesEXT *>(header); |
| 1941 | break; |
| 1942 | |
| 1943 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: |
| 1944 | delete reinterpret_cast<safe_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *>(header); |
| 1945 | break; |
| 1946 | |
| 1947 | case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: |
| 1948 | delete reinterpret_cast<safe_VkDrmFormatModifierPropertiesListEXT *>(header); |
| 1949 | break; |
| 1950 | |
| 1951 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 1952 | case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: |
| 1953 | delete reinterpret_cast<safe_VkAndroidHardwareBufferUsageANDROID *>(header); |
| 1954 | break; |
| 1955 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 1956 | |
| 1957 | case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: |
| 1958 | delete reinterpret_cast<safe_VkExternalImageFormatProperties *>(header); |
| 1959 | break; |
| 1960 | |
| 1961 | case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: |
| 1962 | delete reinterpret_cast<safe_VkFilterCubicImageViewImageFormatPropertiesEXT *>(header); |
| 1963 | break; |
| 1964 | |
| 1965 | case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: |
| 1966 | delete reinterpret_cast<safe_VkSamplerYcbcrConversionImageFormatProperties *>(header); |
| 1967 | break; |
| 1968 | |
| 1969 | case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: |
| 1970 | delete reinterpret_cast<safe_VkTextureLODGatherFormatPropertiesAMD *>(header); |
| 1971 | break; |
| 1972 | |
| 1973 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: |
| 1974 | delete reinterpret_cast<safe_VkPhysicalDeviceExternalImageFormatInfo *>(header); |
| 1975 | break; |
| 1976 | |
| 1977 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: |
| 1978 | delete reinterpret_cast<safe_VkPhysicalDeviceImageDrmFormatModifierInfoEXT *>(header); |
| 1979 | break; |
| 1980 | |
| 1981 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: |
| 1982 | delete reinterpret_cast<safe_VkPhysicalDeviceImageViewImageFormatInfoEXT *>(header); |
| 1983 | break; |
| 1984 | |
| 1985 | case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: |
| 1986 | delete reinterpret_cast<safe_VkQueueFamilyCheckpointPropertiesNV *>(header); |
| 1987 | break; |
| 1988 | |
| 1989 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: |
| 1990 | delete reinterpret_cast<safe_VkPhysicalDeviceMemoryBudgetPropertiesEXT *>(header); |
| 1991 | break; |
| 1992 | |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 1993 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: |
| 1994 | delete reinterpret_cast<safe_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *>(header); |
| 1995 | break; |
| 1996 | |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 1997 | case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT: |
| 1998 | delete reinterpret_cast<safe_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT *>(header); |
| 1999 | break; |
| 2000 | |
| 2001 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: |
| 2002 | delete reinterpret_cast<safe_VkDeviceGroupSwapchainCreateInfoKHR *>(header); |
| 2003 | break; |
| 2004 | |
| 2005 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 2006 | case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: |
| 2007 | delete reinterpret_cast<safe_VkSurfaceFullScreenExclusiveInfoEXT *>(header); |
| 2008 | break; |
| 2009 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 2010 | |
| 2011 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 2012 | case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: |
| 2013 | delete reinterpret_cast<safe_VkSurfaceFullScreenExclusiveWin32InfoEXT *>(header); |
| 2014 | break; |
| 2015 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 2016 | |
| 2017 | case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: |
| 2018 | delete reinterpret_cast<safe_VkSwapchainCounterCreateInfoEXT *>(header); |
| 2019 | break; |
| 2020 | |
| 2021 | case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: |
| 2022 | delete reinterpret_cast<safe_VkSwapchainDisplayNativeHdrCreateInfoAMD *>(header); |
| 2023 | break; |
| 2024 | |
| 2025 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: |
| 2026 | delete reinterpret_cast<safe_VkDeviceGroupPresentInfoKHR *>(header); |
| 2027 | break; |
| 2028 | |
| 2029 | case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: |
| 2030 | delete reinterpret_cast<safe_VkDisplayPresentInfoKHR *>(header); |
| 2031 | break; |
| 2032 | |
| 2033 | #ifdef VK_USE_PLATFORM_GGP |
| 2034 | case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: |
| 2035 | delete reinterpret_cast<safe_VkPresentFrameTokenGGP *>(header); |
| 2036 | break; |
| 2037 | #endif // VK_USE_PLATFORM_GGP |
| 2038 | |
| 2039 | case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: |
| 2040 | delete reinterpret_cast<safe_VkPresentRegionsKHR *>(header); |
| 2041 | break; |
| 2042 | |
| 2043 | case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: |
| 2044 | delete reinterpret_cast<safe_VkPresentTimesInfoGOOGLE *>(header); |
| 2045 | break; |
| 2046 | |
| 2047 | case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR: |
| 2048 | delete reinterpret_cast<safe_VkSubpassDescriptionDepthStencilResolveKHR *>(header); |
| 2049 | break; |
| 2050 | |
| 2051 | case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: |
| 2052 | delete reinterpret_cast<safe_VkDisplayNativeHdrSurfaceCapabilitiesAMD *>(header); |
| 2053 | break; |
| 2054 | |
| 2055 | case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: |
| 2056 | delete reinterpret_cast<safe_VkSharedPresentSurfaceCapabilitiesKHR *>(header); |
| 2057 | break; |
| 2058 | |
| 2059 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 2060 | case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: |
| 2061 | delete reinterpret_cast<safe_VkSurfaceCapabilitiesFullScreenExclusiveEXT *>(header); |
| 2062 | break; |
| 2063 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 2064 | |
| 2065 | case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: |
| 2066 | delete reinterpret_cast<safe_VkSurfaceProtectedCapabilitiesKHR *>(header); |
| 2067 | break; |
| 2068 | |
| 2069 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 2070 | case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: |
| 2071 | delete reinterpret_cast<safe_VkAndroidHardwareBufferFormatPropertiesANDROID *>(header); |
| 2072 | break; |
| 2073 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 2074 | |
| 2075 | default: |
| 2076 | assert(0); |
| 2077 | } |
| 2078 | } |
| 2079 | } |
| 2080 | |
| 2081 | |
| 2082 | // Manually written Dispatch routines |
| 2083 | |
| 2084 | VkResult DispatchCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 2085 | const VkComputePipelineCreateInfo *pCreateInfos, |
| 2086 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) { |
| 2087 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2088 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateComputePipelines(device, pipelineCache, createInfoCount, |
| 2089 | pCreateInfos, pAllocator, pPipelines); |
| 2090 | safe_VkComputePipelineCreateInfo *local_pCreateInfos = NULL; |
| 2091 | if (pCreateInfos) { |
| 2092 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2093 | local_pCreateInfos = new safe_VkComputePipelineCreateInfo[createInfoCount]; |
| 2094 | for (uint32_t idx0 = 0; idx0 < createInfoCount; ++idx0) { |
| 2095 | local_pCreateInfos[idx0].initialize(&pCreateInfos[idx0]); |
| 2096 | if (pCreateInfos[idx0].basePipelineHandle) { |
| 2097 | local_pCreateInfos[idx0].basePipelineHandle = layer_data->Unwrap(pCreateInfos[idx0].basePipelineHandle); |
| 2098 | } |
| 2099 | if (pCreateInfos[idx0].layout) { |
| 2100 | local_pCreateInfos[idx0].layout = layer_data->Unwrap(pCreateInfos[idx0].layout); |
| 2101 | } |
| 2102 | if (pCreateInfos[idx0].stage.module) { |
| 2103 | local_pCreateInfos[idx0].stage.module = layer_data->Unwrap(pCreateInfos[idx0].stage.module); |
| 2104 | } |
| 2105 | } |
| 2106 | } |
| 2107 | if (pipelineCache) { |
| 2108 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2109 | pipelineCache = layer_data->Unwrap(pipelineCache); |
| 2110 | } |
| 2111 | |
| 2112 | VkResult result = layer_data->device_dispatch_table.CreateComputePipelines(device, pipelineCache, createInfoCount, |
| 2113 | local_pCreateInfos->ptr(), pAllocator, pPipelines); |
| 2114 | delete[] local_pCreateInfos; |
| 2115 | { |
| 2116 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2117 | for (uint32_t i = 0; i < createInfoCount; ++i) { |
| 2118 | if (pPipelines[i] != VK_NULL_HANDLE) { |
| 2119 | pPipelines[i] = layer_data->WrapNew(pPipelines[i]); |
| 2120 | } |
| 2121 | } |
| 2122 | } |
| 2123 | return result; |
| 2124 | } |
| 2125 | |
| 2126 | VkResult DispatchCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 2127 | const VkGraphicsPipelineCreateInfo *pCreateInfos, |
| 2128 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) { |
| 2129 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2130 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateGraphicsPipelines(device, pipelineCache, createInfoCount, |
| 2131 | pCreateInfos, pAllocator, pPipelines); |
| 2132 | safe_VkGraphicsPipelineCreateInfo *local_pCreateInfos = nullptr; |
| 2133 | if (pCreateInfos) { |
| 2134 | local_pCreateInfos = new safe_VkGraphicsPipelineCreateInfo[createInfoCount]; |
| 2135 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2136 | for (uint32_t idx0 = 0; idx0 < createInfoCount; ++idx0) { |
| 2137 | bool uses_color_attachment = false; |
| 2138 | bool uses_depthstencil_attachment = false; |
| 2139 | { |
| 2140 | const auto subpasses_uses_it = layer_data->renderpasses_states.find(layer_data->Unwrap(pCreateInfos[idx0].renderPass)); |
| 2141 | if (subpasses_uses_it != layer_data->renderpasses_states.end()) { |
| 2142 | const auto &subpasses_uses = subpasses_uses_it->second; |
| 2143 | if (subpasses_uses.subpasses_using_color_attachment.count(pCreateInfos[idx0].subpass)) |
| 2144 | uses_color_attachment = true; |
| 2145 | if (subpasses_uses.subpasses_using_depthstencil_attachment.count(pCreateInfos[idx0].subpass)) |
| 2146 | uses_depthstencil_attachment = true; |
| 2147 | } |
| 2148 | } |
| 2149 | |
| 2150 | local_pCreateInfos[idx0].initialize(&pCreateInfos[idx0], uses_color_attachment, uses_depthstencil_attachment); |
| 2151 | |
| 2152 | if (pCreateInfos[idx0].basePipelineHandle) { |
| 2153 | local_pCreateInfos[idx0].basePipelineHandle = layer_data->Unwrap(pCreateInfos[idx0].basePipelineHandle); |
| 2154 | } |
| 2155 | if (pCreateInfos[idx0].layout) { |
| 2156 | local_pCreateInfos[idx0].layout = layer_data->Unwrap(pCreateInfos[idx0].layout); |
| 2157 | } |
| 2158 | if (pCreateInfos[idx0].pStages) { |
| 2159 | for (uint32_t idx1 = 0; idx1 < pCreateInfos[idx0].stageCount; ++idx1) { |
| 2160 | if (pCreateInfos[idx0].pStages[idx1].module) { |
| 2161 | local_pCreateInfos[idx0].pStages[idx1].module = layer_data->Unwrap(pCreateInfos[idx0].pStages[idx1].module); |
| 2162 | } |
| 2163 | } |
| 2164 | } |
| 2165 | if (pCreateInfos[idx0].renderPass) { |
| 2166 | local_pCreateInfos[idx0].renderPass = layer_data->Unwrap(pCreateInfos[idx0].renderPass); |
| 2167 | } |
| 2168 | } |
| 2169 | } |
| 2170 | if (pipelineCache) { |
| 2171 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2172 | pipelineCache = layer_data->Unwrap(pipelineCache); |
| 2173 | } |
| 2174 | |
| 2175 | VkResult result = layer_data->device_dispatch_table.CreateGraphicsPipelines(device, pipelineCache, createInfoCount, |
| 2176 | local_pCreateInfos->ptr(), pAllocator, pPipelines); |
| 2177 | delete[] local_pCreateInfos; |
| 2178 | { |
| 2179 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2180 | for (uint32_t i = 0; i < createInfoCount; ++i) { |
| 2181 | if (pPipelines[i] != VK_NULL_HANDLE) { |
| 2182 | pPipelines[i] = layer_data->WrapNew(pPipelines[i]); |
| 2183 | } |
| 2184 | } |
| 2185 | } |
| 2186 | return result; |
| 2187 | } |
| 2188 | |
| 2189 | template <typename T> |
| 2190 | static void UpdateCreateRenderPassState(ValidationObject *layer_data, const T *pCreateInfo, VkRenderPass renderPass) { |
| 2191 | auto &renderpass_state = layer_data->renderpasses_states[renderPass]; |
| 2192 | |
| 2193 | for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass) { |
| 2194 | bool uses_color = false; |
| 2195 | for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount && !uses_color; ++i) |
| 2196 | if (pCreateInfo->pSubpasses[subpass].pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) uses_color = true; |
| 2197 | |
| 2198 | bool uses_depthstencil = false; |
| 2199 | if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment) |
| 2200 | if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) |
| 2201 | uses_depthstencil = true; |
| 2202 | |
| 2203 | if (uses_color) renderpass_state.subpasses_using_color_attachment.insert(subpass); |
| 2204 | if (uses_depthstencil) renderpass_state.subpasses_using_depthstencil_attachment.insert(subpass); |
| 2205 | } |
| 2206 | } |
| 2207 | |
| 2208 | VkResult DispatchCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
| 2209 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) { |
| 2210 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2211 | VkResult result = layer_data->device_dispatch_table.CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); |
| 2212 | if (!wrap_handles) return result; |
| 2213 | if (VK_SUCCESS == result) { |
| 2214 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2215 | UpdateCreateRenderPassState(layer_data, pCreateInfo, *pRenderPass); |
| 2216 | *pRenderPass = layer_data->WrapNew(*pRenderPass); |
| 2217 | } |
| 2218 | return result; |
| 2219 | } |
| 2220 | |
| 2221 | VkResult DispatchCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR *pCreateInfo, |
| 2222 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) { |
| 2223 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2224 | VkResult result = layer_data->device_dispatch_table.CreateRenderPass2KHR(device, pCreateInfo, pAllocator, pRenderPass); |
| 2225 | if (!wrap_handles) return result; |
| 2226 | if (VK_SUCCESS == result) { |
| 2227 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2228 | UpdateCreateRenderPassState(layer_data, pCreateInfo, *pRenderPass); |
| 2229 | *pRenderPass = layer_data->WrapNew(*pRenderPass); |
| 2230 | } |
| 2231 | return result; |
| 2232 | } |
| 2233 | |
| 2234 | void DispatchDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) { |
| 2235 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2236 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyRenderPass(device, renderPass, pAllocator); |
| 2237 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 2238 | uint64_t renderPass_id = reinterpret_cast<uint64_t &>(renderPass); |
| 2239 | renderPass = (VkRenderPass)unique_id_mapping[renderPass_id]; |
| 2240 | unique_id_mapping.erase(renderPass_id); |
| 2241 | lock.unlock(); |
| 2242 | layer_data->device_dispatch_table.DestroyRenderPass(device, renderPass, pAllocator); |
| 2243 | |
| 2244 | lock.lock(); |
| 2245 | layer_data->renderpasses_states.erase(renderPass); |
| 2246 | } |
| 2247 | |
| 2248 | VkResult DispatchCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, |
| 2249 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) { |
| 2250 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2251 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); |
| 2252 | safe_VkSwapchainCreateInfoKHR *local_pCreateInfo = NULL; |
| 2253 | if (pCreateInfo) { |
| 2254 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2255 | local_pCreateInfo = new safe_VkSwapchainCreateInfoKHR(pCreateInfo); |
| 2256 | local_pCreateInfo->oldSwapchain = layer_data->Unwrap(pCreateInfo->oldSwapchain); |
| 2257 | // Surface is instance-level object |
| 2258 | local_pCreateInfo->surface = layer_data->Unwrap(pCreateInfo->surface); |
| 2259 | } |
| 2260 | |
| 2261 | VkResult result = layer_data->device_dispatch_table.CreateSwapchainKHR(device, local_pCreateInfo->ptr(), pAllocator, pSwapchain); |
| 2262 | delete local_pCreateInfo; |
| 2263 | |
| 2264 | if (VK_SUCCESS == result) { |
| 2265 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2266 | *pSwapchain = layer_data->WrapNew(*pSwapchain); |
| 2267 | } |
| 2268 | return result; |
| 2269 | } |
| 2270 | |
| 2271 | VkResult DispatchCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR *pCreateInfos, |
| 2272 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains) { |
| 2273 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2274 | if (!wrap_handles) |
| 2275 | return layer_data->device_dispatch_table.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, |
| 2276 | pSwapchains); |
| 2277 | safe_VkSwapchainCreateInfoKHR *local_pCreateInfos = NULL; |
| 2278 | { |
| 2279 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2280 | if (pCreateInfos) { |
| 2281 | local_pCreateInfos = new safe_VkSwapchainCreateInfoKHR[swapchainCount]; |
| 2282 | for (uint32_t i = 0; i < swapchainCount; ++i) { |
| 2283 | local_pCreateInfos[i].initialize(&pCreateInfos[i]); |
| 2284 | if (pCreateInfos[i].surface) { |
| 2285 | // Surface is instance-level object |
| 2286 | local_pCreateInfos[i].surface = layer_data->Unwrap(pCreateInfos[i].surface); |
| 2287 | } |
| 2288 | if (pCreateInfos[i].oldSwapchain) { |
| 2289 | local_pCreateInfos[i].oldSwapchain = layer_data->Unwrap(pCreateInfos[i].oldSwapchain); |
| 2290 | } |
| 2291 | } |
| 2292 | } |
| 2293 | } |
| 2294 | VkResult result = layer_data->device_dispatch_table.CreateSharedSwapchainsKHR(device, swapchainCount, local_pCreateInfos->ptr(), |
| 2295 | pAllocator, pSwapchains); |
| 2296 | delete[] local_pCreateInfos; |
| 2297 | if (VK_SUCCESS == result) { |
| 2298 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2299 | for (uint32_t i = 0; i < swapchainCount; i++) { |
| 2300 | pSwapchains[i] = layer_data->WrapNew(pSwapchains[i]); |
| 2301 | } |
| 2302 | } |
| 2303 | return result; |
| 2304 | } |
| 2305 | |
| 2306 | VkResult DispatchGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, |
| 2307 | VkImage *pSwapchainImages) { |
| 2308 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2309 | if (!wrap_handles) |
| 2310 | return layer_data->device_dispatch_table.GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); |
| 2311 | VkSwapchainKHR wrapped_swapchain_handle = swapchain; |
| 2312 | if (VK_NULL_HANDLE != swapchain) { |
| 2313 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2314 | swapchain = layer_data->Unwrap(swapchain); |
| 2315 | } |
| 2316 | VkResult result = |
| 2317 | layer_data->device_dispatch_table.GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); |
| 2318 | if ((VK_SUCCESS == result) || (VK_INCOMPLETE == result)) { |
| 2319 | if ((*pSwapchainImageCount > 0) && pSwapchainImages) { |
| 2320 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2321 | auto &wrapped_swapchain_image_handles = layer_data->swapchain_wrapped_image_handle_map[wrapped_swapchain_handle]; |
| 2322 | for (uint32_t i = static_cast<uint32_t>(wrapped_swapchain_image_handles.size()); i < *pSwapchainImageCount; i++) { |
| 2323 | wrapped_swapchain_image_handles.emplace_back(layer_data->WrapNew(pSwapchainImages[i])); |
| 2324 | } |
| 2325 | for (uint32_t i = 0; i < *pSwapchainImageCount; i++) { |
| 2326 | pSwapchainImages[i] = wrapped_swapchain_image_handles[i]; |
| 2327 | } |
| 2328 | } |
| 2329 | } |
| 2330 | return result; |
| 2331 | } |
| 2332 | |
| 2333 | void DispatchDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator) { |
| 2334 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2335 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator); |
| 2336 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 2337 | |
| 2338 | auto &image_array = layer_data->swapchain_wrapped_image_handle_map[swapchain]; |
| 2339 | for (auto &image_handle : image_array) { |
| 2340 | unique_id_mapping.erase(HandleToUint64(image_handle)); |
| 2341 | } |
| 2342 | layer_data->swapchain_wrapped_image_handle_map.erase(swapchain); |
| 2343 | |
| 2344 | uint64_t swapchain_id = HandleToUint64(swapchain); |
| 2345 | swapchain = (VkSwapchainKHR)unique_id_mapping[swapchain_id]; |
| 2346 | unique_id_mapping.erase(swapchain_id); |
| 2347 | lock.unlock(); |
| 2348 | layer_data->device_dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator); |
| 2349 | } |
| 2350 | |
| 2351 | VkResult DispatchQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) { |
| 2352 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 2353 | if (!wrap_handles) return layer_data->device_dispatch_table.QueuePresentKHR(queue, pPresentInfo); |
| 2354 | safe_VkPresentInfoKHR *local_pPresentInfo = NULL; |
| 2355 | { |
| 2356 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2357 | if (pPresentInfo) { |
| 2358 | local_pPresentInfo = new safe_VkPresentInfoKHR(pPresentInfo); |
| 2359 | if (local_pPresentInfo->pWaitSemaphores) { |
| 2360 | for (uint32_t index1 = 0; index1 < local_pPresentInfo->waitSemaphoreCount; ++index1) { |
| 2361 | local_pPresentInfo->pWaitSemaphores[index1] = layer_data->Unwrap(pPresentInfo->pWaitSemaphores[index1]); |
| 2362 | } |
| 2363 | } |
| 2364 | if (local_pPresentInfo->pSwapchains) { |
| 2365 | for (uint32_t index1 = 0; index1 < local_pPresentInfo->swapchainCount; ++index1) { |
| 2366 | local_pPresentInfo->pSwapchains[index1] = layer_data->Unwrap(pPresentInfo->pSwapchains[index1]); |
| 2367 | } |
| 2368 | } |
| 2369 | } |
| 2370 | } |
| 2371 | VkResult result = layer_data->device_dispatch_table.QueuePresentKHR(queue, local_pPresentInfo->ptr()); |
| 2372 | |
| 2373 | // pResults is an output array embedded in a structure. The code generator neglects to copy back from the safe_* version, |
| 2374 | // so handle it as a special case here: |
| 2375 | if (pPresentInfo && pPresentInfo->pResults) { |
| 2376 | for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) { |
| 2377 | pPresentInfo->pResults[i] = local_pPresentInfo->pResults[i]; |
| 2378 | } |
| 2379 | } |
| 2380 | delete local_pPresentInfo; |
| 2381 | return result; |
| 2382 | } |
| 2383 | |
| 2384 | void DispatchDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator) { |
| 2385 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2386 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyDescriptorPool(device, descriptorPool, pAllocator); |
| 2387 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 2388 | |
| 2389 | // remove references to implicitly freed descriptor sets |
| 2390 | for(auto descriptor_set : layer_data->pool_descriptor_sets_map[descriptorPool]) { |
| 2391 | unique_id_mapping.erase(reinterpret_cast<uint64_t &>(descriptor_set)); |
| 2392 | } |
| 2393 | layer_data->pool_descriptor_sets_map.erase(descriptorPool); |
| 2394 | |
| 2395 | uint64_t descriptorPool_id = reinterpret_cast<uint64_t &>(descriptorPool); |
| 2396 | descriptorPool = (VkDescriptorPool)unique_id_mapping[descriptorPool_id]; |
| 2397 | unique_id_mapping.erase(descriptorPool_id); |
| 2398 | lock.unlock(); |
| 2399 | layer_data->device_dispatch_table.DestroyDescriptorPool(device, descriptorPool, pAllocator); |
| 2400 | } |
| 2401 | |
| 2402 | VkResult DispatchResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) { |
| 2403 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2404 | if (!wrap_handles) return layer_data->device_dispatch_table.ResetDescriptorPool(device, descriptorPool, flags); |
| 2405 | VkDescriptorPool local_descriptor_pool = VK_NULL_HANDLE; |
| 2406 | { |
| 2407 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2408 | local_descriptor_pool = layer_data->Unwrap(descriptorPool); |
| 2409 | } |
| 2410 | VkResult result = layer_data->device_dispatch_table.ResetDescriptorPool(device, local_descriptor_pool, flags); |
| 2411 | if (VK_SUCCESS == result) { |
| 2412 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2413 | // remove references to implicitly freed descriptor sets |
| 2414 | for(auto descriptor_set : layer_data->pool_descriptor_sets_map[descriptorPool]) { |
| 2415 | unique_id_mapping.erase(reinterpret_cast<uint64_t &>(descriptor_set)); |
| 2416 | } |
| 2417 | layer_data->pool_descriptor_sets_map[descriptorPool].clear(); |
| 2418 | } |
| 2419 | |
| 2420 | return result; |
| 2421 | } |
| 2422 | |
| 2423 | VkResult DispatchAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, |
| 2424 | VkDescriptorSet *pDescriptorSets) { |
| 2425 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2426 | if (!wrap_handles) return layer_data->device_dispatch_table.AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); |
| 2427 | safe_VkDescriptorSetAllocateInfo *local_pAllocateInfo = NULL; |
| 2428 | { |
| 2429 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2430 | if (pAllocateInfo) { |
| 2431 | local_pAllocateInfo = new safe_VkDescriptorSetAllocateInfo(pAllocateInfo); |
| 2432 | if (pAllocateInfo->descriptorPool) { |
| 2433 | local_pAllocateInfo->descriptorPool = layer_data->Unwrap(pAllocateInfo->descriptorPool); |
| 2434 | } |
| 2435 | if (local_pAllocateInfo->pSetLayouts) { |
| 2436 | for (uint32_t index1 = 0; index1 < local_pAllocateInfo->descriptorSetCount; ++index1) { |
| 2437 | local_pAllocateInfo->pSetLayouts[index1] = layer_data->Unwrap(local_pAllocateInfo->pSetLayouts[index1]); |
| 2438 | } |
| 2439 | } |
| 2440 | } |
| 2441 | } |
| 2442 | VkResult result = layer_data->device_dispatch_table.AllocateDescriptorSets( |
| 2443 | device, (const VkDescriptorSetAllocateInfo *)local_pAllocateInfo, pDescriptorSets); |
| 2444 | if (local_pAllocateInfo) { |
| 2445 | delete local_pAllocateInfo; |
| 2446 | } |
| 2447 | if (VK_SUCCESS == result) { |
| 2448 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2449 | auto &pool_descriptor_sets = layer_data->pool_descriptor_sets_map[pAllocateInfo->descriptorPool]; |
| 2450 | for (uint32_t index0 = 0; index0 < pAllocateInfo->descriptorSetCount; index0++) { |
| 2451 | pDescriptorSets[index0] = layer_data->WrapNew(pDescriptorSets[index0]); |
| 2452 | pool_descriptor_sets.insert(pDescriptorSets[index0]); |
| 2453 | } |
| 2454 | } |
| 2455 | return result; |
| 2456 | } |
| 2457 | |
| 2458 | VkResult DispatchFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, |
| 2459 | const VkDescriptorSet *pDescriptorSets) { |
| 2460 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2461 | if (!wrap_handles) |
| 2462 | return layer_data->device_dispatch_table.FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets); |
| 2463 | VkDescriptorSet *local_pDescriptorSets = NULL; |
| 2464 | VkDescriptorPool local_descriptor_pool = VK_NULL_HANDLE; |
| 2465 | { |
| 2466 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2467 | local_descriptor_pool = layer_data->Unwrap(descriptorPool); |
| 2468 | if (pDescriptorSets) { |
| 2469 | local_pDescriptorSets = new VkDescriptorSet[descriptorSetCount]; |
| 2470 | for (uint32_t index0 = 0; index0 < descriptorSetCount; ++index0) { |
| 2471 | local_pDescriptorSets[index0] = layer_data->Unwrap(pDescriptorSets[index0]); |
| 2472 | } |
| 2473 | } |
| 2474 | } |
| 2475 | VkResult result = layer_data->device_dispatch_table.FreeDescriptorSets(device, local_descriptor_pool, descriptorSetCount, |
| 2476 | (const VkDescriptorSet *)local_pDescriptorSets); |
| 2477 | if (local_pDescriptorSets) delete[] local_pDescriptorSets; |
| 2478 | if ((VK_SUCCESS == result) && (pDescriptorSets)) { |
| 2479 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 2480 | auto &pool_descriptor_sets = layer_data->pool_descriptor_sets_map[descriptorPool]; |
| 2481 | for (uint32_t index0 = 0; index0 < descriptorSetCount; index0++) { |
| 2482 | VkDescriptorSet handle = pDescriptorSets[index0]; |
| 2483 | pool_descriptor_sets.erase(handle); |
| 2484 | uint64_t unique_id = reinterpret_cast<uint64_t &>(handle); |
| 2485 | unique_id_mapping.erase(unique_id); |
| 2486 | } |
| 2487 | } |
| 2488 | return result; |
| 2489 | } |
| 2490 | |
| 2491 | // This is the core version of this routine. The extension version is below. |
| 2492 | VkResult DispatchCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, |
| 2493 | const VkAllocationCallbacks *pAllocator, |
| 2494 | VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { |
| 2495 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2496 | if (!wrap_handles) |
| 2497 | return layer_data->device_dispatch_table.CreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, |
| 2498 | pDescriptorUpdateTemplate); |
| 2499 | safe_VkDescriptorUpdateTemplateCreateInfo *local_create_info = NULL; |
| 2500 | { |
| 2501 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2502 | if (pCreateInfo) { |
| 2503 | local_create_info = new safe_VkDescriptorUpdateTemplateCreateInfo(pCreateInfo); |
| 2504 | if (pCreateInfo->descriptorSetLayout) { |
| 2505 | local_create_info->descriptorSetLayout = layer_data->Unwrap(pCreateInfo->descriptorSetLayout); |
| 2506 | } |
| 2507 | if (pCreateInfo->pipelineLayout) { |
| 2508 | local_create_info->pipelineLayout = layer_data->Unwrap(pCreateInfo->pipelineLayout); |
| 2509 | } |
| 2510 | } |
| 2511 | } |
| 2512 | VkResult result = layer_data->device_dispatch_table.CreateDescriptorUpdateTemplate(device, local_create_info->ptr(), pAllocator, |
| 2513 | pDescriptorUpdateTemplate); |
| 2514 | if (VK_SUCCESS == result) { |
| 2515 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2516 | *pDescriptorUpdateTemplate = layer_data->WrapNew(*pDescriptorUpdateTemplate); |
| 2517 | |
| 2518 | // Shadow template createInfo for later updates |
| 2519 | std::unique_ptr<TEMPLATE_STATE> template_state(new TEMPLATE_STATE(*pDescriptorUpdateTemplate, local_create_info)); |
| 2520 | layer_data->desc_template_createinfo_map[(uint64_t)*pDescriptorUpdateTemplate] = std::move(template_state); |
| 2521 | } |
| 2522 | return result; |
| 2523 | } |
| 2524 | |
| 2525 | // This is the extension version of this routine. The core version is above. |
| 2526 | VkResult DispatchCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, |
| 2527 | const VkAllocationCallbacks *pAllocator, |
| 2528 | VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { |
| 2529 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2530 | if (!wrap_handles) |
| 2531 | return layer_data->device_dispatch_table.CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, |
| 2532 | pDescriptorUpdateTemplate); |
| 2533 | safe_VkDescriptorUpdateTemplateCreateInfo *local_create_info = NULL; |
| 2534 | { |
| 2535 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2536 | if (pCreateInfo) { |
| 2537 | local_create_info = new safe_VkDescriptorUpdateTemplateCreateInfo(pCreateInfo); |
| 2538 | if (pCreateInfo->descriptorSetLayout) { |
| 2539 | local_create_info->descriptorSetLayout = layer_data->Unwrap(pCreateInfo->descriptorSetLayout); |
| 2540 | } |
| 2541 | if (pCreateInfo->pipelineLayout) { |
| 2542 | local_create_info->pipelineLayout = layer_data->Unwrap(pCreateInfo->pipelineLayout); |
| 2543 | } |
| 2544 | } |
| 2545 | } |
| 2546 | VkResult result = layer_data->device_dispatch_table.CreateDescriptorUpdateTemplateKHR(device, local_create_info->ptr(), pAllocator, |
| 2547 | pDescriptorUpdateTemplate); |
| 2548 | if (VK_SUCCESS == result) { |
| 2549 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2550 | *pDescriptorUpdateTemplate = layer_data->WrapNew(*pDescriptorUpdateTemplate); |
| 2551 | |
| 2552 | // Shadow template createInfo for later updates |
| 2553 | std::unique_ptr<TEMPLATE_STATE> template_state(new TEMPLATE_STATE(*pDescriptorUpdateTemplate, local_create_info)); |
| 2554 | layer_data->desc_template_createinfo_map[(uint64_t)*pDescriptorUpdateTemplate] = std::move(template_state); |
| 2555 | } |
| 2556 | return result; |
| 2557 | } |
| 2558 | |
| 2559 | // This is the core version of this routine. The extension version is below. |
| 2560 | void DispatchDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 2561 | const VkAllocationCallbacks *pAllocator) { |
| 2562 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2563 | if (!wrap_handles) |
| 2564 | return layer_data->device_dispatch_table.DestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator); |
| 2565 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 2566 | uint64_t descriptor_update_template_id = reinterpret_cast<uint64_t &>(descriptorUpdateTemplate); |
| 2567 | layer_data->desc_template_createinfo_map.erase(descriptor_update_template_id); |
| 2568 | descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[descriptor_update_template_id]; |
| 2569 | unique_id_mapping.erase(descriptor_update_template_id); |
| 2570 | lock.unlock(); |
| 2571 | layer_data->device_dispatch_table.DestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator); |
| 2572 | } |
| 2573 | |
| 2574 | // This is the extension version of this routine. The core version is above. |
| 2575 | void DispatchDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 2576 | const VkAllocationCallbacks *pAllocator) { |
| 2577 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2578 | if (!wrap_handles) |
| 2579 | return layer_data->device_dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); |
| 2580 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 2581 | uint64_t descriptor_update_template_id = reinterpret_cast<uint64_t &>(descriptorUpdateTemplate); |
| 2582 | layer_data->desc_template_createinfo_map.erase(descriptor_update_template_id); |
| 2583 | descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[descriptor_update_template_id]; |
| 2584 | unique_id_mapping.erase(descriptor_update_template_id); |
| 2585 | lock.unlock(); |
| 2586 | layer_data->device_dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); |
| 2587 | } |
| 2588 | |
| 2589 | void *BuildUnwrappedUpdateTemplateBuffer(ValidationObject *layer_data, uint64_t descriptorUpdateTemplate, const void *pData) { |
| 2590 | auto const template_map_entry = layer_data->desc_template_createinfo_map.find(descriptorUpdateTemplate); |
| 2591 | if (template_map_entry == layer_data->desc_template_createinfo_map.end()) { |
| 2592 | assert(0); |
| 2593 | } |
| 2594 | auto const &create_info = template_map_entry->second->create_info; |
| 2595 | size_t allocation_size = 0; |
| 2596 | std::vector<std::tuple<size_t, VulkanObjectType, uint64_t, size_t>> template_entries; |
| 2597 | |
| 2598 | for (uint32_t i = 0; i < create_info.descriptorUpdateEntryCount; i++) { |
| 2599 | for (uint32_t j = 0; j < create_info.pDescriptorUpdateEntries[i].descriptorCount; j++) { |
| 2600 | size_t offset = create_info.pDescriptorUpdateEntries[i].offset + j * create_info.pDescriptorUpdateEntries[i].stride; |
| 2601 | char *update_entry = (char *)(pData) + offset; |
| 2602 | |
| 2603 | switch (create_info.pDescriptorUpdateEntries[i].descriptorType) { |
| 2604 | case VK_DESCRIPTOR_TYPE_SAMPLER: |
| 2605 | case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: |
| 2606 | case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: |
| 2607 | case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: |
| 2608 | case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: { |
| 2609 | auto image_entry = reinterpret_cast<VkDescriptorImageInfo *>(update_entry); |
| 2610 | allocation_size = std::max(allocation_size, offset + sizeof(VkDescriptorImageInfo)); |
| 2611 | |
| 2612 | VkDescriptorImageInfo *wrapped_entry = new VkDescriptorImageInfo(*image_entry); |
| 2613 | wrapped_entry->sampler = layer_data->Unwrap(image_entry->sampler); |
| 2614 | wrapped_entry->imageView = layer_data->Unwrap(image_entry->imageView); |
| 2615 | template_entries.emplace_back(offset, kVulkanObjectTypeImage, CastToUint64(wrapped_entry), 0); |
| 2616 | } break; |
| 2617 | |
| 2618 | case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: |
| 2619 | case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: |
| 2620 | case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: |
| 2621 | case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: { |
| 2622 | auto buffer_entry = reinterpret_cast<VkDescriptorBufferInfo *>(update_entry); |
| 2623 | allocation_size = std::max(allocation_size, offset + sizeof(VkDescriptorBufferInfo)); |
| 2624 | |
| 2625 | VkDescriptorBufferInfo *wrapped_entry = new VkDescriptorBufferInfo(*buffer_entry); |
| 2626 | wrapped_entry->buffer = layer_data->Unwrap(buffer_entry->buffer); |
| 2627 | template_entries.emplace_back(offset, kVulkanObjectTypeBuffer, CastToUint64(wrapped_entry), 0); |
| 2628 | } break; |
| 2629 | |
| 2630 | case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: |
| 2631 | case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: { |
| 2632 | auto buffer_view_handle = reinterpret_cast<VkBufferView *>(update_entry); |
| 2633 | allocation_size = std::max(allocation_size, offset + sizeof(VkBufferView)); |
| 2634 | |
| 2635 | VkBufferView wrapped_entry = layer_data->Unwrap(*buffer_view_handle); |
| 2636 | template_entries.emplace_back(offset, kVulkanObjectTypeBufferView, CastToUint64(wrapped_entry), 0); |
| 2637 | } break; |
| 2638 | case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT: { |
| 2639 | size_t numBytes = create_info.pDescriptorUpdateEntries[i].descriptorCount; |
| 2640 | allocation_size = std::max(allocation_size, offset + numBytes); |
| 2641 | // nothing to unwrap, just plain data |
| 2642 | template_entries.emplace_back(offset, kVulkanObjectTypeUnknown, CastToUint64(update_entry), |
| 2643 | numBytes); |
| 2644 | // to break out of the loop |
| 2645 | j = create_info.pDescriptorUpdateEntries[i].descriptorCount; |
| 2646 | } break; |
| 2647 | default: |
| 2648 | assert(0); |
| 2649 | break; |
| 2650 | } |
| 2651 | } |
| 2652 | } |
| 2653 | // Allocate required buffer size and populate with source/unwrapped data |
| 2654 | void *unwrapped_data = malloc(allocation_size); |
| 2655 | for (auto &this_entry : template_entries) { |
| 2656 | VulkanObjectType type = std::get<1>(this_entry); |
| 2657 | void *destination = (char *)unwrapped_data + std::get<0>(this_entry); |
| 2658 | uint64_t source = std::get<2>(this_entry); |
| 2659 | size_t size = std::get<3>(this_entry); |
| 2660 | |
| 2661 | if (size != 0) { |
| 2662 | assert(type == kVulkanObjectTypeUnknown); |
| 2663 | memcpy(destination, CastFromUint64<void *>(source), size); |
| 2664 | } else { |
| 2665 | switch (type) { |
| 2666 | case kVulkanObjectTypeImage: |
| 2667 | *(reinterpret_cast<VkDescriptorImageInfo *>(destination)) = |
| 2668 | *(reinterpret_cast<VkDescriptorImageInfo *>(source)); |
| 2669 | delete CastFromUint64<VkDescriptorImageInfo *>(source); |
| 2670 | break; |
| 2671 | case kVulkanObjectTypeBuffer: |
| 2672 | *(reinterpret_cast<VkDescriptorBufferInfo *>(destination)) = |
| 2673 | *(CastFromUint64<VkDescriptorBufferInfo *>(source)); |
| 2674 | delete CastFromUint64<VkDescriptorBufferInfo *>(source); |
| 2675 | break; |
| 2676 | case kVulkanObjectTypeBufferView: |
| 2677 | *(reinterpret_cast<VkBufferView *>(destination)) = CastFromUint64<VkBufferView>(source); |
| 2678 | break; |
| 2679 | default: |
| 2680 | assert(0); |
| 2681 | break; |
| 2682 | } |
| 2683 | } |
| 2684 | } |
| 2685 | return (void *)unwrapped_data; |
| 2686 | } |
| 2687 | |
| 2688 | void DispatchUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, |
| 2689 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void *pData) { |
| 2690 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2691 | if (!wrap_handles) |
| 2692 | return layer_data->device_dispatch_table.UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, |
| 2693 | pData); |
| 2694 | uint64_t template_handle = reinterpret_cast<uint64_t &>(descriptorUpdateTemplate); |
| 2695 | { |
| 2696 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2697 | descriptorSet = layer_data->Unwrap(descriptorSet); |
| 2698 | descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[template_handle]; |
| 2699 | } |
| 2700 | void *unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(layer_data, template_handle, pData); |
| 2701 | layer_data->device_dispatch_table.UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, unwrapped_buffer); |
| 2702 | free(unwrapped_buffer); |
| 2703 | } |
| 2704 | |
| 2705 | void DispatchUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, |
| 2706 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void *pData) { |
| 2707 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2708 | if (!wrap_handles) |
| 2709 | return layer_data->device_dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, |
| 2710 | pData); |
| 2711 | uint64_t template_handle = reinterpret_cast<uint64_t &>(descriptorUpdateTemplate); |
| 2712 | void *unwrapped_buffer = nullptr; |
| 2713 | { |
| 2714 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2715 | descriptorSet = layer_data->Unwrap(descriptorSet); |
| 2716 | descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[template_handle]; |
| 2717 | unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(layer_data, template_handle, pData); |
| 2718 | } |
| 2719 | layer_data->device_dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, unwrapped_buffer); |
| 2720 | free(unwrapped_buffer); |
| 2721 | } |
| 2722 | |
| 2723 | void DispatchCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, |
| 2724 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, |
| 2725 | uint32_t set, const void *pData) { |
| 2726 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 2727 | if (!wrap_handles) |
| 2728 | return layer_data->device_dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, |
| 2729 | layout, set, pData); |
| 2730 | uint64_t template_handle = reinterpret_cast<uint64_t &>(descriptorUpdateTemplate); |
| 2731 | void *unwrapped_buffer = nullptr; |
| 2732 | { |
| 2733 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2734 | descriptorUpdateTemplate = layer_data->Unwrap(descriptorUpdateTemplate); |
| 2735 | layout = layer_data->Unwrap(layout); |
| 2736 | unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(layer_data, template_handle, pData); |
| 2737 | } |
| 2738 | layer_data->device_dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, |
| 2739 | unwrapped_buffer); |
| 2740 | free(unwrapped_buffer); |
| 2741 | } |
| 2742 | |
| 2743 | VkResult DispatchGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 2744 | VkDisplayPropertiesKHR *pProperties) { |
| 2745 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2746 | VkResult result = |
| 2747 | layer_data->instance_dispatch_table.GetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties); |
| 2748 | if (!wrap_handles) return result; |
| 2749 | if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pProperties) { |
| 2750 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2751 | for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { |
| 2752 | pProperties[idx0].display = layer_data->MaybeWrapDisplay(pProperties[idx0].display, layer_data); |
| 2753 | } |
| 2754 | } |
| 2755 | return result; |
| 2756 | } |
| 2757 | |
| 2758 | VkResult DispatchGetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 2759 | VkDisplayProperties2KHR *pProperties) { |
| 2760 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2761 | VkResult result = |
| 2762 | layer_data->instance_dispatch_table.GetPhysicalDeviceDisplayProperties2KHR(physicalDevice, pPropertyCount, pProperties); |
| 2763 | if (!wrap_handles) return result; |
| 2764 | if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pProperties) { |
| 2765 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2766 | for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { |
| 2767 | pProperties[idx0].displayProperties.display = |
| 2768 | layer_data->MaybeWrapDisplay(pProperties[idx0].displayProperties.display, layer_data); |
| 2769 | } |
| 2770 | } |
| 2771 | return result; |
| 2772 | } |
| 2773 | |
| 2774 | VkResult DispatchGetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 2775 | VkDisplayPlanePropertiesKHR *pProperties) { |
| 2776 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2777 | VkResult result = |
| 2778 | layer_data->instance_dispatch_table.GetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties); |
| 2779 | if (!wrap_handles) return result; |
| 2780 | if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pProperties) { |
| 2781 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2782 | for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { |
| 2783 | VkDisplayKHR &opt_display = pProperties[idx0].currentDisplay; |
| 2784 | if (opt_display) opt_display = layer_data->MaybeWrapDisplay(opt_display, layer_data); |
| 2785 | } |
| 2786 | } |
| 2787 | return result; |
| 2788 | } |
| 2789 | |
| 2790 | VkResult DispatchGetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 2791 | VkDisplayPlaneProperties2KHR *pProperties) { |
| 2792 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2793 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceDisplayPlaneProperties2KHR(physicalDevice, |
| 2794 | pPropertyCount, pProperties); |
| 2795 | if (!wrap_handles) return result; |
| 2796 | if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pProperties) { |
| 2797 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2798 | for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { |
| 2799 | VkDisplayKHR &opt_display = pProperties[idx0].displayPlaneProperties.currentDisplay; |
| 2800 | if (opt_display) opt_display = layer_data->MaybeWrapDisplay(opt_display, layer_data); |
| 2801 | } |
| 2802 | } |
| 2803 | return result; |
| 2804 | } |
| 2805 | |
| 2806 | VkResult DispatchGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t *pDisplayCount, |
| 2807 | VkDisplayKHR *pDisplays) { |
| 2808 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2809 | VkResult result = layer_data->instance_dispatch_table.GetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, |
| 2810 | pDisplayCount, pDisplays); |
| 2811 | if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pDisplays) { |
| 2812 | if (!wrap_handles) return result; |
| 2813 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2814 | for (uint32_t i = 0; i < *pDisplayCount; ++i) { |
| 2815 | if (pDisplays[i]) pDisplays[i] = layer_data->MaybeWrapDisplay(pDisplays[i], layer_data); |
| 2816 | } |
| 2817 | } |
| 2818 | return result; |
| 2819 | } |
| 2820 | |
| 2821 | VkResult DispatchGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t *pPropertyCount, |
| 2822 | VkDisplayModePropertiesKHR *pProperties) { |
| 2823 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2824 | if (!wrap_handles) |
| 2825 | return layer_data->instance_dispatch_table.GetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, |
| 2826 | pProperties); |
| 2827 | { |
| 2828 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2829 | display = layer_data->Unwrap(display); |
| 2830 | } |
| 2831 | |
| 2832 | VkResult result = layer_data->instance_dispatch_table.GetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties); |
| 2833 | if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pProperties) { |
| 2834 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2835 | for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { |
| 2836 | pProperties[idx0].displayMode = layer_data->WrapNew(pProperties[idx0].displayMode); |
| 2837 | } |
| 2838 | } |
| 2839 | return result; |
| 2840 | } |
| 2841 | |
| 2842 | VkResult DispatchGetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t *pPropertyCount, |
| 2843 | VkDisplayModeProperties2KHR *pProperties) { |
| 2844 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2845 | if (!wrap_handles) |
| 2846 | return layer_data->instance_dispatch_table.GetDisplayModeProperties2KHR(physicalDevice, display, pPropertyCount, |
| 2847 | pProperties); |
| 2848 | { |
| 2849 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2850 | display = layer_data->Unwrap(display); |
| 2851 | } |
| 2852 | |
| 2853 | VkResult result = |
| 2854 | layer_data->instance_dispatch_table.GetDisplayModeProperties2KHR(physicalDevice, display, pPropertyCount, pProperties); |
| 2855 | if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pProperties) { |
| 2856 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2857 | for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { |
| 2858 | pProperties[idx0].displayModeProperties.displayMode = layer_data->WrapNew(pProperties[idx0].displayModeProperties.displayMode); |
| 2859 | } |
| 2860 | } |
| 2861 | return result; |
| 2862 | } |
| 2863 | |
| 2864 | VkResult DispatchDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo) { |
| 2865 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2866 | if (!wrap_handles) return layer_data->device_dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo); |
| 2867 | safe_VkDebugMarkerObjectTagInfoEXT local_tag_info(pTagInfo); |
| 2868 | { |
| 2869 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2870 | auto it = unique_id_mapping.find(reinterpret_cast<uint64_t &>(local_tag_info.object)); |
| 2871 | if (it != unique_id_mapping.end()) { |
| 2872 | local_tag_info.object = it->second; |
| 2873 | } |
| 2874 | } |
| 2875 | VkResult result = layer_data->device_dispatch_table.DebugMarkerSetObjectTagEXT(device, |
| 2876 | reinterpret_cast<VkDebugMarkerObjectTagInfoEXT *>(&local_tag_info)); |
| 2877 | return result; |
| 2878 | } |
| 2879 | |
| 2880 | VkResult DispatchDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo) { |
| 2881 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2882 | if (!wrap_handles) return layer_data->device_dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo); |
| 2883 | safe_VkDebugMarkerObjectNameInfoEXT local_name_info(pNameInfo); |
| 2884 | { |
| 2885 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2886 | auto it = unique_id_mapping.find(reinterpret_cast<uint64_t &>(local_name_info.object)); |
| 2887 | if (it != unique_id_mapping.end()) { |
| 2888 | local_name_info.object = it->second; |
| 2889 | } |
| 2890 | } |
| 2891 | VkResult result = layer_data->device_dispatch_table.DebugMarkerSetObjectNameEXT( |
| 2892 | device, reinterpret_cast<VkDebugMarkerObjectNameInfoEXT *>(&local_name_info)); |
| 2893 | return result; |
| 2894 | } |
| 2895 | |
| 2896 | // VK_EXT_debug_utils |
| 2897 | VkResult DispatchSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) { |
| 2898 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2899 | if (!wrap_handles) return layer_data->device_dispatch_table.SetDebugUtilsObjectTagEXT(device, pTagInfo); |
| 2900 | safe_VkDebugUtilsObjectTagInfoEXT local_tag_info(pTagInfo); |
| 2901 | { |
| 2902 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2903 | auto it = unique_id_mapping.find(reinterpret_cast<uint64_t &>(local_tag_info.objectHandle)); |
| 2904 | if (it != unique_id_mapping.end()) { |
| 2905 | local_tag_info.objectHandle = it->second; |
| 2906 | } |
| 2907 | } |
| 2908 | VkResult result = layer_data->device_dispatch_table.SetDebugUtilsObjectTagEXT( |
| 2909 | device, reinterpret_cast<const VkDebugUtilsObjectTagInfoEXT *>(&local_tag_info)); |
| 2910 | return result; |
| 2911 | } |
| 2912 | |
| 2913 | VkResult DispatchSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) { |
| 2914 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 2915 | if (!wrap_handles) return layer_data->device_dispatch_table.SetDebugUtilsObjectNameEXT(device, pNameInfo); |
| 2916 | safe_VkDebugUtilsObjectNameInfoEXT local_name_info(pNameInfo); |
| 2917 | { |
| 2918 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 2919 | auto it = unique_id_mapping.find(reinterpret_cast<uint64_t &>(local_name_info.objectHandle)); |
| 2920 | if (it != unique_id_mapping.end()) { |
| 2921 | local_name_info.objectHandle = it->second; |
| 2922 | } |
| 2923 | } |
| 2924 | VkResult result = layer_data->device_dispatch_table.SetDebugUtilsObjectNameEXT( |
| 2925 | device, reinterpret_cast<const VkDebugUtilsObjectNameInfoEXT *>(&local_name_info)); |
| 2926 | return result; |
| 2927 | } |
| 2928 | |
| 2929 | |
| 2930 | |
| 2931 | |
| 2932 | // Skip vkCreateInstance dispatch, manually generated |
| 2933 | |
| 2934 | // Skip vkDestroyInstance dispatch, manually generated |
| 2935 | |
| 2936 | VkResult DispatchEnumeratePhysicalDevices( |
| 2937 | VkInstance instance, |
| 2938 | uint32_t* pPhysicalDeviceCount, |
| 2939 | VkPhysicalDevice* pPhysicalDevices) |
| 2940 | { |
| 2941 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 2942 | VkResult result = layer_data->instance_dispatch_table.EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 2943 | |
| 2944 | return result; |
| 2945 | } |
| 2946 | |
| 2947 | void DispatchGetPhysicalDeviceFeatures( |
| 2948 | VkPhysicalDevice physicalDevice, |
| 2949 | VkPhysicalDeviceFeatures* pFeatures) |
| 2950 | { |
| 2951 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2952 | layer_data->instance_dispatch_table.GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
| 2953 | |
| 2954 | } |
| 2955 | |
| 2956 | void DispatchGetPhysicalDeviceFormatProperties( |
| 2957 | VkPhysicalDevice physicalDevice, |
| 2958 | VkFormat format, |
| 2959 | VkFormatProperties* pFormatProperties) |
| 2960 | { |
| 2961 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2962 | layer_data->instance_dispatch_table.GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties); |
| 2963 | |
| 2964 | } |
| 2965 | |
| 2966 | VkResult DispatchGetPhysicalDeviceImageFormatProperties( |
| 2967 | VkPhysicalDevice physicalDevice, |
| 2968 | VkFormat format, |
| 2969 | VkImageType type, |
| 2970 | VkImageTiling tiling, |
| 2971 | VkImageUsageFlags usage, |
| 2972 | VkImageCreateFlags flags, |
| 2973 | VkImageFormatProperties* pImageFormatProperties) |
| 2974 | { |
| 2975 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2976 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties); |
| 2977 | |
| 2978 | return result; |
| 2979 | } |
| 2980 | |
| 2981 | void DispatchGetPhysicalDeviceProperties( |
| 2982 | VkPhysicalDevice physicalDevice, |
| 2983 | VkPhysicalDeviceProperties* pProperties) |
| 2984 | { |
| 2985 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2986 | layer_data->instance_dispatch_table.GetPhysicalDeviceProperties(physicalDevice, pProperties); |
| 2987 | |
| 2988 | } |
| 2989 | |
| 2990 | void DispatchGetPhysicalDeviceQueueFamilyProperties( |
| 2991 | VkPhysicalDevice physicalDevice, |
| 2992 | uint32_t* pQueueFamilyPropertyCount, |
| 2993 | VkQueueFamilyProperties* pQueueFamilyProperties) |
| 2994 | { |
| 2995 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2996 | layer_data->instance_dispatch_table.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
| 2997 | |
| 2998 | } |
| 2999 | |
| 3000 | void DispatchGetPhysicalDeviceMemoryProperties( |
| 3001 | VkPhysicalDevice physicalDevice, |
| 3002 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 3003 | { |
| 3004 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 3005 | layer_data->instance_dispatch_table.GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
| 3006 | |
| 3007 | } |
| 3008 | |
| 3009 | PFN_vkVoidFunction DispatchGetInstanceProcAddr( |
| 3010 | VkInstance instance, |
| 3011 | const char* pName) |
| 3012 | { |
| 3013 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 3014 | PFN_vkVoidFunction result = layer_data->instance_dispatch_table.GetInstanceProcAddr(instance, pName); |
| 3015 | |
| 3016 | return result; |
| 3017 | } |
| 3018 | |
| 3019 | PFN_vkVoidFunction DispatchGetDeviceProcAddr( |
| 3020 | VkDevice device, |
| 3021 | const char* pName) |
| 3022 | { |
| 3023 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3024 | PFN_vkVoidFunction result = layer_data->device_dispatch_table.GetDeviceProcAddr(device, pName); |
| 3025 | |
| 3026 | return result; |
| 3027 | } |
| 3028 | |
| 3029 | // Skip vkCreateDevice dispatch, manually generated |
| 3030 | |
| 3031 | // Skip vkDestroyDevice dispatch, manually generated |
| 3032 | |
| 3033 | // Skip vkEnumerateInstanceExtensionProperties dispatch, manually generated |
| 3034 | |
| 3035 | // Skip vkEnumerateDeviceExtensionProperties dispatch, manually generated |
| 3036 | |
| 3037 | // Skip vkEnumerateInstanceLayerProperties dispatch, manually generated |
| 3038 | |
| 3039 | // Skip vkEnumerateDeviceLayerProperties dispatch, manually generated |
| 3040 | |
| 3041 | void DispatchGetDeviceQueue( |
| 3042 | VkDevice device, |
| 3043 | uint32_t queueFamilyIndex, |
| 3044 | uint32_t queueIndex, |
| 3045 | VkQueue* pQueue) |
| 3046 | { |
| 3047 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3048 | layer_data->device_dispatch_table.GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); |
| 3049 | |
| 3050 | } |
| 3051 | |
| 3052 | VkResult DispatchQueueSubmit( |
| 3053 | VkQueue queue, |
| 3054 | uint32_t submitCount, |
| 3055 | const VkSubmitInfo* pSubmits, |
| 3056 | VkFence fence) |
| 3057 | { |
| 3058 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 3059 | if (!wrap_handles) return layer_data->device_dispatch_table.QueueSubmit(queue, submitCount, pSubmits, fence); |
| 3060 | safe_VkSubmitInfo *local_pSubmits = NULL; |
| 3061 | { |
| 3062 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3063 | if (pSubmits) { |
| 3064 | local_pSubmits = new safe_VkSubmitInfo[submitCount]; |
| 3065 | for (uint32_t index0 = 0; index0 < submitCount; ++index0) { |
| 3066 | local_pSubmits[index0].initialize(&pSubmits[index0]); |
| 3067 | local_pSubmits[index0].pNext = CreateUnwrappedExtensionStructs(layer_data, local_pSubmits[index0].pNext); |
| 3068 | if (local_pSubmits[index0].pWaitSemaphores) { |
| 3069 | for (uint32_t index1 = 0; index1 < local_pSubmits[index0].waitSemaphoreCount; ++index1) { |
| 3070 | local_pSubmits[index0].pWaitSemaphores[index1] = layer_data->Unwrap(local_pSubmits[index0].pWaitSemaphores[index1]); |
| 3071 | } |
| 3072 | } |
| 3073 | if (local_pSubmits[index0].pSignalSemaphores) { |
| 3074 | for (uint32_t index1 = 0; index1 < local_pSubmits[index0].signalSemaphoreCount; ++index1) { |
| 3075 | local_pSubmits[index0].pSignalSemaphores[index1] = layer_data->Unwrap(local_pSubmits[index0].pSignalSemaphores[index1]); |
| 3076 | } |
| 3077 | } |
| 3078 | } |
| 3079 | } |
| 3080 | fence = layer_data->Unwrap(fence); |
| 3081 | } |
| 3082 | VkResult result = layer_data->device_dispatch_table.QueueSubmit(queue, submitCount, (const VkSubmitInfo*)local_pSubmits, fence); |
| 3083 | if (local_pSubmits) { |
| 3084 | for (uint32_t index0 = 0; index0 < submitCount; ++index0) { |
| 3085 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pSubmits[index0].pNext)); |
| 3086 | } |
| 3087 | delete[] local_pSubmits; |
| 3088 | } |
| 3089 | return result; |
| 3090 | } |
| 3091 | |
| 3092 | VkResult DispatchQueueWaitIdle( |
| 3093 | VkQueue queue) |
| 3094 | { |
| 3095 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 3096 | VkResult result = layer_data->device_dispatch_table.QueueWaitIdle(queue); |
| 3097 | |
| 3098 | return result; |
| 3099 | } |
| 3100 | |
| 3101 | VkResult DispatchDeviceWaitIdle( |
| 3102 | VkDevice device) |
| 3103 | { |
| 3104 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3105 | VkResult result = layer_data->device_dispatch_table.DeviceWaitIdle(device); |
| 3106 | |
| 3107 | return result; |
| 3108 | } |
| 3109 | |
| 3110 | VkResult DispatchAllocateMemory( |
| 3111 | VkDevice device, |
| 3112 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 3113 | const VkAllocationCallbacks* pAllocator, |
| 3114 | VkDeviceMemory* pMemory) |
| 3115 | { |
| 3116 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3117 | if (!wrap_handles) return layer_data->device_dispatch_table.AllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
| 3118 | safe_VkMemoryAllocateInfo *local_pAllocateInfo = NULL; |
| 3119 | { |
| 3120 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3121 | if (pAllocateInfo) { |
| 3122 | local_pAllocateInfo = new safe_VkMemoryAllocateInfo(pAllocateInfo); |
| 3123 | local_pAllocateInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pAllocateInfo->pNext); |
| 3124 | } |
| 3125 | } |
| 3126 | VkResult result = layer_data->device_dispatch_table.AllocateMemory(device, (const VkMemoryAllocateInfo*)local_pAllocateInfo, pAllocator, pMemory); |
| 3127 | if (local_pAllocateInfo) { |
| 3128 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pAllocateInfo->pNext)); |
| 3129 | delete local_pAllocateInfo; |
| 3130 | } |
| 3131 | if (VK_SUCCESS == result) { |
| 3132 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3133 | *pMemory = layer_data->WrapNew(*pMemory); |
| 3134 | } |
| 3135 | return result; |
| 3136 | } |
| 3137 | |
| 3138 | void DispatchFreeMemory( |
| 3139 | VkDevice device, |
| 3140 | VkDeviceMemory memory, |
| 3141 | const VkAllocationCallbacks* pAllocator) |
| 3142 | { |
| 3143 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3144 | if (!wrap_handles) return layer_data->device_dispatch_table.FreeMemory(device, memory, pAllocator); |
| 3145 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3146 | uint64_t memory_id = reinterpret_cast<uint64_t &>(memory); |
| 3147 | memory = (VkDeviceMemory)unique_id_mapping[memory_id]; |
| 3148 | unique_id_mapping.erase(memory_id); |
| 3149 | lock.unlock(); |
| 3150 | layer_data->device_dispatch_table.FreeMemory(device, memory, pAllocator); |
| 3151 | |
| 3152 | } |
| 3153 | |
| 3154 | VkResult DispatchMapMemory( |
| 3155 | VkDevice device, |
| 3156 | VkDeviceMemory memory, |
| 3157 | VkDeviceSize offset, |
| 3158 | VkDeviceSize size, |
| 3159 | VkMemoryMapFlags flags, |
| 3160 | void** ppData) |
| 3161 | { |
| 3162 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3163 | if (!wrap_handles) return layer_data->device_dispatch_table.MapMemory(device, memory, offset, size, flags, ppData); |
| 3164 | { |
| 3165 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3166 | memory = layer_data->Unwrap(memory); |
| 3167 | } |
| 3168 | VkResult result = layer_data->device_dispatch_table.MapMemory(device, memory, offset, size, flags, ppData); |
| 3169 | |
| 3170 | return result; |
| 3171 | } |
| 3172 | |
| 3173 | void DispatchUnmapMemory( |
| 3174 | VkDevice device, |
| 3175 | VkDeviceMemory memory) |
| 3176 | { |
| 3177 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3178 | if (!wrap_handles) return layer_data->device_dispatch_table.UnmapMemory(device, memory); |
| 3179 | { |
| 3180 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3181 | memory = layer_data->Unwrap(memory); |
| 3182 | } |
| 3183 | layer_data->device_dispatch_table.UnmapMemory(device, memory); |
| 3184 | |
| 3185 | } |
| 3186 | |
| 3187 | VkResult DispatchFlushMappedMemoryRanges( |
| 3188 | VkDevice device, |
| 3189 | uint32_t memoryRangeCount, |
| 3190 | const VkMappedMemoryRange* pMemoryRanges) |
| 3191 | { |
| 3192 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3193 | if (!wrap_handles) return layer_data->device_dispatch_table.FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
| 3194 | safe_VkMappedMemoryRange *local_pMemoryRanges = NULL; |
| 3195 | { |
| 3196 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3197 | if (pMemoryRanges) { |
| 3198 | local_pMemoryRanges = new safe_VkMappedMemoryRange[memoryRangeCount]; |
| 3199 | for (uint32_t index0 = 0; index0 < memoryRangeCount; ++index0) { |
| 3200 | local_pMemoryRanges[index0].initialize(&pMemoryRanges[index0]); |
| 3201 | if (pMemoryRanges[index0].memory) { |
| 3202 | local_pMemoryRanges[index0].memory = layer_data->Unwrap(pMemoryRanges[index0].memory); |
| 3203 | } |
| 3204 | } |
| 3205 | } |
| 3206 | } |
| 3207 | VkResult result = layer_data->device_dispatch_table.FlushMappedMemoryRanges(device, memoryRangeCount, (const VkMappedMemoryRange*)local_pMemoryRanges); |
| 3208 | if (local_pMemoryRanges) { |
| 3209 | delete[] local_pMemoryRanges; |
| 3210 | } |
| 3211 | return result; |
| 3212 | } |
| 3213 | |
| 3214 | VkResult DispatchInvalidateMappedMemoryRanges( |
| 3215 | VkDevice device, |
| 3216 | uint32_t memoryRangeCount, |
| 3217 | const VkMappedMemoryRange* pMemoryRanges) |
| 3218 | { |
| 3219 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3220 | if (!wrap_handles) return layer_data->device_dispatch_table.InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
| 3221 | safe_VkMappedMemoryRange *local_pMemoryRanges = NULL; |
| 3222 | { |
| 3223 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3224 | if (pMemoryRanges) { |
| 3225 | local_pMemoryRanges = new safe_VkMappedMemoryRange[memoryRangeCount]; |
| 3226 | for (uint32_t index0 = 0; index0 < memoryRangeCount; ++index0) { |
| 3227 | local_pMemoryRanges[index0].initialize(&pMemoryRanges[index0]); |
| 3228 | if (pMemoryRanges[index0].memory) { |
| 3229 | local_pMemoryRanges[index0].memory = layer_data->Unwrap(pMemoryRanges[index0].memory); |
| 3230 | } |
| 3231 | } |
| 3232 | } |
| 3233 | } |
| 3234 | VkResult result = layer_data->device_dispatch_table.InvalidateMappedMemoryRanges(device, memoryRangeCount, (const VkMappedMemoryRange*)local_pMemoryRanges); |
| 3235 | if (local_pMemoryRanges) { |
| 3236 | delete[] local_pMemoryRanges; |
| 3237 | } |
| 3238 | return result; |
| 3239 | } |
| 3240 | |
| 3241 | void DispatchGetDeviceMemoryCommitment( |
| 3242 | VkDevice device, |
| 3243 | VkDeviceMemory memory, |
| 3244 | VkDeviceSize* pCommittedMemoryInBytes) |
| 3245 | { |
| 3246 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3247 | if (!wrap_handles) return layer_data->device_dispatch_table.GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 3248 | { |
| 3249 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3250 | memory = layer_data->Unwrap(memory); |
| 3251 | } |
| 3252 | layer_data->device_dispatch_table.GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 3253 | |
| 3254 | } |
| 3255 | |
| 3256 | VkResult DispatchBindBufferMemory( |
| 3257 | VkDevice device, |
| 3258 | VkBuffer buffer, |
| 3259 | VkDeviceMemory memory, |
| 3260 | VkDeviceSize memoryOffset) |
| 3261 | { |
| 3262 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3263 | if (!wrap_handles) return layer_data->device_dispatch_table.BindBufferMemory(device, buffer, memory, memoryOffset); |
| 3264 | { |
| 3265 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3266 | buffer = layer_data->Unwrap(buffer); |
| 3267 | memory = layer_data->Unwrap(memory); |
| 3268 | } |
| 3269 | VkResult result = layer_data->device_dispatch_table.BindBufferMemory(device, buffer, memory, memoryOffset); |
| 3270 | |
| 3271 | return result; |
| 3272 | } |
| 3273 | |
| 3274 | VkResult DispatchBindImageMemory( |
| 3275 | VkDevice device, |
| 3276 | VkImage image, |
| 3277 | VkDeviceMemory memory, |
| 3278 | VkDeviceSize memoryOffset) |
| 3279 | { |
| 3280 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3281 | if (!wrap_handles) return layer_data->device_dispatch_table.BindImageMemory(device, image, memory, memoryOffset); |
| 3282 | { |
| 3283 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3284 | image = layer_data->Unwrap(image); |
| 3285 | memory = layer_data->Unwrap(memory); |
| 3286 | } |
| 3287 | VkResult result = layer_data->device_dispatch_table.BindImageMemory(device, image, memory, memoryOffset); |
| 3288 | |
| 3289 | return result; |
| 3290 | } |
| 3291 | |
| 3292 | void DispatchGetBufferMemoryRequirements( |
| 3293 | VkDevice device, |
| 3294 | VkBuffer buffer, |
| 3295 | VkMemoryRequirements* pMemoryRequirements) |
| 3296 | { |
| 3297 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3298 | if (!wrap_handles) return layer_data->device_dispatch_table.GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 3299 | { |
| 3300 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3301 | buffer = layer_data->Unwrap(buffer); |
| 3302 | } |
| 3303 | layer_data->device_dispatch_table.GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 3304 | |
| 3305 | } |
| 3306 | |
| 3307 | void DispatchGetImageMemoryRequirements( |
| 3308 | VkDevice device, |
| 3309 | VkImage image, |
| 3310 | VkMemoryRequirements* pMemoryRequirements) |
| 3311 | { |
| 3312 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3313 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 3314 | { |
| 3315 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3316 | image = layer_data->Unwrap(image); |
| 3317 | } |
| 3318 | layer_data->device_dispatch_table.GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 3319 | |
| 3320 | } |
| 3321 | |
| 3322 | void DispatchGetImageSparseMemoryRequirements( |
| 3323 | VkDevice device, |
| 3324 | VkImage image, |
| 3325 | uint32_t* pSparseMemoryRequirementCount, |
| 3326 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 3327 | { |
| 3328 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3329 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 3330 | { |
| 3331 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3332 | image = layer_data->Unwrap(image); |
| 3333 | } |
| 3334 | layer_data->device_dispatch_table.GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 3335 | |
| 3336 | } |
| 3337 | |
| 3338 | void DispatchGetPhysicalDeviceSparseImageFormatProperties( |
| 3339 | VkPhysicalDevice physicalDevice, |
| 3340 | VkFormat format, |
| 3341 | VkImageType type, |
| 3342 | VkSampleCountFlagBits samples, |
| 3343 | VkImageUsageFlags usage, |
| 3344 | VkImageTiling tiling, |
| 3345 | uint32_t* pPropertyCount, |
| 3346 | VkSparseImageFormatProperties* pProperties) |
| 3347 | { |
| 3348 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 3349 | layer_data->instance_dispatch_table.GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties); |
| 3350 | |
| 3351 | } |
| 3352 | |
| 3353 | VkResult DispatchQueueBindSparse( |
| 3354 | VkQueue queue, |
| 3355 | uint32_t bindInfoCount, |
| 3356 | const VkBindSparseInfo* pBindInfo, |
| 3357 | VkFence fence) |
| 3358 | { |
| 3359 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 3360 | if (!wrap_handles) return layer_data->device_dispatch_table.QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); |
| 3361 | safe_VkBindSparseInfo *local_pBindInfo = NULL; |
| 3362 | { |
| 3363 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3364 | if (pBindInfo) { |
| 3365 | local_pBindInfo = new safe_VkBindSparseInfo[bindInfoCount]; |
| 3366 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 3367 | local_pBindInfo[index0].initialize(&pBindInfo[index0]); |
| 3368 | if (local_pBindInfo[index0].pWaitSemaphores) { |
| 3369 | for (uint32_t index1 = 0; index1 < local_pBindInfo[index0].waitSemaphoreCount; ++index1) { |
| 3370 | local_pBindInfo[index0].pWaitSemaphores[index1] = layer_data->Unwrap(local_pBindInfo[index0].pWaitSemaphores[index1]); |
| 3371 | } |
| 3372 | } |
| 3373 | if (local_pBindInfo[index0].pBufferBinds) { |
| 3374 | for (uint32_t index1 = 0; index1 < local_pBindInfo[index0].bufferBindCount; ++index1) { |
| 3375 | if (pBindInfo[index0].pBufferBinds[index1].buffer) { |
| 3376 | local_pBindInfo[index0].pBufferBinds[index1].buffer = layer_data->Unwrap(pBindInfo[index0].pBufferBinds[index1].buffer); |
| 3377 | } |
| 3378 | if (local_pBindInfo[index0].pBufferBinds[index1].pBinds) { |
| 3379 | for (uint32_t index2 = 0; index2 < local_pBindInfo[index0].pBufferBinds[index1].bindCount; ++index2) { |
| 3380 | if (pBindInfo[index0].pBufferBinds[index1].pBinds[index2].memory) { |
| 3381 | local_pBindInfo[index0].pBufferBinds[index1].pBinds[index2].memory = layer_data->Unwrap(pBindInfo[index0].pBufferBinds[index1].pBinds[index2].memory); |
| 3382 | } |
| 3383 | } |
| 3384 | } |
| 3385 | } |
| 3386 | } |
| 3387 | if (local_pBindInfo[index0].pImageOpaqueBinds) { |
| 3388 | for (uint32_t index1 = 0; index1 < local_pBindInfo[index0].imageOpaqueBindCount; ++index1) { |
| 3389 | if (pBindInfo[index0].pImageOpaqueBinds[index1].image) { |
| 3390 | local_pBindInfo[index0].pImageOpaqueBinds[index1].image = layer_data->Unwrap(pBindInfo[index0].pImageOpaqueBinds[index1].image); |
| 3391 | } |
| 3392 | if (local_pBindInfo[index0].pImageOpaqueBinds[index1].pBinds) { |
| 3393 | for (uint32_t index2 = 0; index2 < local_pBindInfo[index0].pImageOpaqueBinds[index1].bindCount; ++index2) { |
| 3394 | if (pBindInfo[index0].pImageOpaqueBinds[index1].pBinds[index2].memory) { |
| 3395 | local_pBindInfo[index0].pImageOpaqueBinds[index1].pBinds[index2].memory = layer_data->Unwrap(pBindInfo[index0].pImageOpaqueBinds[index1].pBinds[index2].memory); |
| 3396 | } |
| 3397 | } |
| 3398 | } |
| 3399 | } |
| 3400 | } |
| 3401 | if (local_pBindInfo[index0].pImageBinds) { |
| 3402 | for (uint32_t index1 = 0; index1 < local_pBindInfo[index0].imageBindCount; ++index1) { |
| 3403 | if (pBindInfo[index0].pImageBinds[index1].image) { |
| 3404 | local_pBindInfo[index0].pImageBinds[index1].image = layer_data->Unwrap(pBindInfo[index0].pImageBinds[index1].image); |
| 3405 | } |
| 3406 | if (local_pBindInfo[index0].pImageBinds[index1].pBinds) { |
| 3407 | for (uint32_t index2 = 0; index2 < local_pBindInfo[index0].pImageBinds[index1].bindCount; ++index2) { |
| 3408 | if (pBindInfo[index0].pImageBinds[index1].pBinds[index2].memory) { |
| 3409 | local_pBindInfo[index0].pImageBinds[index1].pBinds[index2].memory = layer_data->Unwrap(pBindInfo[index0].pImageBinds[index1].pBinds[index2].memory); |
| 3410 | } |
| 3411 | } |
| 3412 | } |
| 3413 | } |
| 3414 | } |
| 3415 | if (local_pBindInfo[index0].pSignalSemaphores) { |
| 3416 | for (uint32_t index1 = 0; index1 < local_pBindInfo[index0].signalSemaphoreCount; ++index1) { |
| 3417 | local_pBindInfo[index0].pSignalSemaphores[index1] = layer_data->Unwrap(local_pBindInfo[index0].pSignalSemaphores[index1]); |
| 3418 | } |
| 3419 | } |
| 3420 | } |
| 3421 | } |
| 3422 | fence = layer_data->Unwrap(fence); |
| 3423 | } |
| 3424 | VkResult result = layer_data->device_dispatch_table.QueueBindSparse(queue, bindInfoCount, (const VkBindSparseInfo*)local_pBindInfo, fence); |
| 3425 | if (local_pBindInfo) { |
| 3426 | delete[] local_pBindInfo; |
| 3427 | } |
| 3428 | return result; |
| 3429 | } |
| 3430 | |
| 3431 | VkResult DispatchCreateFence( |
| 3432 | VkDevice device, |
| 3433 | const VkFenceCreateInfo* pCreateInfo, |
| 3434 | const VkAllocationCallbacks* pAllocator, |
| 3435 | VkFence* pFence) |
| 3436 | { |
| 3437 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3438 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateFence(device, pCreateInfo, pAllocator, pFence); |
| 3439 | VkResult result = layer_data->device_dispatch_table.CreateFence(device, pCreateInfo, pAllocator, pFence); |
| 3440 | if (VK_SUCCESS == result) { |
| 3441 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3442 | *pFence = layer_data->WrapNew(*pFence); |
| 3443 | } |
| 3444 | return result; |
| 3445 | } |
| 3446 | |
| 3447 | void DispatchDestroyFence( |
| 3448 | VkDevice device, |
| 3449 | VkFence fence, |
| 3450 | const VkAllocationCallbacks* pAllocator) |
| 3451 | { |
| 3452 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3453 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyFence(device, fence, pAllocator); |
| 3454 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3455 | uint64_t fence_id = reinterpret_cast<uint64_t &>(fence); |
| 3456 | fence = (VkFence)unique_id_mapping[fence_id]; |
| 3457 | unique_id_mapping.erase(fence_id); |
| 3458 | lock.unlock(); |
| 3459 | layer_data->device_dispatch_table.DestroyFence(device, fence, pAllocator); |
| 3460 | |
| 3461 | } |
| 3462 | |
| 3463 | VkResult DispatchResetFences( |
| 3464 | VkDevice device, |
| 3465 | uint32_t fenceCount, |
| 3466 | const VkFence* pFences) |
| 3467 | { |
| 3468 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3469 | if (!wrap_handles) return layer_data->device_dispatch_table.ResetFences(device, fenceCount, pFences); |
| 3470 | VkFence *local_pFences = NULL; |
| 3471 | { |
| 3472 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3473 | if (pFences) { |
| 3474 | local_pFences = new VkFence[fenceCount]; |
| 3475 | for (uint32_t index0 = 0; index0 < fenceCount; ++index0) { |
| 3476 | local_pFences[index0] = layer_data->Unwrap(pFences[index0]); |
| 3477 | } |
| 3478 | } |
| 3479 | } |
| 3480 | VkResult result = layer_data->device_dispatch_table.ResetFences(device, fenceCount, (const VkFence*)local_pFences); |
| 3481 | if (local_pFences) |
| 3482 | delete[] local_pFences; |
| 3483 | return result; |
| 3484 | } |
| 3485 | |
| 3486 | VkResult DispatchGetFenceStatus( |
| 3487 | VkDevice device, |
| 3488 | VkFence fence) |
| 3489 | { |
| 3490 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3491 | if (!wrap_handles) return layer_data->device_dispatch_table.GetFenceStatus(device, fence); |
| 3492 | { |
| 3493 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3494 | fence = layer_data->Unwrap(fence); |
| 3495 | } |
| 3496 | VkResult result = layer_data->device_dispatch_table.GetFenceStatus(device, fence); |
| 3497 | |
| 3498 | return result; |
| 3499 | } |
| 3500 | |
| 3501 | VkResult DispatchWaitForFences( |
| 3502 | VkDevice device, |
| 3503 | uint32_t fenceCount, |
| 3504 | const VkFence* pFences, |
| 3505 | VkBool32 waitAll, |
| 3506 | uint64_t timeout) |
| 3507 | { |
| 3508 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3509 | if (!wrap_handles) return layer_data->device_dispatch_table.WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 3510 | VkFence *local_pFences = NULL; |
| 3511 | { |
| 3512 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3513 | if (pFences) { |
| 3514 | local_pFences = new VkFence[fenceCount]; |
| 3515 | for (uint32_t index0 = 0; index0 < fenceCount; ++index0) { |
| 3516 | local_pFences[index0] = layer_data->Unwrap(pFences[index0]); |
| 3517 | } |
| 3518 | } |
| 3519 | } |
| 3520 | VkResult result = layer_data->device_dispatch_table.WaitForFences(device, fenceCount, (const VkFence*)local_pFences, waitAll, timeout); |
| 3521 | if (local_pFences) |
| 3522 | delete[] local_pFences; |
| 3523 | return result; |
| 3524 | } |
| 3525 | |
| 3526 | VkResult DispatchCreateSemaphore( |
| 3527 | VkDevice device, |
| 3528 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 3529 | const VkAllocationCallbacks* pAllocator, |
| 3530 | VkSemaphore* pSemaphore) |
| 3531 | { |
| 3532 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3533 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); |
| 3534 | VkResult result = layer_data->device_dispatch_table.CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); |
| 3535 | if (VK_SUCCESS == result) { |
| 3536 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3537 | *pSemaphore = layer_data->WrapNew(*pSemaphore); |
| 3538 | } |
| 3539 | return result; |
| 3540 | } |
| 3541 | |
| 3542 | void DispatchDestroySemaphore( |
| 3543 | VkDevice device, |
| 3544 | VkSemaphore semaphore, |
| 3545 | const VkAllocationCallbacks* pAllocator) |
| 3546 | { |
| 3547 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3548 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroySemaphore(device, semaphore, pAllocator); |
| 3549 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3550 | uint64_t semaphore_id = reinterpret_cast<uint64_t &>(semaphore); |
| 3551 | semaphore = (VkSemaphore)unique_id_mapping[semaphore_id]; |
| 3552 | unique_id_mapping.erase(semaphore_id); |
| 3553 | lock.unlock(); |
| 3554 | layer_data->device_dispatch_table.DestroySemaphore(device, semaphore, pAllocator); |
| 3555 | |
| 3556 | } |
| 3557 | |
| 3558 | VkResult DispatchCreateEvent( |
| 3559 | VkDevice device, |
| 3560 | const VkEventCreateInfo* pCreateInfo, |
| 3561 | const VkAllocationCallbacks* pAllocator, |
| 3562 | VkEvent* pEvent) |
| 3563 | { |
| 3564 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3565 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateEvent(device, pCreateInfo, pAllocator, pEvent); |
| 3566 | VkResult result = layer_data->device_dispatch_table.CreateEvent(device, pCreateInfo, pAllocator, pEvent); |
| 3567 | if (VK_SUCCESS == result) { |
| 3568 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3569 | *pEvent = layer_data->WrapNew(*pEvent); |
| 3570 | } |
| 3571 | return result; |
| 3572 | } |
| 3573 | |
| 3574 | void DispatchDestroyEvent( |
| 3575 | VkDevice device, |
| 3576 | VkEvent event, |
| 3577 | const VkAllocationCallbacks* pAllocator) |
| 3578 | { |
| 3579 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3580 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyEvent(device, event, pAllocator); |
| 3581 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3582 | uint64_t event_id = reinterpret_cast<uint64_t &>(event); |
| 3583 | event = (VkEvent)unique_id_mapping[event_id]; |
| 3584 | unique_id_mapping.erase(event_id); |
| 3585 | lock.unlock(); |
| 3586 | layer_data->device_dispatch_table.DestroyEvent(device, event, pAllocator); |
| 3587 | |
| 3588 | } |
| 3589 | |
| 3590 | VkResult DispatchGetEventStatus( |
| 3591 | VkDevice device, |
| 3592 | VkEvent event) |
| 3593 | { |
| 3594 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3595 | if (!wrap_handles) return layer_data->device_dispatch_table.GetEventStatus(device, event); |
| 3596 | { |
| 3597 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3598 | event = layer_data->Unwrap(event); |
| 3599 | } |
| 3600 | VkResult result = layer_data->device_dispatch_table.GetEventStatus(device, event); |
| 3601 | |
| 3602 | return result; |
| 3603 | } |
| 3604 | |
| 3605 | VkResult DispatchSetEvent( |
| 3606 | VkDevice device, |
| 3607 | VkEvent event) |
| 3608 | { |
| 3609 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3610 | if (!wrap_handles) return layer_data->device_dispatch_table.SetEvent(device, event); |
| 3611 | { |
| 3612 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3613 | event = layer_data->Unwrap(event); |
| 3614 | } |
| 3615 | VkResult result = layer_data->device_dispatch_table.SetEvent(device, event); |
| 3616 | |
| 3617 | return result; |
| 3618 | } |
| 3619 | |
| 3620 | VkResult DispatchResetEvent( |
| 3621 | VkDevice device, |
| 3622 | VkEvent event) |
| 3623 | { |
| 3624 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3625 | if (!wrap_handles) return layer_data->device_dispatch_table.ResetEvent(device, event); |
| 3626 | { |
| 3627 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3628 | event = layer_data->Unwrap(event); |
| 3629 | } |
| 3630 | VkResult result = layer_data->device_dispatch_table.ResetEvent(device, event); |
| 3631 | |
| 3632 | return result; |
| 3633 | } |
| 3634 | |
| 3635 | VkResult DispatchCreateQueryPool( |
| 3636 | VkDevice device, |
| 3637 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3638 | const VkAllocationCallbacks* pAllocator, |
| 3639 | VkQueryPool* pQueryPool) |
| 3640 | { |
| 3641 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3642 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); |
| 3643 | VkResult result = layer_data->device_dispatch_table.CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); |
| 3644 | if (VK_SUCCESS == result) { |
| 3645 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3646 | *pQueryPool = layer_data->WrapNew(*pQueryPool); |
| 3647 | } |
| 3648 | return result; |
| 3649 | } |
| 3650 | |
| 3651 | void DispatchDestroyQueryPool( |
| 3652 | VkDevice device, |
| 3653 | VkQueryPool queryPool, |
| 3654 | const VkAllocationCallbacks* pAllocator) |
| 3655 | { |
| 3656 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3657 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyQueryPool(device, queryPool, pAllocator); |
| 3658 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3659 | uint64_t queryPool_id = reinterpret_cast<uint64_t &>(queryPool); |
| 3660 | queryPool = (VkQueryPool)unique_id_mapping[queryPool_id]; |
| 3661 | unique_id_mapping.erase(queryPool_id); |
| 3662 | lock.unlock(); |
| 3663 | layer_data->device_dispatch_table.DestroyQueryPool(device, queryPool, pAllocator); |
| 3664 | |
| 3665 | } |
| 3666 | |
| 3667 | VkResult DispatchGetQueryPoolResults( |
| 3668 | VkDevice device, |
| 3669 | VkQueryPool queryPool, |
| 3670 | uint32_t firstQuery, |
| 3671 | uint32_t queryCount, |
| 3672 | size_t dataSize, |
| 3673 | void* pData, |
| 3674 | VkDeviceSize stride, |
| 3675 | VkQueryResultFlags flags) |
| 3676 | { |
| 3677 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3678 | if (!wrap_handles) return layer_data->device_dispatch_table.GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); |
| 3679 | { |
| 3680 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3681 | queryPool = layer_data->Unwrap(queryPool); |
| 3682 | } |
| 3683 | VkResult result = layer_data->device_dispatch_table.GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); |
| 3684 | |
| 3685 | return result; |
| 3686 | } |
| 3687 | |
| 3688 | VkResult DispatchCreateBuffer( |
| 3689 | VkDevice device, |
| 3690 | const VkBufferCreateInfo* pCreateInfo, |
| 3691 | const VkAllocationCallbacks* pAllocator, |
| 3692 | VkBuffer* pBuffer) |
| 3693 | { |
| 3694 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3695 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); |
| 3696 | VkResult result = layer_data->device_dispatch_table.CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); |
| 3697 | if (VK_SUCCESS == result) { |
| 3698 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3699 | *pBuffer = layer_data->WrapNew(*pBuffer); |
| 3700 | } |
| 3701 | return result; |
| 3702 | } |
| 3703 | |
| 3704 | void DispatchDestroyBuffer( |
| 3705 | VkDevice device, |
| 3706 | VkBuffer buffer, |
| 3707 | const VkAllocationCallbacks* pAllocator) |
| 3708 | { |
| 3709 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3710 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyBuffer(device, buffer, pAllocator); |
| 3711 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3712 | uint64_t buffer_id = reinterpret_cast<uint64_t &>(buffer); |
| 3713 | buffer = (VkBuffer)unique_id_mapping[buffer_id]; |
| 3714 | unique_id_mapping.erase(buffer_id); |
| 3715 | lock.unlock(); |
| 3716 | layer_data->device_dispatch_table.DestroyBuffer(device, buffer, pAllocator); |
| 3717 | |
| 3718 | } |
| 3719 | |
| 3720 | VkResult DispatchCreateBufferView( |
| 3721 | VkDevice device, |
| 3722 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3723 | const VkAllocationCallbacks* pAllocator, |
| 3724 | VkBufferView* pView) |
| 3725 | { |
| 3726 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3727 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateBufferView(device, pCreateInfo, pAllocator, pView); |
| 3728 | safe_VkBufferViewCreateInfo *local_pCreateInfo = NULL; |
| 3729 | { |
| 3730 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3731 | if (pCreateInfo) { |
| 3732 | local_pCreateInfo = new safe_VkBufferViewCreateInfo(pCreateInfo); |
| 3733 | if (pCreateInfo->buffer) { |
| 3734 | local_pCreateInfo->buffer = layer_data->Unwrap(pCreateInfo->buffer); |
| 3735 | } |
| 3736 | } |
| 3737 | } |
| 3738 | VkResult result = layer_data->device_dispatch_table.CreateBufferView(device, (const VkBufferViewCreateInfo*)local_pCreateInfo, pAllocator, pView); |
| 3739 | if (local_pCreateInfo) { |
| 3740 | delete local_pCreateInfo; |
| 3741 | } |
| 3742 | if (VK_SUCCESS == result) { |
| 3743 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3744 | *pView = layer_data->WrapNew(*pView); |
| 3745 | } |
| 3746 | return result; |
| 3747 | } |
| 3748 | |
| 3749 | void DispatchDestroyBufferView( |
| 3750 | VkDevice device, |
| 3751 | VkBufferView bufferView, |
| 3752 | const VkAllocationCallbacks* pAllocator) |
| 3753 | { |
| 3754 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3755 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyBufferView(device, bufferView, pAllocator); |
| 3756 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3757 | uint64_t bufferView_id = reinterpret_cast<uint64_t &>(bufferView); |
| 3758 | bufferView = (VkBufferView)unique_id_mapping[bufferView_id]; |
| 3759 | unique_id_mapping.erase(bufferView_id); |
| 3760 | lock.unlock(); |
| 3761 | layer_data->device_dispatch_table.DestroyBufferView(device, bufferView, pAllocator); |
| 3762 | |
| 3763 | } |
| 3764 | |
| 3765 | VkResult DispatchCreateImage( |
| 3766 | VkDevice device, |
| 3767 | const VkImageCreateInfo* pCreateInfo, |
| 3768 | const VkAllocationCallbacks* pAllocator, |
| 3769 | VkImage* pImage) |
| 3770 | { |
| 3771 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3772 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateImage(device, pCreateInfo, pAllocator, pImage); |
| 3773 | safe_VkImageCreateInfo *local_pCreateInfo = NULL; |
| 3774 | { |
| 3775 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3776 | if (pCreateInfo) { |
| 3777 | local_pCreateInfo = new safe_VkImageCreateInfo(pCreateInfo); |
| 3778 | local_pCreateInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pCreateInfo->pNext); |
| 3779 | } |
| 3780 | } |
| 3781 | VkResult result = layer_data->device_dispatch_table.CreateImage(device, (const VkImageCreateInfo*)local_pCreateInfo, pAllocator, pImage); |
| 3782 | if (local_pCreateInfo) { |
| 3783 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pCreateInfo->pNext)); |
| 3784 | delete local_pCreateInfo; |
| 3785 | } |
| 3786 | if (VK_SUCCESS == result) { |
| 3787 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3788 | *pImage = layer_data->WrapNew(*pImage); |
| 3789 | } |
| 3790 | return result; |
| 3791 | } |
| 3792 | |
| 3793 | void DispatchDestroyImage( |
| 3794 | VkDevice device, |
| 3795 | VkImage image, |
| 3796 | const VkAllocationCallbacks* pAllocator) |
| 3797 | { |
| 3798 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3799 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyImage(device, image, pAllocator); |
| 3800 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3801 | uint64_t image_id = reinterpret_cast<uint64_t &>(image); |
| 3802 | image = (VkImage)unique_id_mapping[image_id]; |
| 3803 | unique_id_mapping.erase(image_id); |
| 3804 | lock.unlock(); |
| 3805 | layer_data->device_dispatch_table.DestroyImage(device, image, pAllocator); |
| 3806 | |
| 3807 | } |
| 3808 | |
| 3809 | void DispatchGetImageSubresourceLayout( |
| 3810 | VkDevice device, |
| 3811 | VkImage image, |
| 3812 | const VkImageSubresource* pSubresource, |
| 3813 | VkSubresourceLayout* pLayout) |
| 3814 | { |
| 3815 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3816 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 3817 | { |
| 3818 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3819 | image = layer_data->Unwrap(image); |
| 3820 | } |
| 3821 | layer_data->device_dispatch_table.GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 3822 | |
| 3823 | } |
| 3824 | |
| 3825 | VkResult DispatchCreateImageView( |
| 3826 | VkDevice device, |
| 3827 | const VkImageViewCreateInfo* pCreateInfo, |
| 3828 | const VkAllocationCallbacks* pAllocator, |
| 3829 | VkImageView* pView) |
| 3830 | { |
| 3831 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3832 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateImageView(device, pCreateInfo, pAllocator, pView); |
| 3833 | safe_VkImageViewCreateInfo *local_pCreateInfo = NULL; |
| 3834 | { |
| 3835 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3836 | if (pCreateInfo) { |
| 3837 | local_pCreateInfo = new safe_VkImageViewCreateInfo(pCreateInfo); |
| 3838 | if (pCreateInfo->image) { |
| 3839 | local_pCreateInfo->image = layer_data->Unwrap(pCreateInfo->image); |
| 3840 | } |
| 3841 | local_pCreateInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pCreateInfo->pNext); |
| 3842 | } |
| 3843 | } |
| 3844 | VkResult result = layer_data->device_dispatch_table.CreateImageView(device, (const VkImageViewCreateInfo*)local_pCreateInfo, pAllocator, pView); |
| 3845 | if (local_pCreateInfo) { |
| 3846 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pCreateInfo->pNext)); |
| 3847 | delete local_pCreateInfo; |
| 3848 | } |
| 3849 | if (VK_SUCCESS == result) { |
| 3850 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3851 | *pView = layer_data->WrapNew(*pView); |
| 3852 | } |
| 3853 | return result; |
| 3854 | } |
| 3855 | |
| 3856 | void DispatchDestroyImageView( |
| 3857 | VkDevice device, |
| 3858 | VkImageView imageView, |
| 3859 | const VkAllocationCallbacks* pAllocator) |
| 3860 | { |
| 3861 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3862 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyImageView(device, imageView, pAllocator); |
| 3863 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3864 | uint64_t imageView_id = reinterpret_cast<uint64_t &>(imageView); |
| 3865 | imageView = (VkImageView)unique_id_mapping[imageView_id]; |
| 3866 | unique_id_mapping.erase(imageView_id); |
| 3867 | lock.unlock(); |
| 3868 | layer_data->device_dispatch_table.DestroyImageView(device, imageView, pAllocator); |
| 3869 | |
| 3870 | } |
| 3871 | |
| 3872 | VkResult DispatchCreateShaderModule( |
| 3873 | VkDevice device, |
| 3874 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 3875 | const VkAllocationCallbacks* pAllocator, |
| 3876 | VkShaderModule* pShaderModule) |
| 3877 | { |
| 3878 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3879 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); |
| 3880 | safe_VkShaderModuleCreateInfo *local_pCreateInfo = NULL; |
| 3881 | { |
| 3882 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3883 | if (pCreateInfo) { |
| 3884 | local_pCreateInfo = new safe_VkShaderModuleCreateInfo(pCreateInfo); |
| 3885 | local_pCreateInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pCreateInfo->pNext); |
| 3886 | } |
| 3887 | } |
| 3888 | VkResult result = layer_data->device_dispatch_table.CreateShaderModule(device, (const VkShaderModuleCreateInfo*)local_pCreateInfo, pAllocator, pShaderModule); |
| 3889 | if (local_pCreateInfo) { |
| 3890 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pCreateInfo->pNext)); |
| 3891 | delete local_pCreateInfo; |
| 3892 | } |
| 3893 | if (VK_SUCCESS == result) { |
| 3894 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3895 | *pShaderModule = layer_data->WrapNew(*pShaderModule); |
| 3896 | } |
| 3897 | return result; |
| 3898 | } |
| 3899 | |
| 3900 | void DispatchDestroyShaderModule( |
| 3901 | VkDevice device, |
| 3902 | VkShaderModule shaderModule, |
| 3903 | const VkAllocationCallbacks* pAllocator) |
| 3904 | { |
| 3905 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3906 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyShaderModule(device, shaderModule, pAllocator); |
| 3907 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3908 | uint64_t shaderModule_id = reinterpret_cast<uint64_t &>(shaderModule); |
| 3909 | shaderModule = (VkShaderModule)unique_id_mapping[shaderModule_id]; |
| 3910 | unique_id_mapping.erase(shaderModule_id); |
| 3911 | lock.unlock(); |
| 3912 | layer_data->device_dispatch_table.DestroyShaderModule(device, shaderModule, pAllocator); |
| 3913 | |
| 3914 | } |
| 3915 | |
| 3916 | VkResult DispatchCreatePipelineCache( |
| 3917 | VkDevice device, |
| 3918 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 3919 | const VkAllocationCallbacks* pAllocator, |
| 3920 | VkPipelineCache* pPipelineCache) |
| 3921 | { |
| 3922 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3923 | if (!wrap_handles) return layer_data->device_dispatch_table.CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache); |
| 3924 | VkResult result = layer_data->device_dispatch_table.CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache); |
| 3925 | if (VK_SUCCESS == result) { |
| 3926 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3927 | *pPipelineCache = layer_data->WrapNew(*pPipelineCache); |
| 3928 | } |
| 3929 | return result; |
| 3930 | } |
| 3931 | |
| 3932 | void DispatchDestroyPipelineCache( |
| 3933 | VkDevice device, |
| 3934 | VkPipelineCache pipelineCache, |
| 3935 | const VkAllocationCallbacks* pAllocator) |
| 3936 | { |
| 3937 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3938 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyPipelineCache(device, pipelineCache, pAllocator); |
| 3939 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 3940 | uint64_t pipelineCache_id = reinterpret_cast<uint64_t &>(pipelineCache); |
| 3941 | pipelineCache = (VkPipelineCache)unique_id_mapping[pipelineCache_id]; |
| 3942 | unique_id_mapping.erase(pipelineCache_id); |
| 3943 | lock.unlock(); |
| 3944 | layer_data->device_dispatch_table.DestroyPipelineCache(device, pipelineCache, pAllocator); |
| 3945 | |
| 3946 | } |
| 3947 | |
| 3948 | VkResult DispatchGetPipelineCacheData( |
| 3949 | VkDevice device, |
| 3950 | VkPipelineCache pipelineCache, |
| 3951 | size_t* pDataSize, |
| 3952 | void* pData) |
| 3953 | { |
| 3954 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3955 | if (!wrap_handles) return layer_data->device_dispatch_table.GetPipelineCacheData(device, pipelineCache, pDataSize, pData); |
| 3956 | { |
| 3957 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3958 | pipelineCache = layer_data->Unwrap(pipelineCache); |
| 3959 | } |
| 3960 | VkResult result = layer_data->device_dispatch_table.GetPipelineCacheData(device, pipelineCache, pDataSize, pData); |
| 3961 | |
| 3962 | return result; |
| 3963 | } |
| 3964 | |
| 3965 | VkResult DispatchMergePipelineCaches( |
| 3966 | VkDevice device, |
| 3967 | VkPipelineCache dstCache, |
| 3968 | uint32_t srcCacheCount, |
| 3969 | const VkPipelineCache* pSrcCaches) |
| 3970 | { |
| 3971 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 3972 | if (!wrap_handles) return layer_data->device_dispatch_table.MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches); |
| 3973 | VkPipelineCache *local_pSrcCaches = NULL; |
| 3974 | { |
| 3975 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 3976 | dstCache = layer_data->Unwrap(dstCache); |
| 3977 | if (pSrcCaches) { |
| 3978 | local_pSrcCaches = new VkPipelineCache[srcCacheCount]; |
| 3979 | for (uint32_t index0 = 0; index0 < srcCacheCount; ++index0) { |
| 3980 | local_pSrcCaches[index0] = layer_data->Unwrap(pSrcCaches[index0]); |
| 3981 | } |
| 3982 | } |
| 3983 | } |
| 3984 | VkResult result = layer_data->device_dispatch_table.MergePipelineCaches(device, dstCache, srcCacheCount, (const VkPipelineCache*)local_pSrcCaches); |
| 3985 | if (local_pSrcCaches) |
| 3986 | delete[] local_pSrcCaches; |
| 3987 | return result; |
| 3988 | } |
| 3989 | |
| 3990 | // Skip vkCreateGraphicsPipelines dispatch, manually generated |
| 3991 | |
| 3992 | // Skip vkCreateComputePipelines dispatch, manually generated |
| 3993 | |
| 3994 | void DispatchDestroyPipeline( |
| 3995 | VkDevice device, |
| 3996 | VkPipeline pipeline, |
| 3997 | const VkAllocationCallbacks* pAllocator) |
| 3998 | { |
| 3999 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4000 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyPipeline(device, pipeline, pAllocator); |
| 4001 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 4002 | uint64_t pipeline_id = reinterpret_cast<uint64_t &>(pipeline); |
| 4003 | pipeline = (VkPipeline)unique_id_mapping[pipeline_id]; |
| 4004 | unique_id_mapping.erase(pipeline_id); |
| 4005 | lock.unlock(); |
| 4006 | layer_data->device_dispatch_table.DestroyPipeline(device, pipeline, pAllocator); |
| 4007 | |
| 4008 | } |
| 4009 | |
| 4010 | VkResult DispatchCreatePipelineLayout( |
| 4011 | VkDevice device, |
| 4012 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 4013 | const VkAllocationCallbacks* pAllocator, |
| 4014 | VkPipelineLayout* pPipelineLayout) |
| 4015 | { |
| 4016 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4017 | if (!wrap_handles) return layer_data->device_dispatch_table.CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); |
| 4018 | safe_VkPipelineLayoutCreateInfo *local_pCreateInfo = NULL; |
| 4019 | { |
| 4020 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4021 | if (pCreateInfo) { |
| 4022 | local_pCreateInfo = new safe_VkPipelineLayoutCreateInfo(pCreateInfo); |
| 4023 | if (local_pCreateInfo->pSetLayouts) { |
| 4024 | for (uint32_t index1 = 0; index1 < local_pCreateInfo->setLayoutCount; ++index1) { |
| 4025 | local_pCreateInfo->pSetLayouts[index1] = layer_data->Unwrap(local_pCreateInfo->pSetLayouts[index1]); |
| 4026 | } |
| 4027 | } |
| 4028 | } |
| 4029 | } |
| 4030 | VkResult result = layer_data->device_dispatch_table.CreatePipelineLayout(device, (const VkPipelineLayoutCreateInfo*)local_pCreateInfo, pAllocator, pPipelineLayout); |
| 4031 | if (local_pCreateInfo) { |
| 4032 | delete local_pCreateInfo; |
| 4033 | } |
| 4034 | if (VK_SUCCESS == result) { |
| 4035 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4036 | *pPipelineLayout = layer_data->WrapNew(*pPipelineLayout); |
| 4037 | } |
| 4038 | return result; |
| 4039 | } |
| 4040 | |
| 4041 | void DispatchDestroyPipelineLayout( |
| 4042 | VkDevice device, |
| 4043 | VkPipelineLayout pipelineLayout, |
| 4044 | const VkAllocationCallbacks* pAllocator) |
| 4045 | { |
| 4046 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4047 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyPipelineLayout(device, pipelineLayout, pAllocator); |
| 4048 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 4049 | uint64_t pipelineLayout_id = reinterpret_cast<uint64_t &>(pipelineLayout); |
| 4050 | pipelineLayout = (VkPipelineLayout)unique_id_mapping[pipelineLayout_id]; |
| 4051 | unique_id_mapping.erase(pipelineLayout_id); |
| 4052 | lock.unlock(); |
| 4053 | layer_data->device_dispatch_table.DestroyPipelineLayout(device, pipelineLayout, pAllocator); |
| 4054 | |
| 4055 | } |
| 4056 | |
| 4057 | VkResult DispatchCreateSampler( |
| 4058 | VkDevice device, |
| 4059 | const VkSamplerCreateInfo* pCreateInfo, |
| 4060 | const VkAllocationCallbacks* pAllocator, |
| 4061 | VkSampler* pSampler) |
| 4062 | { |
| 4063 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4064 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateSampler(device, pCreateInfo, pAllocator, pSampler); |
| 4065 | safe_VkSamplerCreateInfo *local_pCreateInfo = NULL; |
| 4066 | { |
| 4067 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4068 | if (pCreateInfo) { |
| 4069 | local_pCreateInfo = new safe_VkSamplerCreateInfo(pCreateInfo); |
| 4070 | local_pCreateInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pCreateInfo->pNext); |
| 4071 | } |
| 4072 | } |
| 4073 | VkResult result = layer_data->device_dispatch_table.CreateSampler(device, (const VkSamplerCreateInfo*)local_pCreateInfo, pAllocator, pSampler); |
| 4074 | if (local_pCreateInfo) { |
| 4075 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pCreateInfo->pNext)); |
| 4076 | delete local_pCreateInfo; |
| 4077 | } |
| 4078 | if (VK_SUCCESS == result) { |
| 4079 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4080 | *pSampler = layer_data->WrapNew(*pSampler); |
| 4081 | } |
| 4082 | return result; |
| 4083 | } |
| 4084 | |
| 4085 | void DispatchDestroySampler( |
| 4086 | VkDevice device, |
| 4087 | VkSampler sampler, |
| 4088 | const VkAllocationCallbacks* pAllocator) |
| 4089 | { |
| 4090 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4091 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroySampler(device, sampler, pAllocator); |
| 4092 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 4093 | uint64_t sampler_id = reinterpret_cast<uint64_t &>(sampler); |
| 4094 | sampler = (VkSampler)unique_id_mapping[sampler_id]; |
| 4095 | unique_id_mapping.erase(sampler_id); |
| 4096 | lock.unlock(); |
| 4097 | layer_data->device_dispatch_table.DestroySampler(device, sampler, pAllocator); |
| 4098 | |
| 4099 | } |
| 4100 | |
| 4101 | VkResult DispatchCreateDescriptorSetLayout( |
| 4102 | VkDevice device, |
| 4103 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 4104 | const VkAllocationCallbacks* pAllocator, |
| 4105 | VkDescriptorSetLayout* pSetLayout) |
| 4106 | { |
| 4107 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4108 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout); |
| 4109 | safe_VkDescriptorSetLayoutCreateInfo *local_pCreateInfo = NULL; |
| 4110 | { |
| 4111 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4112 | if (pCreateInfo) { |
| 4113 | local_pCreateInfo = new safe_VkDescriptorSetLayoutCreateInfo(pCreateInfo); |
| 4114 | if (local_pCreateInfo->pBindings) { |
| 4115 | for (uint32_t index1 = 0; index1 < local_pCreateInfo->bindingCount; ++index1) { |
| 4116 | if (local_pCreateInfo->pBindings[index1].pImmutableSamplers) { |
| 4117 | for (uint32_t index2 = 0; index2 < local_pCreateInfo->pBindings[index1].descriptorCount; ++index2) { |
| 4118 | local_pCreateInfo->pBindings[index1].pImmutableSamplers[index2] = layer_data->Unwrap(local_pCreateInfo->pBindings[index1].pImmutableSamplers[index2]); |
| 4119 | } |
| 4120 | } |
| 4121 | } |
| 4122 | } |
| 4123 | } |
| 4124 | } |
| 4125 | VkResult result = layer_data->device_dispatch_table.CreateDescriptorSetLayout(device, (const VkDescriptorSetLayoutCreateInfo*)local_pCreateInfo, pAllocator, pSetLayout); |
| 4126 | if (local_pCreateInfo) { |
| 4127 | delete local_pCreateInfo; |
| 4128 | } |
| 4129 | if (VK_SUCCESS == result) { |
| 4130 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4131 | *pSetLayout = layer_data->WrapNew(*pSetLayout); |
| 4132 | } |
| 4133 | return result; |
| 4134 | } |
| 4135 | |
| 4136 | void DispatchDestroyDescriptorSetLayout( |
| 4137 | VkDevice device, |
| 4138 | VkDescriptorSetLayout descriptorSetLayout, |
| 4139 | const VkAllocationCallbacks* pAllocator) |
| 4140 | { |
| 4141 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4142 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); |
| 4143 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 4144 | uint64_t descriptorSetLayout_id = reinterpret_cast<uint64_t &>(descriptorSetLayout); |
| 4145 | descriptorSetLayout = (VkDescriptorSetLayout)unique_id_mapping[descriptorSetLayout_id]; |
| 4146 | unique_id_mapping.erase(descriptorSetLayout_id); |
| 4147 | lock.unlock(); |
| 4148 | layer_data->device_dispatch_table.DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); |
| 4149 | |
| 4150 | } |
| 4151 | |
| 4152 | VkResult DispatchCreateDescriptorPool( |
| 4153 | VkDevice device, |
| 4154 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 4155 | const VkAllocationCallbacks* pAllocator, |
| 4156 | VkDescriptorPool* pDescriptorPool) |
| 4157 | { |
| 4158 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4159 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool); |
| 4160 | VkResult result = layer_data->device_dispatch_table.CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool); |
| 4161 | if (VK_SUCCESS == result) { |
| 4162 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4163 | *pDescriptorPool = layer_data->WrapNew(*pDescriptorPool); |
| 4164 | } |
| 4165 | return result; |
| 4166 | } |
| 4167 | |
| 4168 | // Skip vkDestroyDescriptorPool dispatch, manually generated |
| 4169 | |
| 4170 | // Skip vkResetDescriptorPool dispatch, manually generated |
| 4171 | |
| 4172 | // Skip vkAllocateDescriptorSets dispatch, manually generated |
| 4173 | |
| 4174 | // Skip vkFreeDescriptorSets dispatch, manually generated |
| 4175 | |
| 4176 | void DispatchUpdateDescriptorSets( |
| 4177 | VkDevice device, |
| 4178 | uint32_t descriptorWriteCount, |
| 4179 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 4180 | uint32_t descriptorCopyCount, |
| 4181 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 4182 | { |
| 4183 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4184 | if (!wrap_handles) return layer_data->device_dispatch_table.UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies); |
| 4185 | safe_VkWriteDescriptorSet *local_pDescriptorWrites = NULL; |
| 4186 | safe_VkCopyDescriptorSet *local_pDescriptorCopies = NULL; |
| 4187 | { |
| 4188 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4189 | if (pDescriptorWrites) { |
| 4190 | local_pDescriptorWrites = new safe_VkWriteDescriptorSet[descriptorWriteCount]; |
| 4191 | for (uint32_t index0 = 0; index0 < descriptorWriteCount; ++index0) { |
| 4192 | local_pDescriptorWrites[index0].initialize(&pDescriptorWrites[index0]); |
| 4193 | local_pDescriptorWrites[index0].pNext = CreateUnwrappedExtensionStructs(layer_data, local_pDescriptorWrites[index0].pNext); |
| 4194 | if (pDescriptorWrites[index0].dstSet) { |
| 4195 | local_pDescriptorWrites[index0].dstSet = layer_data->Unwrap(pDescriptorWrites[index0].dstSet); |
| 4196 | } |
| 4197 | if (local_pDescriptorWrites[index0].pImageInfo) { |
| 4198 | for (uint32_t index1 = 0; index1 < local_pDescriptorWrites[index0].descriptorCount; ++index1) { |
| 4199 | if (pDescriptorWrites[index0].pImageInfo[index1].sampler) { |
| 4200 | local_pDescriptorWrites[index0].pImageInfo[index1].sampler = layer_data->Unwrap(pDescriptorWrites[index0].pImageInfo[index1].sampler); |
| 4201 | } |
| 4202 | if (pDescriptorWrites[index0].pImageInfo[index1].imageView) { |
| 4203 | local_pDescriptorWrites[index0].pImageInfo[index1].imageView = layer_data->Unwrap(pDescriptorWrites[index0].pImageInfo[index1].imageView); |
| 4204 | } |
| 4205 | } |
| 4206 | } |
| 4207 | if (local_pDescriptorWrites[index0].pBufferInfo) { |
| 4208 | for (uint32_t index1 = 0; index1 < local_pDescriptorWrites[index0].descriptorCount; ++index1) { |
| 4209 | if (pDescriptorWrites[index0].pBufferInfo[index1].buffer) { |
| 4210 | local_pDescriptorWrites[index0].pBufferInfo[index1].buffer = layer_data->Unwrap(pDescriptorWrites[index0].pBufferInfo[index1].buffer); |
| 4211 | } |
| 4212 | } |
| 4213 | } |
| 4214 | if (local_pDescriptorWrites[index0].pTexelBufferView) { |
| 4215 | for (uint32_t index1 = 0; index1 < local_pDescriptorWrites[index0].descriptorCount; ++index1) { |
| 4216 | local_pDescriptorWrites[index0].pTexelBufferView[index1] = layer_data->Unwrap(local_pDescriptorWrites[index0].pTexelBufferView[index1]); |
| 4217 | } |
| 4218 | } |
| 4219 | } |
| 4220 | } |
| 4221 | if (pDescriptorCopies) { |
| 4222 | local_pDescriptorCopies = new safe_VkCopyDescriptorSet[descriptorCopyCount]; |
| 4223 | for (uint32_t index0 = 0; index0 < descriptorCopyCount; ++index0) { |
| 4224 | local_pDescriptorCopies[index0].initialize(&pDescriptorCopies[index0]); |
| 4225 | if (pDescriptorCopies[index0].srcSet) { |
| 4226 | local_pDescriptorCopies[index0].srcSet = layer_data->Unwrap(pDescriptorCopies[index0].srcSet); |
| 4227 | } |
| 4228 | if (pDescriptorCopies[index0].dstSet) { |
| 4229 | local_pDescriptorCopies[index0].dstSet = layer_data->Unwrap(pDescriptorCopies[index0].dstSet); |
| 4230 | } |
| 4231 | } |
| 4232 | } |
| 4233 | } |
| 4234 | layer_data->device_dispatch_table.UpdateDescriptorSets(device, descriptorWriteCount, (const VkWriteDescriptorSet*)local_pDescriptorWrites, descriptorCopyCount, (const VkCopyDescriptorSet*)local_pDescriptorCopies); |
| 4235 | if (local_pDescriptorWrites) { |
| 4236 | for (uint32_t index0 = 0; index0 < descriptorWriteCount; ++index0) { |
| 4237 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pDescriptorWrites[index0].pNext)); |
| 4238 | } |
| 4239 | delete[] local_pDescriptorWrites; |
| 4240 | } |
| 4241 | if (local_pDescriptorCopies) { |
| 4242 | delete[] local_pDescriptorCopies; |
| 4243 | } |
| 4244 | } |
| 4245 | |
| 4246 | VkResult DispatchCreateFramebuffer( |
| 4247 | VkDevice device, |
| 4248 | const VkFramebufferCreateInfo* pCreateInfo, |
| 4249 | const VkAllocationCallbacks* pAllocator, |
| 4250 | VkFramebuffer* pFramebuffer) |
| 4251 | { |
| 4252 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4253 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer); |
| 4254 | safe_VkFramebufferCreateInfo *local_pCreateInfo = NULL; |
| 4255 | { |
| 4256 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4257 | if (pCreateInfo) { |
| 4258 | local_pCreateInfo = new safe_VkFramebufferCreateInfo(pCreateInfo); |
| 4259 | if (pCreateInfo->renderPass) { |
| 4260 | local_pCreateInfo->renderPass = layer_data->Unwrap(pCreateInfo->renderPass); |
| 4261 | } |
| 4262 | if (local_pCreateInfo->pAttachments) { |
| 4263 | for (uint32_t index1 = 0; index1 < local_pCreateInfo->attachmentCount; ++index1) { |
| 4264 | local_pCreateInfo->pAttachments[index1] = layer_data->Unwrap(local_pCreateInfo->pAttachments[index1]); |
| 4265 | } |
| 4266 | } |
| 4267 | } |
| 4268 | } |
| 4269 | VkResult result = layer_data->device_dispatch_table.CreateFramebuffer(device, (const VkFramebufferCreateInfo*)local_pCreateInfo, pAllocator, pFramebuffer); |
| 4270 | if (local_pCreateInfo) { |
| 4271 | delete local_pCreateInfo; |
| 4272 | } |
| 4273 | if (VK_SUCCESS == result) { |
| 4274 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4275 | *pFramebuffer = layer_data->WrapNew(*pFramebuffer); |
| 4276 | } |
| 4277 | return result; |
| 4278 | } |
| 4279 | |
| 4280 | void DispatchDestroyFramebuffer( |
| 4281 | VkDevice device, |
| 4282 | VkFramebuffer framebuffer, |
| 4283 | const VkAllocationCallbacks* pAllocator) |
| 4284 | { |
| 4285 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4286 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyFramebuffer(device, framebuffer, pAllocator); |
| 4287 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 4288 | uint64_t framebuffer_id = reinterpret_cast<uint64_t &>(framebuffer); |
| 4289 | framebuffer = (VkFramebuffer)unique_id_mapping[framebuffer_id]; |
| 4290 | unique_id_mapping.erase(framebuffer_id); |
| 4291 | lock.unlock(); |
| 4292 | layer_data->device_dispatch_table.DestroyFramebuffer(device, framebuffer, pAllocator); |
| 4293 | |
| 4294 | } |
| 4295 | |
| 4296 | // Skip vkCreateRenderPass dispatch, manually generated |
| 4297 | |
| 4298 | // Skip vkDestroyRenderPass dispatch, manually generated |
| 4299 | |
| 4300 | void DispatchGetRenderAreaGranularity( |
| 4301 | VkDevice device, |
| 4302 | VkRenderPass renderPass, |
| 4303 | VkExtent2D* pGranularity) |
| 4304 | { |
| 4305 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4306 | if (!wrap_handles) return layer_data->device_dispatch_table.GetRenderAreaGranularity(device, renderPass, pGranularity); |
| 4307 | { |
| 4308 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4309 | renderPass = layer_data->Unwrap(renderPass); |
| 4310 | } |
| 4311 | layer_data->device_dispatch_table.GetRenderAreaGranularity(device, renderPass, pGranularity); |
| 4312 | |
| 4313 | } |
| 4314 | |
| 4315 | VkResult DispatchCreateCommandPool( |
| 4316 | VkDevice device, |
| 4317 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 4318 | const VkAllocationCallbacks* pAllocator, |
| 4319 | VkCommandPool* pCommandPool) |
| 4320 | { |
| 4321 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4322 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); |
| 4323 | VkResult result = layer_data->device_dispatch_table.CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); |
| 4324 | if (VK_SUCCESS == result) { |
| 4325 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4326 | *pCommandPool = layer_data->WrapNew(*pCommandPool); |
| 4327 | } |
| 4328 | return result; |
| 4329 | } |
| 4330 | |
| 4331 | void DispatchDestroyCommandPool( |
| 4332 | VkDevice device, |
| 4333 | VkCommandPool commandPool, |
| 4334 | const VkAllocationCallbacks* pAllocator) |
| 4335 | { |
| 4336 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4337 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyCommandPool(device, commandPool, pAllocator); |
| 4338 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 4339 | uint64_t commandPool_id = reinterpret_cast<uint64_t &>(commandPool); |
| 4340 | commandPool = (VkCommandPool)unique_id_mapping[commandPool_id]; |
| 4341 | unique_id_mapping.erase(commandPool_id); |
| 4342 | lock.unlock(); |
| 4343 | layer_data->device_dispatch_table.DestroyCommandPool(device, commandPool, pAllocator); |
| 4344 | |
| 4345 | } |
| 4346 | |
| 4347 | VkResult DispatchResetCommandPool( |
| 4348 | VkDevice device, |
| 4349 | VkCommandPool commandPool, |
| 4350 | VkCommandPoolResetFlags flags) |
| 4351 | { |
| 4352 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4353 | if (!wrap_handles) return layer_data->device_dispatch_table.ResetCommandPool(device, commandPool, flags); |
| 4354 | { |
| 4355 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4356 | commandPool = layer_data->Unwrap(commandPool); |
| 4357 | } |
| 4358 | VkResult result = layer_data->device_dispatch_table.ResetCommandPool(device, commandPool, flags); |
| 4359 | |
| 4360 | return result; |
| 4361 | } |
| 4362 | |
| 4363 | VkResult DispatchAllocateCommandBuffers( |
| 4364 | VkDevice device, |
| 4365 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 4366 | VkCommandBuffer* pCommandBuffers) |
| 4367 | { |
| 4368 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4369 | if (!wrap_handles) return layer_data->device_dispatch_table.AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers); |
| 4370 | safe_VkCommandBufferAllocateInfo *local_pAllocateInfo = NULL; |
| 4371 | { |
| 4372 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4373 | if (pAllocateInfo) { |
| 4374 | local_pAllocateInfo = new safe_VkCommandBufferAllocateInfo(pAllocateInfo); |
| 4375 | if (pAllocateInfo->commandPool) { |
| 4376 | local_pAllocateInfo->commandPool = layer_data->Unwrap(pAllocateInfo->commandPool); |
| 4377 | } |
| 4378 | } |
| 4379 | } |
| 4380 | VkResult result = layer_data->device_dispatch_table.AllocateCommandBuffers(device, (const VkCommandBufferAllocateInfo*)local_pAllocateInfo, pCommandBuffers); |
| 4381 | if (local_pAllocateInfo) { |
| 4382 | delete local_pAllocateInfo; |
| 4383 | } |
| 4384 | return result; |
| 4385 | } |
| 4386 | |
| 4387 | void DispatchFreeCommandBuffers( |
| 4388 | VkDevice device, |
| 4389 | VkCommandPool commandPool, |
| 4390 | uint32_t commandBufferCount, |
| 4391 | const VkCommandBuffer* pCommandBuffers) |
| 4392 | { |
| 4393 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 4394 | if (!wrap_handles) return layer_data->device_dispatch_table.FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); |
| 4395 | { |
| 4396 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4397 | commandPool = layer_data->Unwrap(commandPool); |
| 4398 | } |
| 4399 | layer_data->device_dispatch_table.FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); |
| 4400 | |
| 4401 | } |
| 4402 | |
| 4403 | VkResult DispatchBeginCommandBuffer( |
| 4404 | VkCommandBuffer commandBuffer, |
| 4405 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 4406 | { |
| 4407 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4408 | if (!wrap_handles) return layer_data->device_dispatch_table.BeginCommandBuffer(commandBuffer, pBeginInfo); |
| 4409 | safe_VkCommandBufferBeginInfo *local_pBeginInfo = NULL; |
| 4410 | { |
| 4411 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4412 | if (pBeginInfo) { |
| 4413 | local_pBeginInfo = new safe_VkCommandBufferBeginInfo(pBeginInfo); |
| 4414 | if (local_pBeginInfo->pInheritanceInfo) { |
| 4415 | if (pBeginInfo->pInheritanceInfo->renderPass) { |
| 4416 | local_pBeginInfo->pInheritanceInfo->renderPass = layer_data->Unwrap(pBeginInfo->pInheritanceInfo->renderPass); |
| 4417 | } |
| 4418 | if (pBeginInfo->pInheritanceInfo->framebuffer) { |
| 4419 | local_pBeginInfo->pInheritanceInfo->framebuffer = layer_data->Unwrap(pBeginInfo->pInheritanceInfo->framebuffer); |
| 4420 | } |
| 4421 | } |
| 4422 | } |
| 4423 | } |
| 4424 | VkResult result = layer_data->device_dispatch_table.BeginCommandBuffer(commandBuffer, (const VkCommandBufferBeginInfo*)local_pBeginInfo); |
| 4425 | if (local_pBeginInfo) { |
| 4426 | delete local_pBeginInfo; |
| 4427 | } |
| 4428 | return result; |
| 4429 | } |
| 4430 | |
| 4431 | VkResult DispatchEndCommandBuffer( |
| 4432 | VkCommandBuffer commandBuffer) |
| 4433 | { |
| 4434 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4435 | VkResult result = layer_data->device_dispatch_table.EndCommandBuffer(commandBuffer); |
| 4436 | |
| 4437 | return result; |
| 4438 | } |
| 4439 | |
| 4440 | VkResult DispatchResetCommandBuffer( |
| 4441 | VkCommandBuffer commandBuffer, |
| 4442 | VkCommandBufferResetFlags flags) |
| 4443 | { |
| 4444 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4445 | VkResult result = layer_data->device_dispatch_table.ResetCommandBuffer(commandBuffer, flags); |
| 4446 | |
| 4447 | return result; |
| 4448 | } |
| 4449 | |
| 4450 | void DispatchCmdBindPipeline( |
| 4451 | VkCommandBuffer commandBuffer, |
| 4452 | VkPipelineBindPoint pipelineBindPoint, |
| 4453 | VkPipeline pipeline) |
| 4454 | { |
| 4455 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4456 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); |
| 4457 | { |
| 4458 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4459 | pipeline = layer_data->Unwrap(pipeline); |
| 4460 | } |
| 4461 | layer_data->device_dispatch_table.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); |
| 4462 | |
| 4463 | } |
| 4464 | |
| 4465 | void DispatchCmdSetViewport( |
| 4466 | VkCommandBuffer commandBuffer, |
| 4467 | uint32_t firstViewport, |
| 4468 | uint32_t viewportCount, |
| 4469 | const VkViewport* pViewports) |
| 4470 | { |
| 4471 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4472 | layer_data->device_dispatch_table.CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports); |
| 4473 | |
| 4474 | } |
| 4475 | |
| 4476 | void DispatchCmdSetScissor( |
| 4477 | VkCommandBuffer commandBuffer, |
| 4478 | uint32_t firstScissor, |
| 4479 | uint32_t scissorCount, |
| 4480 | const VkRect2D* pScissors) |
| 4481 | { |
| 4482 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4483 | layer_data->device_dispatch_table.CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors); |
| 4484 | |
| 4485 | } |
| 4486 | |
| 4487 | void DispatchCmdSetLineWidth( |
| 4488 | VkCommandBuffer commandBuffer, |
| 4489 | float lineWidth) |
| 4490 | { |
| 4491 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4492 | layer_data->device_dispatch_table.CmdSetLineWidth(commandBuffer, lineWidth); |
| 4493 | |
| 4494 | } |
| 4495 | |
| 4496 | void DispatchCmdSetDepthBias( |
| 4497 | VkCommandBuffer commandBuffer, |
| 4498 | float depthBiasConstantFactor, |
| 4499 | float depthBiasClamp, |
| 4500 | float depthBiasSlopeFactor) |
| 4501 | { |
| 4502 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4503 | layer_data->device_dispatch_table.CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); |
| 4504 | |
| 4505 | } |
| 4506 | |
| 4507 | void DispatchCmdSetBlendConstants( |
| 4508 | VkCommandBuffer commandBuffer, |
| 4509 | const float blendConstants[4]) |
| 4510 | { |
| 4511 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4512 | layer_data->device_dispatch_table.CmdSetBlendConstants(commandBuffer, blendConstants); |
| 4513 | |
| 4514 | } |
| 4515 | |
| 4516 | void DispatchCmdSetDepthBounds( |
| 4517 | VkCommandBuffer commandBuffer, |
| 4518 | float minDepthBounds, |
| 4519 | float maxDepthBounds) |
| 4520 | { |
| 4521 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4522 | layer_data->device_dispatch_table.CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds); |
| 4523 | |
| 4524 | } |
| 4525 | |
| 4526 | void DispatchCmdSetStencilCompareMask( |
| 4527 | VkCommandBuffer commandBuffer, |
| 4528 | VkStencilFaceFlags faceMask, |
| 4529 | uint32_t compareMask) |
| 4530 | { |
| 4531 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4532 | layer_data->device_dispatch_table.CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask); |
| 4533 | |
| 4534 | } |
| 4535 | |
| 4536 | void DispatchCmdSetStencilWriteMask( |
| 4537 | VkCommandBuffer commandBuffer, |
| 4538 | VkStencilFaceFlags faceMask, |
| 4539 | uint32_t writeMask) |
| 4540 | { |
| 4541 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4542 | layer_data->device_dispatch_table.CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask); |
| 4543 | |
| 4544 | } |
| 4545 | |
| 4546 | void DispatchCmdSetStencilReference( |
| 4547 | VkCommandBuffer commandBuffer, |
| 4548 | VkStencilFaceFlags faceMask, |
| 4549 | uint32_t reference) |
| 4550 | { |
| 4551 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4552 | layer_data->device_dispatch_table.CmdSetStencilReference(commandBuffer, faceMask, reference); |
| 4553 | |
| 4554 | } |
| 4555 | |
| 4556 | void DispatchCmdBindDescriptorSets( |
| 4557 | VkCommandBuffer commandBuffer, |
| 4558 | VkPipelineBindPoint pipelineBindPoint, |
| 4559 | VkPipelineLayout layout, |
| 4560 | uint32_t firstSet, |
| 4561 | uint32_t descriptorSetCount, |
| 4562 | const VkDescriptorSet* pDescriptorSets, |
| 4563 | uint32_t dynamicOffsetCount, |
| 4564 | const uint32_t* pDynamicOffsets) |
| 4565 | { |
| 4566 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4567 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 4568 | VkDescriptorSet *local_pDescriptorSets = NULL; |
| 4569 | { |
| 4570 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4571 | layout = layer_data->Unwrap(layout); |
| 4572 | if (pDescriptorSets) { |
| 4573 | local_pDescriptorSets = new VkDescriptorSet[descriptorSetCount]; |
| 4574 | for (uint32_t index0 = 0; index0 < descriptorSetCount; ++index0) { |
| 4575 | local_pDescriptorSets[index0] = layer_data->Unwrap(pDescriptorSets[index0]); |
| 4576 | } |
| 4577 | } |
| 4578 | } |
| 4579 | layer_data->device_dispatch_table.CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, (const VkDescriptorSet*)local_pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 4580 | if (local_pDescriptorSets) |
| 4581 | delete[] local_pDescriptorSets; |
| 4582 | } |
| 4583 | |
| 4584 | void DispatchCmdBindIndexBuffer( |
| 4585 | VkCommandBuffer commandBuffer, |
| 4586 | VkBuffer buffer, |
| 4587 | VkDeviceSize offset, |
| 4588 | VkIndexType indexType) |
| 4589 | { |
| 4590 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4591 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); |
| 4592 | { |
| 4593 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4594 | buffer = layer_data->Unwrap(buffer); |
| 4595 | } |
| 4596 | layer_data->device_dispatch_table.CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); |
| 4597 | |
| 4598 | } |
| 4599 | |
| 4600 | void DispatchCmdBindVertexBuffers( |
| 4601 | VkCommandBuffer commandBuffer, |
| 4602 | uint32_t firstBinding, |
| 4603 | uint32_t bindingCount, |
| 4604 | const VkBuffer* pBuffers, |
| 4605 | const VkDeviceSize* pOffsets) |
| 4606 | { |
| 4607 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4608 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets); |
| 4609 | VkBuffer *local_pBuffers = NULL; |
| 4610 | { |
| 4611 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4612 | if (pBuffers) { |
| 4613 | local_pBuffers = new VkBuffer[bindingCount]; |
| 4614 | for (uint32_t index0 = 0; index0 < bindingCount; ++index0) { |
| 4615 | local_pBuffers[index0] = layer_data->Unwrap(pBuffers[index0]); |
| 4616 | } |
| 4617 | } |
| 4618 | } |
| 4619 | layer_data->device_dispatch_table.CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, (const VkBuffer*)local_pBuffers, pOffsets); |
| 4620 | if (local_pBuffers) |
| 4621 | delete[] local_pBuffers; |
| 4622 | } |
| 4623 | |
| 4624 | void DispatchCmdDraw( |
| 4625 | VkCommandBuffer commandBuffer, |
| 4626 | uint32_t vertexCount, |
| 4627 | uint32_t instanceCount, |
| 4628 | uint32_t firstVertex, |
| 4629 | uint32_t firstInstance) |
| 4630 | { |
| 4631 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4632 | layer_data->device_dispatch_table.CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
| 4633 | |
| 4634 | } |
| 4635 | |
| 4636 | void DispatchCmdDrawIndexed( |
| 4637 | VkCommandBuffer commandBuffer, |
| 4638 | uint32_t indexCount, |
| 4639 | uint32_t instanceCount, |
| 4640 | uint32_t firstIndex, |
| 4641 | int32_t vertexOffset, |
| 4642 | uint32_t firstInstance) |
| 4643 | { |
| 4644 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4645 | layer_data->device_dispatch_table.CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); |
| 4646 | |
| 4647 | } |
| 4648 | |
| 4649 | void DispatchCmdDrawIndirect( |
| 4650 | VkCommandBuffer commandBuffer, |
| 4651 | VkBuffer buffer, |
| 4652 | VkDeviceSize offset, |
| 4653 | uint32_t drawCount, |
| 4654 | uint32_t stride) |
| 4655 | { |
| 4656 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4657 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride); |
| 4658 | { |
| 4659 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4660 | buffer = layer_data->Unwrap(buffer); |
| 4661 | } |
| 4662 | layer_data->device_dispatch_table.CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride); |
| 4663 | |
| 4664 | } |
| 4665 | |
| 4666 | void DispatchCmdDrawIndexedIndirect( |
| 4667 | VkCommandBuffer commandBuffer, |
| 4668 | VkBuffer buffer, |
| 4669 | VkDeviceSize offset, |
| 4670 | uint32_t drawCount, |
| 4671 | uint32_t stride) |
| 4672 | { |
| 4673 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4674 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride); |
| 4675 | { |
| 4676 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4677 | buffer = layer_data->Unwrap(buffer); |
| 4678 | } |
| 4679 | layer_data->device_dispatch_table.CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride); |
| 4680 | |
| 4681 | } |
| 4682 | |
| 4683 | void DispatchCmdDispatch( |
| 4684 | VkCommandBuffer commandBuffer, |
| 4685 | uint32_t groupCountX, |
| 4686 | uint32_t groupCountY, |
| 4687 | uint32_t groupCountZ) |
| 4688 | { |
| 4689 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4690 | layer_data->device_dispatch_table.CmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ); |
| 4691 | |
| 4692 | } |
| 4693 | |
| 4694 | void DispatchCmdDispatchIndirect( |
| 4695 | VkCommandBuffer commandBuffer, |
| 4696 | VkBuffer buffer, |
| 4697 | VkDeviceSize offset) |
| 4698 | { |
| 4699 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4700 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDispatchIndirect(commandBuffer, buffer, offset); |
| 4701 | { |
| 4702 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4703 | buffer = layer_data->Unwrap(buffer); |
| 4704 | } |
| 4705 | layer_data->device_dispatch_table.CmdDispatchIndirect(commandBuffer, buffer, offset); |
| 4706 | |
| 4707 | } |
| 4708 | |
| 4709 | void DispatchCmdCopyBuffer( |
| 4710 | VkCommandBuffer commandBuffer, |
| 4711 | VkBuffer srcBuffer, |
| 4712 | VkBuffer dstBuffer, |
| 4713 | uint32_t regionCount, |
| 4714 | const VkBufferCopy* pRegions) |
| 4715 | { |
| 4716 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4717 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); |
| 4718 | { |
| 4719 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4720 | srcBuffer = layer_data->Unwrap(srcBuffer); |
| 4721 | dstBuffer = layer_data->Unwrap(dstBuffer); |
| 4722 | } |
| 4723 | layer_data->device_dispatch_table.CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); |
| 4724 | |
| 4725 | } |
| 4726 | |
| 4727 | void DispatchCmdCopyImage( |
| 4728 | VkCommandBuffer commandBuffer, |
| 4729 | VkImage srcImage, |
| 4730 | VkImageLayout srcImageLayout, |
| 4731 | VkImage dstImage, |
| 4732 | VkImageLayout dstImageLayout, |
| 4733 | uint32_t regionCount, |
| 4734 | const VkImageCopy* pRegions) |
| 4735 | { |
| 4736 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4737 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
| 4738 | { |
| 4739 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4740 | srcImage = layer_data->Unwrap(srcImage); |
| 4741 | dstImage = layer_data->Unwrap(dstImage); |
| 4742 | } |
| 4743 | layer_data->device_dispatch_table.CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
| 4744 | |
| 4745 | } |
| 4746 | |
| 4747 | void DispatchCmdBlitImage( |
| 4748 | VkCommandBuffer commandBuffer, |
| 4749 | VkImage srcImage, |
| 4750 | VkImageLayout srcImageLayout, |
| 4751 | VkImage dstImage, |
| 4752 | VkImageLayout dstImageLayout, |
| 4753 | uint32_t regionCount, |
| 4754 | const VkImageBlit* pRegions, |
| 4755 | VkFilter filter) |
| 4756 | { |
| 4757 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4758 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); |
| 4759 | { |
| 4760 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4761 | srcImage = layer_data->Unwrap(srcImage); |
| 4762 | dstImage = layer_data->Unwrap(dstImage); |
| 4763 | } |
| 4764 | layer_data->device_dispatch_table.CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); |
| 4765 | |
| 4766 | } |
| 4767 | |
| 4768 | void DispatchCmdCopyBufferToImage( |
| 4769 | VkCommandBuffer commandBuffer, |
| 4770 | VkBuffer srcBuffer, |
| 4771 | VkImage dstImage, |
| 4772 | VkImageLayout dstImageLayout, |
| 4773 | uint32_t regionCount, |
| 4774 | const VkBufferImageCopy* pRegions) |
| 4775 | { |
| 4776 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4777 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
| 4778 | { |
| 4779 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4780 | srcBuffer = layer_data->Unwrap(srcBuffer); |
| 4781 | dstImage = layer_data->Unwrap(dstImage); |
| 4782 | } |
| 4783 | layer_data->device_dispatch_table.CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
| 4784 | |
| 4785 | } |
| 4786 | |
| 4787 | void DispatchCmdCopyImageToBuffer( |
| 4788 | VkCommandBuffer commandBuffer, |
| 4789 | VkImage srcImage, |
| 4790 | VkImageLayout srcImageLayout, |
| 4791 | VkBuffer dstBuffer, |
| 4792 | uint32_t regionCount, |
| 4793 | const VkBufferImageCopy* pRegions) |
| 4794 | { |
| 4795 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4796 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
| 4797 | { |
| 4798 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4799 | srcImage = layer_data->Unwrap(srcImage); |
| 4800 | dstBuffer = layer_data->Unwrap(dstBuffer); |
| 4801 | } |
| 4802 | layer_data->device_dispatch_table.CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
| 4803 | |
| 4804 | } |
| 4805 | |
| 4806 | void DispatchCmdUpdateBuffer( |
| 4807 | VkCommandBuffer commandBuffer, |
| 4808 | VkBuffer dstBuffer, |
| 4809 | VkDeviceSize dstOffset, |
| 4810 | VkDeviceSize dataSize, |
| 4811 | const void* pData) |
| 4812 | { |
| 4813 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4814 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); |
| 4815 | { |
| 4816 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4817 | dstBuffer = layer_data->Unwrap(dstBuffer); |
| 4818 | } |
| 4819 | layer_data->device_dispatch_table.CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); |
| 4820 | |
| 4821 | } |
| 4822 | |
| 4823 | void DispatchCmdFillBuffer( |
| 4824 | VkCommandBuffer commandBuffer, |
| 4825 | VkBuffer dstBuffer, |
| 4826 | VkDeviceSize dstOffset, |
| 4827 | VkDeviceSize size, |
| 4828 | uint32_t data) |
| 4829 | { |
| 4830 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4831 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); |
| 4832 | { |
| 4833 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4834 | dstBuffer = layer_data->Unwrap(dstBuffer); |
| 4835 | } |
| 4836 | layer_data->device_dispatch_table.CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); |
| 4837 | |
| 4838 | } |
| 4839 | |
| 4840 | void DispatchCmdClearColorImage( |
| 4841 | VkCommandBuffer commandBuffer, |
| 4842 | VkImage image, |
| 4843 | VkImageLayout imageLayout, |
| 4844 | const VkClearColorValue* pColor, |
| 4845 | uint32_t rangeCount, |
| 4846 | const VkImageSubresourceRange* pRanges) |
| 4847 | { |
| 4848 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4849 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 4850 | { |
| 4851 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4852 | image = layer_data->Unwrap(image); |
| 4853 | } |
| 4854 | layer_data->device_dispatch_table.CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 4855 | |
| 4856 | } |
| 4857 | |
| 4858 | void DispatchCmdClearDepthStencilImage( |
| 4859 | VkCommandBuffer commandBuffer, |
| 4860 | VkImage image, |
| 4861 | VkImageLayout imageLayout, |
| 4862 | const VkClearDepthStencilValue* pDepthStencil, |
| 4863 | uint32_t rangeCount, |
| 4864 | const VkImageSubresourceRange* pRanges) |
| 4865 | { |
| 4866 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4867 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
| 4868 | { |
| 4869 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4870 | image = layer_data->Unwrap(image); |
| 4871 | } |
| 4872 | layer_data->device_dispatch_table.CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
| 4873 | |
| 4874 | } |
| 4875 | |
| 4876 | void DispatchCmdClearAttachments( |
| 4877 | VkCommandBuffer commandBuffer, |
| 4878 | uint32_t attachmentCount, |
| 4879 | const VkClearAttachment* pAttachments, |
| 4880 | uint32_t rectCount, |
| 4881 | const VkClearRect* pRects) |
| 4882 | { |
| 4883 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4884 | layer_data->device_dispatch_table.CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects); |
| 4885 | |
| 4886 | } |
| 4887 | |
| 4888 | void DispatchCmdResolveImage( |
| 4889 | VkCommandBuffer commandBuffer, |
| 4890 | VkImage srcImage, |
| 4891 | VkImageLayout srcImageLayout, |
| 4892 | VkImage dstImage, |
| 4893 | VkImageLayout dstImageLayout, |
| 4894 | uint32_t regionCount, |
| 4895 | const VkImageResolve* pRegions) |
| 4896 | { |
| 4897 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4898 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
| 4899 | { |
| 4900 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4901 | srcImage = layer_data->Unwrap(srcImage); |
| 4902 | dstImage = layer_data->Unwrap(dstImage); |
| 4903 | } |
| 4904 | layer_data->device_dispatch_table.CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
| 4905 | |
| 4906 | } |
| 4907 | |
| 4908 | void DispatchCmdSetEvent( |
| 4909 | VkCommandBuffer commandBuffer, |
| 4910 | VkEvent event, |
| 4911 | VkPipelineStageFlags stageMask) |
| 4912 | { |
| 4913 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4914 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdSetEvent(commandBuffer, event, stageMask); |
| 4915 | { |
| 4916 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4917 | event = layer_data->Unwrap(event); |
| 4918 | } |
| 4919 | layer_data->device_dispatch_table.CmdSetEvent(commandBuffer, event, stageMask); |
| 4920 | |
| 4921 | } |
| 4922 | |
| 4923 | void DispatchCmdResetEvent( |
| 4924 | VkCommandBuffer commandBuffer, |
| 4925 | VkEvent event, |
| 4926 | VkPipelineStageFlags stageMask) |
| 4927 | { |
| 4928 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4929 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdResetEvent(commandBuffer, event, stageMask); |
| 4930 | { |
| 4931 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4932 | event = layer_data->Unwrap(event); |
| 4933 | } |
| 4934 | layer_data->device_dispatch_table.CmdResetEvent(commandBuffer, event, stageMask); |
| 4935 | |
| 4936 | } |
| 4937 | |
| 4938 | void DispatchCmdWaitEvents( |
| 4939 | VkCommandBuffer commandBuffer, |
| 4940 | uint32_t eventCount, |
| 4941 | const VkEvent* pEvents, |
| 4942 | VkPipelineStageFlags srcStageMask, |
| 4943 | VkPipelineStageFlags dstStageMask, |
| 4944 | uint32_t memoryBarrierCount, |
| 4945 | const VkMemoryBarrier* pMemoryBarriers, |
| 4946 | uint32_t bufferMemoryBarrierCount, |
| 4947 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 4948 | uint32_t imageMemoryBarrierCount, |
| 4949 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 4950 | { |
| 4951 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 4952 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
| 4953 | VkEvent *local_pEvents = NULL; |
| 4954 | safe_VkBufferMemoryBarrier *local_pBufferMemoryBarriers = NULL; |
| 4955 | safe_VkImageMemoryBarrier *local_pImageMemoryBarriers = NULL; |
| 4956 | { |
| 4957 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 4958 | if (pEvents) { |
| 4959 | local_pEvents = new VkEvent[eventCount]; |
| 4960 | for (uint32_t index0 = 0; index0 < eventCount; ++index0) { |
| 4961 | local_pEvents[index0] = layer_data->Unwrap(pEvents[index0]); |
| 4962 | } |
| 4963 | } |
| 4964 | if (pBufferMemoryBarriers) { |
| 4965 | local_pBufferMemoryBarriers = new safe_VkBufferMemoryBarrier[bufferMemoryBarrierCount]; |
| 4966 | for (uint32_t index0 = 0; index0 < bufferMemoryBarrierCount; ++index0) { |
| 4967 | local_pBufferMemoryBarriers[index0].initialize(&pBufferMemoryBarriers[index0]); |
| 4968 | if (pBufferMemoryBarriers[index0].buffer) { |
| 4969 | local_pBufferMemoryBarriers[index0].buffer = layer_data->Unwrap(pBufferMemoryBarriers[index0].buffer); |
| 4970 | } |
| 4971 | } |
| 4972 | } |
| 4973 | if (pImageMemoryBarriers) { |
| 4974 | local_pImageMemoryBarriers = new safe_VkImageMemoryBarrier[imageMemoryBarrierCount]; |
| 4975 | for (uint32_t index0 = 0; index0 < imageMemoryBarrierCount; ++index0) { |
| 4976 | local_pImageMemoryBarriers[index0].initialize(&pImageMemoryBarriers[index0]); |
| 4977 | if (pImageMemoryBarriers[index0].image) { |
| 4978 | local_pImageMemoryBarriers[index0].image = layer_data->Unwrap(pImageMemoryBarriers[index0].image); |
| 4979 | } |
| 4980 | } |
| 4981 | } |
| 4982 | } |
| 4983 | layer_data->device_dispatch_table.CmdWaitEvents(commandBuffer, eventCount, (const VkEvent*)local_pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, (const VkBufferMemoryBarrier*)local_pBufferMemoryBarriers, imageMemoryBarrierCount, (const VkImageMemoryBarrier*)local_pImageMemoryBarriers); |
| 4984 | if (local_pEvents) |
| 4985 | delete[] local_pEvents; |
| 4986 | if (local_pBufferMemoryBarriers) { |
| 4987 | delete[] local_pBufferMemoryBarriers; |
| 4988 | } |
| 4989 | if (local_pImageMemoryBarriers) { |
| 4990 | delete[] local_pImageMemoryBarriers; |
| 4991 | } |
| 4992 | } |
| 4993 | |
| 4994 | void DispatchCmdPipelineBarrier( |
| 4995 | VkCommandBuffer commandBuffer, |
| 4996 | VkPipelineStageFlags srcStageMask, |
| 4997 | VkPipelineStageFlags dstStageMask, |
| 4998 | VkDependencyFlags dependencyFlags, |
| 4999 | uint32_t memoryBarrierCount, |
| 5000 | const VkMemoryBarrier* pMemoryBarriers, |
| 5001 | uint32_t bufferMemoryBarrierCount, |
| 5002 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 5003 | uint32_t imageMemoryBarrierCount, |
| 5004 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 5005 | { |
| 5006 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5007 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
| 5008 | safe_VkBufferMemoryBarrier *local_pBufferMemoryBarriers = NULL; |
| 5009 | safe_VkImageMemoryBarrier *local_pImageMemoryBarriers = NULL; |
| 5010 | { |
| 5011 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5012 | if (pBufferMemoryBarriers) { |
| 5013 | local_pBufferMemoryBarriers = new safe_VkBufferMemoryBarrier[bufferMemoryBarrierCount]; |
| 5014 | for (uint32_t index0 = 0; index0 < bufferMemoryBarrierCount; ++index0) { |
| 5015 | local_pBufferMemoryBarriers[index0].initialize(&pBufferMemoryBarriers[index0]); |
| 5016 | if (pBufferMemoryBarriers[index0].buffer) { |
| 5017 | local_pBufferMemoryBarriers[index0].buffer = layer_data->Unwrap(pBufferMemoryBarriers[index0].buffer); |
| 5018 | } |
| 5019 | } |
| 5020 | } |
| 5021 | if (pImageMemoryBarriers) { |
| 5022 | local_pImageMemoryBarriers = new safe_VkImageMemoryBarrier[imageMemoryBarrierCount]; |
| 5023 | for (uint32_t index0 = 0; index0 < imageMemoryBarrierCount; ++index0) { |
| 5024 | local_pImageMemoryBarriers[index0].initialize(&pImageMemoryBarriers[index0]); |
| 5025 | if (pImageMemoryBarriers[index0].image) { |
| 5026 | local_pImageMemoryBarriers[index0].image = layer_data->Unwrap(pImageMemoryBarriers[index0].image); |
| 5027 | } |
| 5028 | } |
| 5029 | } |
| 5030 | } |
| 5031 | layer_data->device_dispatch_table.CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, (const VkBufferMemoryBarrier*)local_pBufferMemoryBarriers, imageMemoryBarrierCount, (const VkImageMemoryBarrier*)local_pImageMemoryBarriers); |
| 5032 | if (local_pBufferMemoryBarriers) { |
| 5033 | delete[] local_pBufferMemoryBarriers; |
| 5034 | } |
| 5035 | if (local_pImageMemoryBarriers) { |
| 5036 | delete[] local_pImageMemoryBarriers; |
| 5037 | } |
| 5038 | } |
| 5039 | |
| 5040 | void DispatchCmdBeginQuery( |
| 5041 | VkCommandBuffer commandBuffer, |
| 5042 | VkQueryPool queryPool, |
| 5043 | uint32_t query, |
| 5044 | VkQueryControlFlags flags) |
| 5045 | { |
| 5046 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5047 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBeginQuery(commandBuffer, queryPool, query, flags); |
| 5048 | { |
| 5049 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5050 | queryPool = layer_data->Unwrap(queryPool); |
| 5051 | } |
| 5052 | layer_data->device_dispatch_table.CmdBeginQuery(commandBuffer, queryPool, query, flags); |
| 5053 | |
| 5054 | } |
| 5055 | |
| 5056 | void DispatchCmdEndQuery( |
| 5057 | VkCommandBuffer commandBuffer, |
| 5058 | VkQueryPool queryPool, |
| 5059 | uint32_t query) |
| 5060 | { |
| 5061 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5062 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdEndQuery(commandBuffer, queryPool, query); |
| 5063 | { |
| 5064 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5065 | queryPool = layer_data->Unwrap(queryPool); |
| 5066 | } |
| 5067 | layer_data->device_dispatch_table.CmdEndQuery(commandBuffer, queryPool, query); |
| 5068 | |
| 5069 | } |
| 5070 | |
| 5071 | void DispatchCmdResetQueryPool( |
| 5072 | VkCommandBuffer commandBuffer, |
| 5073 | VkQueryPool queryPool, |
| 5074 | uint32_t firstQuery, |
| 5075 | uint32_t queryCount) |
| 5076 | { |
| 5077 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5078 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); |
| 5079 | { |
| 5080 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5081 | queryPool = layer_data->Unwrap(queryPool); |
| 5082 | } |
| 5083 | layer_data->device_dispatch_table.CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); |
| 5084 | |
| 5085 | } |
| 5086 | |
| 5087 | void DispatchCmdWriteTimestamp( |
| 5088 | VkCommandBuffer commandBuffer, |
| 5089 | VkPipelineStageFlagBits pipelineStage, |
| 5090 | VkQueryPool queryPool, |
| 5091 | uint32_t query) |
| 5092 | { |
| 5093 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5094 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
| 5095 | { |
| 5096 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5097 | queryPool = layer_data->Unwrap(queryPool); |
| 5098 | } |
| 5099 | layer_data->device_dispatch_table.CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
| 5100 | |
| 5101 | } |
| 5102 | |
| 5103 | void DispatchCmdCopyQueryPoolResults( |
| 5104 | VkCommandBuffer commandBuffer, |
| 5105 | VkQueryPool queryPool, |
| 5106 | uint32_t firstQuery, |
| 5107 | uint32_t queryCount, |
| 5108 | VkBuffer dstBuffer, |
| 5109 | VkDeviceSize dstOffset, |
| 5110 | VkDeviceSize stride, |
| 5111 | VkQueryResultFlags flags) |
| 5112 | { |
| 5113 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5114 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags); |
| 5115 | { |
| 5116 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5117 | queryPool = layer_data->Unwrap(queryPool); |
| 5118 | dstBuffer = layer_data->Unwrap(dstBuffer); |
| 5119 | } |
| 5120 | layer_data->device_dispatch_table.CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags); |
| 5121 | |
| 5122 | } |
| 5123 | |
| 5124 | void DispatchCmdPushConstants( |
| 5125 | VkCommandBuffer commandBuffer, |
| 5126 | VkPipelineLayout layout, |
| 5127 | VkShaderStageFlags stageFlags, |
| 5128 | uint32_t offset, |
| 5129 | uint32_t size, |
| 5130 | const void* pValues) |
| 5131 | { |
| 5132 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5133 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues); |
| 5134 | { |
| 5135 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5136 | layout = layer_data->Unwrap(layout); |
| 5137 | } |
| 5138 | layer_data->device_dispatch_table.CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues); |
| 5139 | |
| 5140 | } |
| 5141 | |
| 5142 | void DispatchCmdBeginRenderPass( |
| 5143 | VkCommandBuffer commandBuffer, |
| 5144 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 5145 | VkSubpassContents contents) |
| 5146 | { |
| 5147 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5148 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents); |
| 5149 | safe_VkRenderPassBeginInfo *local_pRenderPassBegin = NULL; |
| 5150 | { |
| 5151 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5152 | if (pRenderPassBegin) { |
| 5153 | local_pRenderPassBegin = new safe_VkRenderPassBeginInfo(pRenderPassBegin); |
| 5154 | if (pRenderPassBegin->renderPass) { |
| 5155 | local_pRenderPassBegin->renderPass = layer_data->Unwrap(pRenderPassBegin->renderPass); |
| 5156 | } |
| 5157 | if (pRenderPassBegin->framebuffer) { |
| 5158 | local_pRenderPassBegin->framebuffer = layer_data->Unwrap(pRenderPassBegin->framebuffer); |
| 5159 | } |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 5160 | local_pRenderPassBegin->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pRenderPassBegin->pNext); |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 5161 | } |
| 5162 | } |
| 5163 | layer_data->device_dispatch_table.CmdBeginRenderPass(commandBuffer, (const VkRenderPassBeginInfo*)local_pRenderPassBegin, contents); |
| 5164 | if (local_pRenderPassBegin) { |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 5165 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pRenderPassBegin->pNext)); |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 5166 | delete local_pRenderPassBegin; |
| 5167 | } |
| 5168 | } |
| 5169 | |
| 5170 | void DispatchCmdNextSubpass( |
| 5171 | VkCommandBuffer commandBuffer, |
| 5172 | VkSubpassContents contents) |
| 5173 | { |
| 5174 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5175 | layer_data->device_dispatch_table.CmdNextSubpass(commandBuffer, contents); |
| 5176 | |
| 5177 | } |
| 5178 | |
| 5179 | void DispatchCmdEndRenderPass( |
| 5180 | VkCommandBuffer commandBuffer) |
| 5181 | { |
| 5182 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5183 | layer_data->device_dispatch_table.CmdEndRenderPass(commandBuffer); |
| 5184 | |
| 5185 | } |
| 5186 | |
| 5187 | void DispatchCmdExecuteCommands( |
| 5188 | VkCommandBuffer commandBuffer, |
| 5189 | uint32_t commandBufferCount, |
| 5190 | const VkCommandBuffer* pCommandBuffers) |
| 5191 | { |
| 5192 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5193 | layer_data->device_dispatch_table.CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers); |
| 5194 | |
| 5195 | } |
| 5196 | |
| 5197 | // Skip vkEnumerateInstanceVersion dispatch, manually generated |
| 5198 | |
| 5199 | VkResult DispatchBindBufferMemory2( |
| 5200 | VkDevice device, |
| 5201 | uint32_t bindInfoCount, |
| 5202 | const VkBindBufferMemoryInfo* pBindInfos) |
| 5203 | { |
| 5204 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5205 | if (!wrap_handles) return layer_data->device_dispatch_table.BindBufferMemory2(device, bindInfoCount, pBindInfos); |
| 5206 | safe_VkBindBufferMemoryInfo *local_pBindInfos = NULL; |
| 5207 | { |
| 5208 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5209 | if (pBindInfos) { |
| 5210 | local_pBindInfos = new safe_VkBindBufferMemoryInfo[bindInfoCount]; |
| 5211 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 5212 | local_pBindInfos[index0].initialize(&pBindInfos[index0]); |
| 5213 | if (pBindInfos[index0].buffer) { |
| 5214 | local_pBindInfos[index0].buffer = layer_data->Unwrap(pBindInfos[index0].buffer); |
| 5215 | } |
| 5216 | if (pBindInfos[index0].memory) { |
| 5217 | local_pBindInfos[index0].memory = layer_data->Unwrap(pBindInfos[index0].memory); |
| 5218 | } |
| 5219 | } |
| 5220 | } |
| 5221 | } |
| 5222 | VkResult result = layer_data->device_dispatch_table.BindBufferMemory2(device, bindInfoCount, (const VkBindBufferMemoryInfo*)local_pBindInfos); |
| 5223 | if (local_pBindInfos) { |
| 5224 | delete[] local_pBindInfos; |
| 5225 | } |
| 5226 | return result; |
| 5227 | } |
| 5228 | |
| 5229 | VkResult DispatchBindImageMemory2( |
| 5230 | VkDevice device, |
| 5231 | uint32_t bindInfoCount, |
| 5232 | const VkBindImageMemoryInfo* pBindInfos) |
| 5233 | { |
| 5234 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5235 | if (!wrap_handles) return layer_data->device_dispatch_table.BindImageMemory2(device, bindInfoCount, pBindInfos); |
| 5236 | safe_VkBindImageMemoryInfo *local_pBindInfos = NULL; |
| 5237 | { |
| 5238 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5239 | if (pBindInfos) { |
| 5240 | local_pBindInfos = new safe_VkBindImageMemoryInfo[bindInfoCount]; |
| 5241 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 5242 | local_pBindInfos[index0].initialize(&pBindInfos[index0]); |
| 5243 | local_pBindInfos[index0].pNext = CreateUnwrappedExtensionStructs(layer_data, local_pBindInfos[index0].pNext); |
| 5244 | if (pBindInfos[index0].image) { |
| 5245 | local_pBindInfos[index0].image = layer_data->Unwrap(pBindInfos[index0].image); |
| 5246 | } |
| 5247 | if (pBindInfos[index0].memory) { |
| 5248 | local_pBindInfos[index0].memory = layer_data->Unwrap(pBindInfos[index0].memory); |
| 5249 | } |
| 5250 | } |
| 5251 | } |
| 5252 | } |
| 5253 | VkResult result = layer_data->device_dispatch_table.BindImageMemory2(device, bindInfoCount, (const VkBindImageMemoryInfo*)local_pBindInfos); |
| 5254 | if (local_pBindInfos) { |
| 5255 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 5256 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pBindInfos[index0].pNext)); |
| 5257 | } |
| 5258 | delete[] local_pBindInfos; |
| 5259 | } |
| 5260 | return result; |
| 5261 | } |
| 5262 | |
| 5263 | void DispatchGetDeviceGroupPeerMemoryFeatures( |
| 5264 | VkDevice device, |
| 5265 | uint32_t heapIndex, |
| 5266 | uint32_t localDeviceIndex, |
| 5267 | uint32_t remoteDeviceIndex, |
| 5268 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 5269 | { |
| 5270 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5271 | layer_data->device_dispatch_table.GetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); |
| 5272 | |
| 5273 | } |
| 5274 | |
| 5275 | void DispatchCmdSetDeviceMask( |
| 5276 | VkCommandBuffer commandBuffer, |
| 5277 | uint32_t deviceMask) |
| 5278 | { |
| 5279 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5280 | layer_data->device_dispatch_table.CmdSetDeviceMask(commandBuffer, deviceMask); |
| 5281 | |
| 5282 | } |
| 5283 | |
| 5284 | void DispatchCmdDispatchBase( |
| 5285 | VkCommandBuffer commandBuffer, |
| 5286 | uint32_t baseGroupX, |
| 5287 | uint32_t baseGroupY, |
| 5288 | uint32_t baseGroupZ, |
| 5289 | uint32_t groupCountX, |
| 5290 | uint32_t groupCountY, |
| 5291 | uint32_t groupCountZ) |
| 5292 | { |
| 5293 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5294 | layer_data->device_dispatch_table.CmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); |
| 5295 | |
| 5296 | } |
| 5297 | |
| 5298 | VkResult DispatchEnumeratePhysicalDeviceGroups( |
| 5299 | VkInstance instance, |
| 5300 | uint32_t* pPhysicalDeviceGroupCount, |
| 5301 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 5302 | { |
| 5303 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5304 | VkResult result = layer_data->instance_dispatch_table.EnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); |
| 5305 | |
| 5306 | return result; |
| 5307 | } |
| 5308 | |
| 5309 | void DispatchGetImageMemoryRequirements2( |
| 5310 | VkDevice device, |
| 5311 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 5312 | VkMemoryRequirements2* pMemoryRequirements) |
| 5313 | { |
| 5314 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5315 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageMemoryRequirements2(device, pInfo, pMemoryRequirements); |
| 5316 | safe_VkImageMemoryRequirementsInfo2 *local_pInfo = NULL; |
| 5317 | { |
| 5318 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5319 | if (pInfo) { |
| 5320 | local_pInfo = new safe_VkImageMemoryRequirementsInfo2(pInfo); |
| 5321 | if (pInfo->image) { |
| 5322 | local_pInfo->image = layer_data->Unwrap(pInfo->image); |
| 5323 | } |
| 5324 | } |
| 5325 | } |
| 5326 | layer_data->device_dispatch_table.GetImageMemoryRequirements2(device, (const VkImageMemoryRequirementsInfo2*)local_pInfo, pMemoryRequirements); |
| 5327 | if (local_pInfo) { |
| 5328 | delete local_pInfo; |
| 5329 | } |
| 5330 | } |
| 5331 | |
| 5332 | void DispatchGetBufferMemoryRequirements2( |
| 5333 | VkDevice device, |
| 5334 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 5335 | VkMemoryRequirements2* pMemoryRequirements) |
| 5336 | { |
| 5337 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5338 | if (!wrap_handles) return layer_data->device_dispatch_table.GetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements); |
| 5339 | safe_VkBufferMemoryRequirementsInfo2 *local_pInfo = NULL; |
| 5340 | { |
| 5341 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5342 | if (pInfo) { |
| 5343 | local_pInfo = new safe_VkBufferMemoryRequirementsInfo2(pInfo); |
| 5344 | if (pInfo->buffer) { |
| 5345 | local_pInfo->buffer = layer_data->Unwrap(pInfo->buffer); |
| 5346 | } |
| 5347 | } |
| 5348 | } |
| 5349 | layer_data->device_dispatch_table.GetBufferMemoryRequirements2(device, (const VkBufferMemoryRequirementsInfo2*)local_pInfo, pMemoryRequirements); |
| 5350 | if (local_pInfo) { |
| 5351 | delete local_pInfo; |
| 5352 | } |
| 5353 | } |
| 5354 | |
| 5355 | void DispatchGetImageSparseMemoryRequirements2( |
| 5356 | VkDevice device, |
| 5357 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 5358 | uint32_t* pSparseMemoryRequirementCount, |
| 5359 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 5360 | { |
| 5361 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5362 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 5363 | safe_VkImageSparseMemoryRequirementsInfo2 *local_pInfo = NULL; |
| 5364 | { |
| 5365 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5366 | if (pInfo) { |
| 5367 | local_pInfo = new safe_VkImageSparseMemoryRequirementsInfo2(pInfo); |
| 5368 | if (pInfo->image) { |
| 5369 | local_pInfo->image = layer_data->Unwrap(pInfo->image); |
| 5370 | } |
| 5371 | } |
| 5372 | } |
| 5373 | layer_data->device_dispatch_table.GetImageSparseMemoryRequirements2(device, (const VkImageSparseMemoryRequirementsInfo2*)local_pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 5374 | if (local_pInfo) { |
| 5375 | delete local_pInfo; |
| 5376 | } |
| 5377 | } |
| 5378 | |
| 5379 | void DispatchGetPhysicalDeviceFeatures2( |
| 5380 | VkPhysicalDevice physicalDevice, |
| 5381 | VkPhysicalDeviceFeatures2* pFeatures) |
| 5382 | { |
| 5383 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5384 | layer_data->instance_dispatch_table.GetPhysicalDeviceFeatures2(physicalDevice, pFeatures); |
| 5385 | |
| 5386 | } |
| 5387 | |
| 5388 | void DispatchGetPhysicalDeviceProperties2( |
| 5389 | VkPhysicalDevice physicalDevice, |
| 5390 | VkPhysicalDeviceProperties2* pProperties) |
| 5391 | { |
| 5392 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5393 | layer_data->instance_dispatch_table.GetPhysicalDeviceProperties2(physicalDevice, pProperties); |
| 5394 | |
| 5395 | } |
| 5396 | |
| 5397 | void DispatchGetPhysicalDeviceFormatProperties2( |
| 5398 | VkPhysicalDevice physicalDevice, |
| 5399 | VkFormat format, |
| 5400 | VkFormatProperties2* pFormatProperties) |
| 5401 | { |
| 5402 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5403 | layer_data->instance_dispatch_table.GetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties); |
| 5404 | |
| 5405 | } |
| 5406 | |
| 5407 | VkResult DispatchGetPhysicalDeviceImageFormatProperties2( |
| 5408 | VkPhysicalDevice physicalDevice, |
| 5409 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 5410 | VkImageFormatProperties2* pImageFormatProperties) |
| 5411 | { |
| 5412 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5413 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, pImageFormatProperties); |
| 5414 | safe_VkPhysicalDeviceImageFormatInfo2 *local_pImageFormatInfo = NULL; |
| 5415 | { |
| 5416 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5417 | if (pImageFormatInfo) { |
| 5418 | local_pImageFormatInfo = new safe_VkPhysicalDeviceImageFormatInfo2(pImageFormatInfo); |
| 5419 | local_pImageFormatInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pImageFormatInfo->pNext); |
| 5420 | } |
| 5421 | } |
| 5422 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceImageFormatProperties2(physicalDevice, (const VkPhysicalDeviceImageFormatInfo2*)local_pImageFormatInfo, pImageFormatProperties); |
| 5423 | if (local_pImageFormatInfo) { |
| 5424 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pImageFormatInfo->pNext)); |
| 5425 | delete local_pImageFormatInfo; |
| 5426 | } |
| 5427 | return result; |
| 5428 | } |
| 5429 | |
| 5430 | void DispatchGetPhysicalDeviceQueueFamilyProperties2( |
| 5431 | VkPhysicalDevice physicalDevice, |
| 5432 | uint32_t* pQueueFamilyPropertyCount, |
| 5433 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 5434 | { |
| 5435 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5436 | layer_data->instance_dispatch_table.GetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
| 5437 | |
| 5438 | } |
| 5439 | |
| 5440 | void DispatchGetPhysicalDeviceMemoryProperties2( |
| 5441 | VkPhysicalDevice physicalDevice, |
| 5442 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 5443 | { |
| 5444 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5445 | layer_data->instance_dispatch_table.GetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties); |
| 5446 | |
| 5447 | } |
| 5448 | |
| 5449 | void DispatchGetPhysicalDeviceSparseImageFormatProperties2( |
| 5450 | VkPhysicalDevice physicalDevice, |
| 5451 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 5452 | uint32_t* pPropertyCount, |
| 5453 | VkSparseImageFormatProperties2* pProperties) |
| 5454 | { |
| 5455 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5456 | layer_data->instance_dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties); |
| 5457 | |
| 5458 | } |
| 5459 | |
| 5460 | void DispatchTrimCommandPool( |
| 5461 | VkDevice device, |
| 5462 | VkCommandPool commandPool, |
| 5463 | VkCommandPoolTrimFlags flags) |
| 5464 | { |
| 5465 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5466 | if (!wrap_handles) return layer_data->device_dispatch_table.TrimCommandPool(device, commandPool, flags); |
| 5467 | { |
| 5468 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5469 | commandPool = layer_data->Unwrap(commandPool); |
| 5470 | } |
| 5471 | layer_data->device_dispatch_table.TrimCommandPool(device, commandPool, flags); |
| 5472 | |
| 5473 | } |
| 5474 | |
| 5475 | void DispatchGetDeviceQueue2( |
| 5476 | VkDevice device, |
| 5477 | const VkDeviceQueueInfo2* pQueueInfo, |
| 5478 | VkQueue* pQueue) |
| 5479 | { |
| 5480 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5481 | layer_data->device_dispatch_table.GetDeviceQueue2(device, pQueueInfo, pQueue); |
| 5482 | |
| 5483 | } |
| 5484 | |
| 5485 | VkResult DispatchCreateSamplerYcbcrConversion( |
| 5486 | VkDevice device, |
| 5487 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 5488 | const VkAllocationCallbacks* pAllocator, |
| 5489 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 5490 | { |
| 5491 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5492 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion); |
| 5493 | safe_VkSamplerYcbcrConversionCreateInfo *local_pCreateInfo = NULL; |
| 5494 | { |
| 5495 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5496 | if (pCreateInfo) { |
| 5497 | local_pCreateInfo = new safe_VkSamplerYcbcrConversionCreateInfo(pCreateInfo); |
| 5498 | local_pCreateInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pCreateInfo->pNext); |
| 5499 | } |
| 5500 | } |
| 5501 | VkResult result = layer_data->device_dispatch_table.CreateSamplerYcbcrConversion(device, (const VkSamplerYcbcrConversionCreateInfo*)local_pCreateInfo, pAllocator, pYcbcrConversion); |
| 5502 | if (local_pCreateInfo) { |
| 5503 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pCreateInfo->pNext)); |
| 5504 | delete local_pCreateInfo; |
| 5505 | } |
| 5506 | if (VK_SUCCESS == result) { |
| 5507 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5508 | *pYcbcrConversion = layer_data->WrapNew(*pYcbcrConversion); |
| 5509 | } |
| 5510 | return result; |
| 5511 | } |
| 5512 | |
| 5513 | void DispatchDestroySamplerYcbcrConversion( |
| 5514 | VkDevice device, |
| 5515 | VkSamplerYcbcrConversion ycbcrConversion, |
| 5516 | const VkAllocationCallbacks* pAllocator) |
| 5517 | { |
| 5518 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5519 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator); |
| 5520 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 5521 | uint64_t ycbcrConversion_id = reinterpret_cast<uint64_t &>(ycbcrConversion); |
| 5522 | ycbcrConversion = (VkSamplerYcbcrConversion)unique_id_mapping[ycbcrConversion_id]; |
| 5523 | unique_id_mapping.erase(ycbcrConversion_id); |
| 5524 | lock.unlock(); |
| 5525 | layer_data->device_dispatch_table.DestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator); |
| 5526 | |
| 5527 | } |
| 5528 | |
| 5529 | // Skip vkCreateDescriptorUpdateTemplate dispatch, manually generated |
| 5530 | |
| 5531 | // Skip vkDestroyDescriptorUpdateTemplate dispatch, manually generated |
| 5532 | |
| 5533 | // Skip vkUpdateDescriptorSetWithTemplate dispatch, manually generated |
| 5534 | |
| 5535 | void DispatchGetPhysicalDeviceExternalBufferProperties( |
| 5536 | VkPhysicalDevice physicalDevice, |
| 5537 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 5538 | VkExternalBufferProperties* pExternalBufferProperties) |
| 5539 | { |
| 5540 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5541 | layer_data->instance_dispatch_table.GetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties); |
| 5542 | |
| 5543 | } |
| 5544 | |
| 5545 | void DispatchGetPhysicalDeviceExternalFenceProperties( |
| 5546 | VkPhysicalDevice physicalDevice, |
| 5547 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 5548 | VkExternalFenceProperties* pExternalFenceProperties) |
| 5549 | { |
| 5550 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5551 | layer_data->instance_dispatch_table.GetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties); |
| 5552 | |
| 5553 | } |
| 5554 | |
| 5555 | void DispatchGetPhysicalDeviceExternalSemaphoreProperties( |
| 5556 | VkPhysicalDevice physicalDevice, |
| 5557 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 5558 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 5559 | { |
| 5560 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5561 | layer_data->instance_dispatch_table.GetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties); |
| 5562 | |
| 5563 | } |
| 5564 | |
| 5565 | void DispatchGetDescriptorSetLayoutSupport( |
| 5566 | VkDevice device, |
| 5567 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5568 | VkDescriptorSetLayoutSupport* pSupport) |
| 5569 | { |
| 5570 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5571 | if (!wrap_handles) return layer_data->device_dispatch_table.GetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport); |
| 5572 | safe_VkDescriptorSetLayoutCreateInfo *local_pCreateInfo = NULL; |
| 5573 | { |
| 5574 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5575 | if (pCreateInfo) { |
| 5576 | local_pCreateInfo = new safe_VkDescriptorSetLayoutCreateInfo(pCreateInfo); |
| 5577 | if (local_pCreateInfo->pBindings) { |
| 5578 | for (uint32_t index1 = 0; index1 < local_pCreateInfo->bindingCount; ++index1) { |
| 5579 | if (local_pCreateInfo->pBindings[index1].pImmutableSamplers) { |
| 5580 | for (uint32_t index2 = 0; index2 < local_pCreateInfo->pBindings[index1].descriptorCount; ++index2) { |
| 5581 | local_pCreateInfo->pBindings[index1].pImmutableSamplers[index2] = layer_data->Unwrap(local_pCreateInfo->pBindings[index1].pImmutableSamplers[index2]); |
| 5582 | } |
| 5583 | } |
| 5584 | } |
| 5585 | } |
| 5586 | } |
| 5587 | } |
| 5588 | layer_data->device_dispatch_table.GetDescriptorSetLayoutSupport(device, (const VkDescriptorSetLayoutCreateInfo*)local_pCreateInfo, pSupport); |
| 5589 | if (local_pCreateInfo) { |
| 5590 | delete local_pCreateInfo; |
| 5591 | } |
| 5592 | } |
| 5593 | |
| 5594 | void DispatchDestroySurfaceKHR( |
| 5595 | VkInstance instance, |
| 5596 | VkSurfaceKHR surface, |
| 5597 | const VkAllocationCallbacks* pAllocator) |
| 5598 | { |
| 5599 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5600 | if (!wrap_handles) return layer_data->instance_dispatch_table.DestroySurfaceKHR(instance, surface, pAllocator); |
| 5601 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 5602 | uint64_t surface_id = reinterpret_cast<uint64_t &>(surface); |
| 5603 | surface = (VkSurfaceKHR)unique_id_mapping[surface_id]; |
| 5604 | unique_id_mapping.erase(surface_id); |
| 5605 | lock.unlock(); |
| 5606 | layer_data->instance_dispatch_table.DestroySurfaceKHR(instance, surface, pAllocator); |
| 5607 | |
| 5608 | } |
| 5609 | |
| 5610 | VkResult DispatchGetPhysicalDeviceSurfaceSupportKHR( |
| 5611 | VkPhysicalDevice physicalDevice, |
| 5612 | uint32_t queueFamilyIndex, |
| 5613 | VkSurfaceKHR surface, |
| 5614 | VkBool32* pSupported) |
| 5615 | { |
| 5616 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5617 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported); |
| 5618 | { |
| 5619 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5620 | surface = layer_data->Unwrap(surface); |
| 5621 | } |
| 5622 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported); |
| 5623 | |
| 5624 | return result; |
| 5625 | } |
| 5626 | |
| 5627 | VkResult DispatchGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 5628 | VkPhysicalDevice physicalDevice, |
| 5629 | VkSurfaceKHR surface, |
| 5630 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 5631 | { |
| 5632 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5633 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities); |
| 5634 | { |
| 5635 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5636 | surface = layer_data->Unwrap(surface); |
| 5637 | } |
| 5638 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities); |
| 5639 | |
| 5640 | return result; |
| 5641 | } |
| 5642 | |
| 5643 | VkResult DispatchGetPhysicalDeviceSurfaceFormatsKHR( |
| 5644 | VkPhysicalDevice physicalDevice, |
| 5645 | VkSurfaceKHR surface, |
| 5646 | uint32_t* pSurfaceFormatCount, |
| 5647 | VkSurfaceFormatKHR* pSurfaceFormats) |
| 5648 | { |
| 5649 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5650 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats); |
| 5651 | { |
| 5652 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5653 | surface = layer_data->Unwrap(surface); |
| 5654 | } |
| 5655 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats); |
| 5656 | |
| 5657 | return result; |
| 5658 | } |
| 5659 | |
| 5660 | VkResult DispatchGetPhysicalDeviceSurfacePresentModesKHR( |
| 5661 | VkPhysicalDevice physicalDevice, |
| 5662 | VkSurfaceKHR surface, |
| 5663 | uint32_t* pPresentModeCount, |
| 5664 | VkPresentModeKHR* pPresentModes) |
| 5665 | { |
| 5666 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5667 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes); |
| 5668 | { |
| 5669 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5670 | surface = layer_data->Unwrap(surface); |
| 5671 | } |
| 5672 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes); |
| 5673 | |
| 5674 | return result; |
| 5675 | } |
| 5676 | |
| 5677 | // Skip vkCreateSwapchainKHR dispatch, manually generated |
| 5678 | |
| 5679 | // Skip vkDestroySwapchainKHR dispatch, manually generated |
| 5680 | |
| 5681 | // Skip vkGetSwapchainImagesKHR dispatch, manually generated |
| 5682 | |
| 5683 | VkResult DispatchAcquireNextImageKHR( |
| 5684 | VkDevice device, |
| 5685 | VkSwapchainKHR swapchain, |
| 5686 | uint64_t timeout, |
| 5687 | VkSemaphore semaphore, |
| 5688 | VkFence fence, |
| 5689 | uint32_t* pImageIndex) |
| 5690 | { |
| 5691 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5692 | if (!wrap_handles) return layer_data->device_dispatch_table.AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex); |
| 5693 | { |
| 5694 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5695 | swapchain = layer_data->Unwrap(swapchain); |
| 5696 | semaphore = layer_data->Unwrap(semaphore); |
| 5697 | fence = layer_data->Unwrap(fence); |
| 5698 | } |
| 5699 | VkResult result = layer_data->device_dispatch_table.AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex); |
| 5700 | |
| 5701 | return result; |
| 5702 | } |
| 5703 | |
| 5704 | // Skip vkQueuePresentKHR dispatch, manually generated |
| 5705 | |
| 5706 | VkResult DispatchGetDeviceGroupPresentCapabilitiesKHR( |
| 5707 | VkDevice device, |
| 5708 | VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) |
| 5709 | { |
| 5710 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5711 | VkResult result = layer_data->device_dispatch_table.GetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities); |
| 5712 | |
| 5713 | return result; |
| 5714 | } |
| 5715 | |
| 5716 | VkResult DispatchGetDeviceGroupSurfacePresentModesKHR( |
| 5717 | VkDevice device, |
| 5718 | VkSurfaceKHR surface, |
| 5719 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 5720 | { |
| 5721 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5722 | if (!wrap_handles) return layer_data->device_dispatch_table.GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes); |
| 5723 | { |
| 5724 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5725 | surface = layer_data->Unwrap(surface); |
| 5726 | } |
| 5727 | VkResult result = layer_data->device_dispatch_table.GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes); |
| 5728 | |
| 5729 | return result; |
| 5730 | } |
| 5731 | |
| 5732 | VkResult DispatchGetPhysicalDevicePresentRectanglesKHR( |
| 5733 | VkPhysicalDevice physicalDevice, |
| 5734 | VkSurfaceKHR surface, |
| 5735 | uint32_t* pRectCount, |
| 5736 | VkRect2D* pRects) |
| 5737 | { |
| 5738 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5739 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects); |
| 5740 | { |
| 5741 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5742 | surface = layer_data->Unwrap(surface); |
| 5743 | } |
| 5744 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects); |
| 5745 | |
| 5746 | return result; |
| 5747 | } |
| 5748 | |
| 5749 | VkResult DispatchAcquireNextImage2KHR( |
| 5750 | VkDevice device, |
| 5751 | const VkAcquireNextImageInfoKHR* pAcquireInfo, |
| 5752 | uint32_t* pImageIndex) |
| 5753 | { |
| 5754 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5755 | if (!wrap_handles) return layer_data->device_dispatch_table.AcquireNextImage2KHR(device, pAcquireInfo, pImageIndex); |
| 5756 | safe_VkAcquireNextImageInfoKHR *local_pAcquireInfo = NULL; |
| 5757 | { |
| 5758 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5759 | if (pAcquireInfo) { |
| 5760 | local_pAcquireInfo = new safe_VkAcquireNextImageInfoKHR(pAcquireInfo); |
| 5761 | if (pAcquireInfo->swapchain) { |
| 5762 | local_pAcquireInfo->swapchain = layer_data->Unwrap(pAcquireInfo->swapchain); |
| 5763 | } |
| 5764 | if (pAcquireInfo->semaphore) { |
| 5765 | local_pAcquireInfo->semaphore = layer_data->Unwrap(pAcquireInfo->semaphore); |
| 5766 | } |
| 5767 | if (pAcquireInfo->fence) { |
| 5768 | local_pAcquireInfo->fence = layer_data->Unwrap(pAcquireInfo->fence); |
| 5769 | } |
| 5770 | } |
| 5771 | } |
| 5772 | VkResult result = layer_data->device_dispatch_table.AcquireNextImage2KHR(device, (const VkAcquireNextImageInfoKHR*)local_pAcquireInfo, pImageIndex); |
| 5773 | if (local_pAcquireInfo) { |
| 5774 | delete local_pAcquireInfo; |
| 5775 | } |
| 5776 | return result; |
| 5777 | } |
| 5778 | |
| 5779 | // Skip vkGetPhysicalDeviceDisplayPropertiesKHR dispatch, manually generated |
| 5780 | |
| 5781 | // Skip vkGetPhysicalDeviceDisplayPlanePropertiesKHR dispatch, manually generated |
| 5782 | |
| 5783 | // Skip vkGetDisplayPlaneSupportedDisplaysKHR dispatch, manually generated |
| 5784 | |
| 5785 | // Skip vkGetDisplayModePropertiesKHR dispatch, manually generated |
| 5786 | |
| 5787 | VkResult DispatchCreateDisplayModeKHR( |
| 5788 | VkPhysicalDevice physicalDevice, |
| 5789 | VkDisplayKHR display, |
| 5790 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 5791 | const VkAllocationCallbacks* pAllocator, |
| 5792 | VkDisplayModeKHR* pMode) |
| 5793 | { |
| 5794 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5795 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode); |
| 5796 | { |
| 5797 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5798 | display = layer_data->Unwrap(display); |
| 5799 | } |
| 5800 | VkResult result = layer_data->instance_dispatch_table.CreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode); |
| 5801 | if (VK_SUCCESS == result) { |
| 5802 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5803 | *pMode = layer_data->WrapNew(*pMode); |
| 5804 | } |
| 5805 | return result; |
| 5806 | } |
| 5807 | |
| 5808 | VkResult DispatchGetDisplayPlaneCapabilitiesKHR( |
| 5809 | VkPhysicalDevice physicalDevice, |
| 5810 | VkDisplayModeKHR mode, |
| 5811 | uint32_t planeIndex, |
| 5812 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) |
| 5813 | { |
| 5814 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5815 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities); |
| 5816 | { |
| 5817 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5818 | mode = layer_data->Unwrap(mode); |
| 5819 | } |
| 5820 | VkResult result = layer_data->instance_dispatch_table.GetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities); |
| 5821 | |
| 5822 | return result; |
| 5823 | } |
| 5824 | |
| 5825 | VkResult DispatchCreateDisplayPlaneSurfaceKHR( |
| 5826 | VkInstance instance, |
| 5827 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
| 5828 | const VkAllocationCallbacks* pAllocator, |
| 5829 | VkSurfaceKHR* pSurface) |
| 5830 | { |
| 5831 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5832 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5833 | safe_VkDisplaySurfaceCreateInfoKHR *local_pCreateInfo = NULL; |
| 5834 | { |
| 5835 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5836 | if (pCreateInfo) { |
| 5837 | local_pCreateInfo = new safe_VkDisplaySurfaceCreateInfoKHR(pCreateInfo); |
| 5838 | if (pCreateInfo->displayMode) { |
| 5839 | local_pCreateInfo->displayMode = layer_data->Unwrap(pCreateInfo->displayMode); |
| 5840 | } |
| 5841 | } |
| 5842 | } |
| 5843 | VkResult result = layer_data->instance_dispatch_table.CreateDisplayPlaneSurfaceKHR(instance, (const VkDisplaySurfaceCreateInfoKHR*)local_pCreateInfo, pAllocator, pSurface); |
| 5844 | if (local_pCreateInfo) { |
| 5845 | delete local_pCreateInfo; |
| 5846 | } |
| 5847 | if (VK_SUCCESS == result) { |
| 5848 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5849 | *pSurface = layer_data->WrapNew(*pSurface); |
| 5850 | } |
| 5851 | return result; |
| 5852 | } |
| 5853 | |
| 5854 | // Skip vkCreateSharedSwapchainsKHR dispatch, manually generated |
| 5855 | |
| 5856 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 5857 | |
| 5858 | VkResult DispatchCreateXlibSurfaceKHR( |
| 5859 | VkInstance instance, |
| 5860 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
| 5861 | const VkAllocationCallbacks* pAllocator, |
| 5862 | VkSurfaceKHR* pSurface) |
| 5863 | { |
| 5864 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5865 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5866 | VkResult result = layer_data->instance_dispatch_table.CreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5867 | if (VK_SUCCESS == result) { |
| 5868 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5869 | *pSurface = layer_data->WrapNew(*pSurface); |
| 5870 | } |
| 5871 | return result; |
| 5872 | } |
| 5873 | #endif // VK_USE_PLATFORM_XLIB_KHR |
| 5874 | |
| 5875 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 5876 | |
| 5877 | VkBool32 DispatchGetPhysicalDeviceXlibPresentationSupportKHR( |
| 5878 | VkPhysicalDevice physicalDevice, |
| 5879 | uint32_t queueFamilyIndex, |
| 5880 | Display* dpy, |
| 5881 | VisualID visualID) |
| 5882 | { |
| 5883 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5884 | VkBool32 result = layer_data->instance_dispatch_table.GetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID); |
| 5885 | |
| 5886 | return result; |
| 5887 | } |
| 5888 | #endif // VK_USE_PLATFORM_XLIB_KHR |
| 5889 | |
| 5890 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 5891 | |
| 5892 | VkResult DispatchCreateXcbSurfaceKHR( |
| 5893 | VkInstance instance, |
| 5894 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
| 5895 | const VkAllocationCallbacks* pAllocator, |
| 5896 | VkSurfaceKHR* pSurface) |
| 5897 | { |
| 5898 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5899 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5900 | VkResult result = layer_data->instance_dispatch_table.CreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5901 | if (VK_SUCCESS == result) { |
| 5902 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5903 | *pSurface = layer_data->WrapNew(*pSurface); |
| 5904 | } |
| 5905 | return result; |
| 5906 | } |
| 5907 | #endif // VK_USE_PLATFORM_XCB_KHR |
| 5908 | |
| 5909 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 5910 | |
| 5911 | VkBool32 DispatchGetPhysicalDeviceXcbPresentationSupportKHR( |
| 5912 | VkPhysicalDevice physicalDevice, |
| 5913 | uint32_t queueFamilyIndex, |
| 5914 | xcb_connection_t* connection, |
| 5915 | xcb_visualid_t visual_id) |
| 5916 | { |
| 5917 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5918 | VkBool32 result = layer_data->instance_dispatch_table.GetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, visual_id); |
| 5919 | |
| 5920 | return result; |
| 5921 | } |
| 5922 | #endif // VK_USE_PLATFORM_XCB_KHR |
| 5923 | |
| 5924 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 5925 | |
| 5926 | VkResult DispatchCreateWaylandSurfaceKHR( |
| 5927 | VkInstance instance, |
| 5928 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
| 5929 | const VkAllocationCallbacks* pAllocator, |
| 5930 | VkSurfaceKHR* pSurface) |
| 5931 | { |
| 5932 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5933 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5934 | VkResult result = layer_data->instance_dispatch_table.CreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5935 | if (VK_SUCCESS == result) { |
| 5936 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5937 | *pSurface = layer_data->WrapNew(*pSurface); |
| 5938 | } |
| 5939 | return result; |
| 5940 | } |
| 5941 | #endif // VK_USE_PLATFORM_WAYLAND_KHR |
| 5942 | |
| 5943 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 5944 | |
| 5945 | VkBool32 DispatchGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 5946 | VkPhysicalDevice physicalDevice, |
| 5947 | uint32_t queueFamilyIndex, |
| 5948 | struct wl_display* display) |
| 5949 | { |
| 5950 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 5951 | VkBool32 result = layer_data->instance_dispatch_table.GetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display); |
| 5952 | |
| 5953 | return result; |
| 5954 | } |
| 5955 | #endif // VK_USE_PLATFORM_WAYLAND_KHR |
| 5956 | |
| 5957 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 5958 | |
| 5959 | VkResult DispatchCreateAndroidSurfaceKHR( |
| 5960 | VkInstance instance, |
| 5961 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 5962 | const VkAllocationCallbacks* pAllocator, |
| 5963 | VkSurfaceKHR* pSurface) |
| 5964 | { |
| 5965 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5966 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5967 | VkResult result = layer_data->instance_dispatch_table.CreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5968 | if (VK_SUCCESS == result) { |
| 5969 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5970 | *pSurface = layer_data->WrapNew(*pSurface); |
| 5971 | } |
| 5972 | return result; |
| 5973 | } |
| 5974 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 5975 | |
| 5976 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 5977 | |
| 5978 | VkResult DispatchCreateWin32SurfaceKHR( |
| 5979 | VkInstance instance, |
| 5980 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
| 5981 | const VkAllocationCallbacks* pAllocator, |
| 5982 | VkSurfaceKHR* pSurface) |
| 5983 | { |
| 5984 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 5985 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5986 | VkResult result = layer_data->instance_dispatch_table.CreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
| 5987 | if (VK_SUCCESS == result) { |
| 5988 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 5989 | *pSurface = layer_data->WrapNew(*pSurface); |
| 5990 | } |
| 5991 | return result; |
| 5992 | } |
| 5993 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 5994 | |
| 5995 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 5996 | |
| 5997 | VkBool32 DispatchGetPhysicalDeviceWin32PresentationSupportKHR( |
| 5998 | VkPhysicalDevice physicalDevice, |
| 5999 | uint32_t queueFamilyIndex) |
| 6000 | { |
| 6001 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6002 | VkBool32 result = layer_data->instance_dispatch_table.GetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex); |
| 6003 | |
| 6004 | return result; |
| 6005 | } |
| 6006 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 6007 | |
| 6008 | void DispatchGetPhysicalDeviceFeatures2KHR( |
| 6009 | VkPhysicalDevice physicalDevice, |
| 6010 | VkPhysicalDeviceFeatures2* pFeatures) |
| 6011 | { |
| 6012 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6013 | layer_data->instance_dispatch_table.GetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures); |
| 6014 | |
| 6015 | } |
| 6016 | |
| 6017 | void DispatchGetPhysicalDeviceProperties2KHR( |
| 6018 | VkPhysicalDevice physicalDevice, |
| 6019 | VkPhysicalDeviceProperties2* pProperties) |
| 6020 | { |
| 6021 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6022 | layer_data->instance_dispatch_table.GetPhysicalDeviceProperties2KHR(physicalDevice, pProperties); |
| 6023 | |
| 6024 | } |
| 6025 | |
| 6026 | void DispatchGetPhysicalDeviceFormatProperties2KHR( |
| 6027 | VkPhysicalDevice physicalDevice, |
| 6028 | VkFormat format, |
| 6029 | VkFormatProperties2* pFormatProperties) |
| 6030 | { |
| 6031 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6032 | layer_data->instance_dispatch_table.GetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties); |
| 6033 | |
| 6034 | } |
| 6035 | |
| 6036 | VkResult DispatchGetPhysicalDeviceImageFormatProperties2KHR( |
| 6037 | VkPhysicalDevice physicalDevice, |
| 6038 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 6039 | VkImageFormatProperties2* pImageFormatProperties) |
| 6040 | { |
| 6041 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6042 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo, pImageFormatProperties); |
| 6043 | safe_VkPhysicalDeviceImageFormatInfo2 *local_pImageFormatInfo = NULL; |
| 6044 | { |
| 6045 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6046 | if (pImageFormatInfo) { |
| 6047 | local_pImageFormatInfo = new safe_VkPhysicalDeviceImageFormatInfo2(pImageFormatInfo); |
| 6048 | local_pImageFormatInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pImageFormatInfo->pNext); |
| 6049 | } |
| 6050 | } |
| 6051 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, (const VkPhysicalDeviceImageFormatInfo2*)local_pImageFormatInfo, pImageFormatProperties); |
| 6052 | if (local_pImageFormatInfo) { |
| 6053 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pImageFormatInfo->pNext)); |
| 6054 | delete local_pImageFormatInfo; |
| 6055 | } |
| 6056 | return result; |
| 6057 | } |
| 6058 | |
| 6059 | void DispatchGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 6060 | VkPhysicalDevice physicalDevice, |
| 6061 | uint32_t* pQueueFamilyPropertyCount, |
| 6062 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 6063 | { |
| 6064 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6065 | layer_data->instance_dispatch_table.GetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
| 6066 | |
| 6067 | } |
| 6068 | |
| 6069 | void DispatchGetPhysicalDeviceMemoryProperties2KHR( |
| 6070 | VkPhysicalDevice physicalDevice, |
| 6071 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 6072 | { |
| 6073 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6074 | layer_data->instance_dispatch_table.GetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties); |
| 6075 | |
| 6076 | } |
| 6077 | |
| 6078 | void DispatchGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 6079 | VkPhysicalDevice physicalDevice, |
| 6080 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 6081 | uint32_t* pPropertyCount, |
| 6082 | VkSparseImageFormatProperties2* pProperties) |
| 6083 | { |
| 6084 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6085 | layer_data->instance_dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, pProperties); |
| 6086 | |
| 6087 | } |
| 6088 | |
| 6089 | void DispatchGetDeviceGroupPeerMemoryFeaturesKHR( |
| 6090 | VkDevice device, |
| 6091 | uint32_t heapIndex, |
| 6092 | uint32_t localDeviceIndex, |
| 6093 | uint32_t remoteDeviceIndex, |
| 6094 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 6095 | { |
| 6096 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6097 | layer_data->device_dispatch_table.GetDeviceGroupPeerMemoryFeaturesKHR(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); |
| 6098 | |
| 6099 | } |
| 6100 | |
| 6101 | void DispatchCmdSetDeviceMaskKHR( |
| 6102 | VkCommandBuffer commandBuffer, |
| 6103 | uint32_t deviceMask) |
| 6104 | { |
| 6105 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6106 | layer_data->device_dispatch_table.CmdSetDeviceMaskKHR(commandBuffer, deviceMask); |
| 6107 | |
| 6108 | } |
| 6109 | |
| 6110 | void DispatchCmdDispatchBaseKHR( |
| 6111 | VkCommandBuffer commandBuffer, |
| 6112 | uint32_t baseGroupX, |
| 6113 | uint32_t baseGroupY, |
| 6114 | uint32_t baseGroupZ, |
| 6115 | uint32_t groupCountX, |
| 6116 | uint32_t groupCountY, |
| 6117 | uint32_t groupCountZ) |
| 6118 | { |
| 6119 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6120 | layer_data->device_dispatch_table.CmdDispatchBaseKHR(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); |
| 6121 | |
| 6122 | } |
| 6123 | |
| 6124 | void DispatchTrimCommandPoolKHR( |
| 6125 | VkDevice device, |
| 6126 | VkCommandPool commandPool, |
| 6127 | VkCommandPoolTrimFlags flags) |
| 6128 | { |
| 6129 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6130 | if (!wrap_handles) return layer_data->device_dispatch_table.TrimCommandPoolKHR(device, commandPool, flags); |
| 6131 | { |
| 6132 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6133 | commandPool = layer_data->Unwrap(commandPool); |
| 6134 | } |
| 6135 | layer_data->device_dispatch_table.TrimCommandPoolKHR(device, commandPool, flags); |
| 6136 | |
| 6137 | } |
| 6138 | |
| 6139 | VkResult DispatchEnumeratePhysicalDeviceGroupsKHR( |
| 6140 | VkInstance instance, |
| 6141 | uint32_t* pPhysicalDeviceGroupCount, |
| 6142 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 6143 | { |
| 6144 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 6145 | VkResult result = layer_data->instance_dispatch_table.EnumeratePhysicalDeviceGroupsKHR(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); |
| 6146 | |
| 6147 | return result; |
| 6148 | } |
| 6149 | |
| 6150 | void DispatchGetPhysicalDeviceExternalBufferPropertiesKHR( |
| 6151 | VkPhysicalDevice physicalDevice, |
| 6152 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 6153 | VkExternalBufferProperties* pExternalBufferProperties) |
| 6154 | { |
| 6155 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6156 | layer_data->instance_dispatch_table.GetPhysicalDeviceExternalBufferPropertiesKHR(physicalDevice, pExternalBufferInfo, pExternalBufferProperties); |
| 6157 | |
| 6158 | } |
| 6159 | |
| 6160 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 6161 | |
| 6162 | VkResult DispatchGetMemoryWin32HandleKHR( |
| 6163 | VkDevice device, |
| 6164 | const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 6165 | HANDLE* pHandle) |
| 6166 | { |
| 6167 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6168 | if (!wrap_handles) return layer_data->device_dispatch_table.GetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle); |
| 6169 | safe_VkMemoryGetWin32HandleInfoKHR *local_pGetWin32HandleInfo = NULL; |
| 6170 | { |
| 6171 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6172 | if (pGetWin32HandleInfo) { |
| 6173 | local_pGetWin32HandleInfo = new safe_VkMemoryGetWin32HandleInfoKHR(pGetWin32HandleInfo); |
| 6174 | if (pGetWin32HandleInfo->memory) { |
| 6175 | local_pGetWin32HandleInfo->memory = layer_data->Unwrap(pGetWin32HandleInfo->memory); |
| 6176 | } |
| 6177 | } |
| 6178 | } |
| 6179 | VkResult result = layer_data->device_dispatch_table.GetMemoryWin32HandleKHR(device, (const VkMemoryGetWin32HandleInfoKHR*)local_pGetWin32HandleInfo, pHandle); |
| 6180 | if (local_pGetWin32HandleInfo) { |
| 6181 | delete local_pGetWin32HandleInfo; |
| 6182 | } |
| 6183 | return result; |
| 6184 | } |
| 6185 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 6186 | |
| 6187 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 6188 | |
| 6189 | VkResult DispatchGetMemoryWin32HandlePropertiesKHR( |
| 6190 | VkDevice device, |
| 6191 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 6192 | HANDLE handle, |
| 6193 | VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) |
| 6194 | { |
| 6195 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6196 | VkResult result = layer_data->device_dispatch_table.GetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties); |
| 6197 | |
| 6198 | return result; |
| 6199 | } |
| 6200 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 6201 | |
| 6202 | VkResult DispatchGetMemoryFdKHR( |
| 6203 | VkDevice device, |
| 6204 | const VkMemoryGetFdInfoKHR* pGetFdInfo, |
| 6205 | int* pFd) |
| 6206 | { |
| 6207 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6208 | if (!wrap_handles) return layer_data->device_dispatch_table.GetMemoryFdKHR(device, pGetFdInfo, pFd); |
| 6209 | safe_VkMemoryGetFdInfoKHR *local_pGetFdInfo = NULL; |
| 6210 | { |
| 6211 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6212 | if (pGetFdInfo) { |
| 6213 | local_pGetFdInfo = new safe_VkMemoryGetFdInfoKHR(pGetFdInfo); |
| 6214 | if (pGetFdInfo->memory) { |
| 6215 | local_pGetFdInfo->memory = layer_data->Unwrap(pGetFdInfo->memory); |
| 6216 | } |
| 6217 | } |
| 6218 | } |
| 6219 | VkResult result = layer_data->device_dispatch_table.GetMemoryFdKHR(device, (const VkMemoryGetFdInfoKHR*)local_pGetFdInfo, pFd); |
| 6220 | if (local_pGetFdInfo) { |
| 6221 | delete local_pGetFdInfo; |
| 6222 | } |
| 6223 | return result; |
| 6224 | } |
| 6225 | |
| 6226 | VkResult DispatchGetMemoryFdPropertiesKHR( |
| 6227 | VkDevice device, |
| 6228 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 6229 | int fd, |
| 6230 | VkMemoryFdPropertiesKHR* pMemoryFdProperties) |
| 6231 | { |
| 6232 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6233 | VkResult result = layer_data->device_dispatch_table.GetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties); |
| 6234 | |
| 6235 | return result; |
| 6236 | } |
| 6237 | |
| 6238 | void DispatchGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 6239 | VkPhysicalDevice physicalDevice, |
| 6240 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 6241 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 6242 | { |
| 6243 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6244 | layer_data->instance_dispatch_table.GetPhysicalDeviceExternalSemaphorePropertiesKHR(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties); |
| 6245 | |
| 6246 | } |
| 6247 | |
| 6248 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 6249 | |
| 6250 | VkResult DispatchImportSemaphoreWin32HandleKHR( |
| 6251 | VkDevice device, |
| 6252 | const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) |
| 6253 | { |
| 6254 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6255 | if (!wrap_handles) return layer_data->device_dispatch_table.ImportSemaphoreWin32HandleKHR(device, pImportSemaphoreWin32HandleInfo); |
| 6256 | safe_VkImportSemaphoreWin32HandleInfoKHR *local_pImportSemaphoreWin32HandleInfo = NULL; |
| 6257 | { |
| 6258 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6259 | if (pImportSemaphoreWin32HandleInfo) { |
| 6260 | local_pImportSemaphoreWin32HandleInfo = new safe_VkImportSemaphoreWin32HandleInfoKHR(pImportSemaphoreWin32HandleInfo); |
| 6261 | if (pImportSemaphoreWin32HandleInfo->semaphore) { |
| 6262 | local_pImportSemaphoreWin32HandleInfo->semaphore = layer_data->Unwrap(pImportSemaphoreWin32HandleInfo->semaphore); |
| 6263 | } |
| 6264 | } |
| 6265 | } |
| 6266 | VkResult result = layer_data->device_dispatch_table.ImportSemaphoreWin32HandleKHR(device, (const VkImportSemaphoreWin32HandleInfoKHR*)local_pImportSemaphoreWin32HandleInfo); |
| 6267 | if (local_pImportSemaphoreWin32HandleInfo) { |
| 6268 | delete local_pImportSemaphoreWin32HandleInfo; |
| 6269 | } |
| 6270 | return result; |
| 6271 | } |
| 6272 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 6273 | |
| 6274 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 6275 | |
| 6276 | VkResult DispatchGetSemaphoreWin32HandleKHR( |
| 6277 | VkDevice device, |
| 6278 | const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 6279 | HANDLE* pHandle) |
| 6280 | { |
| 6281 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6282 | if (!wrap_handles) return layer_data->device_dispatch_table.GetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle); |
| 6283 | safe_VkSemaphoreGetWin32HandleInfoKHR *local_pGetWin32HandleInfo = NULL; |
| 6284 | { |
| 6285 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6286 | if (pGetWin32HandleInfo) { |
| 6287 | local_pGetWin32HandleInfo = new safe_VkSemaphoreGetWin32HandleInfoKHR(pGetWin32HandleInfo); |
| 6288 | if (pGetWin32HandleInfo->semaphore) { |
| 6289 | local_pGetWin32HandleInfo->semaphore = layer_data->Unwrap(pGetWin32HandleInfo->semaphore); |
| 6290 | } |
| 6291 | } |
| 6292 | } |
| 6293 | VkResult result = layer_data->device_dispatch_table.GetSemaphoreWin32HandleKHR(device, (const VkSemaphoreGetWin32HandleInfoKHR*)local_pGetWin32HandleInfo, pHandle); |
| 6294 | if (local_pGetWin32HandleInfo) { |
| 6295 | delete local_pGetWin32HandleInfo; |
| 6296 | } |
| 6297 | return result; |
| 6298 | } |
| 6299 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 6300 | |
| 6301 | VkResult DispatchImportSemaphoreFdKHR( |
| 6302 | VkDevice device, |
| 6303 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) |
| 6304 | { |
| 6305 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6306 | if (!wrap_handles) return layer_data->device_dispatch_table.ImportSemaphoreFdKHR(device, pImportSemaphoreFdInfo); |
| 6307 | safe_VkImportSemaphoreFdInfoKHR *local_pImportSemaphoreFdInfo = NULL; |
| 6308 | { |
| 6309 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6310 | if (pImportSemaphoreFdInfo) { |
| 6311 | local_pImportSemaphoreFdInfo = new safe_VkImportSemaphoreFdInfoKHR(pImportSemaphoreFdInfo); |
| 6312 | if (pImportSemaphoreFdInfo->semaphore) { |
| 6313 | local_pImportSemaphoreFdInfo->semaphore = layer_data->Unwrap(pImportSemaphoreFdInfo->semaphore); |
| 6314 | } |
| 6315 | } |
| 6316 | } |
| 6317 | VkResult result = layer_data->device_dispatch_table.ImportSemaphoreFdKHR(device, (const VkImportSemaphoreFdInfoKHR*)local_pImportSemaphoreFdInfo); |
| 6318 | if (local_pImportSemaphoreFdInfo) { |
| 6319 | delete local_pImportSemaphoreFdInfo; |
| 6320 | } |
| 6321 | return result; |
| 6322 | } |
| 6323 | |
| 6324 | VkResult DispatchGetSemaphoreFdKHR( |
| 6325 | VkDevice device, |
| 6326 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 6327 | int* pFd) |
| 6328 | { |
| 6329 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6330 | if (!wrap_handles) return layer_data->device_dispatch_table.GetSemaphoreFdKHR(device, pGetFdInfo, pFd); |
| 6331 | safe_VkSemaphoreGetFdInfoKHR *local_pGetFdInfo = NULL; |
| 6332 | { |
| 6333 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6334 | if (pGetFdInfo) { |
| 6335 | local_pGetFdInfo = new safe_VkSemaphoreGetFdInfoKHR(pGetFdInfo); |
| 6336 | if (pGetFdInfo->semaphore) { |
| 6337 | local_pGetFdInfo->semaphore = layer_data->Unwrap(pGetFdInfo->semaphore); |
| 6338 | } |
| 6339 | } |
| 6340 | } |
| 6341 | VkResult result = layer_data->device_dispatch_table.GetSemaphoreFdKHR(device, (const VkSemaphoreGetFdInfoKHR*)local_pGetFdInfo, pFd); |
| 6342 | if (local_pGetFdInfo) { |
| 6343 | delete local_pGetFdInfo; |
| 6344 | } |
| 6345 | return result; |
| 6346 | } |
| 6347 | |
| 6348 | void DispatchCmdPushDescriptorSetKHR( |
| 6349 | VkCommandBuffer commandBuffer, |
| 6350 | VkPipelineBindPoint pipelineBindPoint, |
| 6351 | VkPipelineLayout layout, |
| 6352 | uint32_t set, |
| 6353 | uint32_t descriptorWriteCount, |
| 6354 | const VkWriteDescriptorSet* pDescriptorWrites) |
| 6355 | { |
| 6356 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6357 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); |
| 6358 | safe_VkWriteDescriptorSet *local_pDescriptorWrites = NULL; |
| 6359 | { |
| 6360 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6361 | layout = layer_data->Unwrap(layout); |
| 6362 | if (pDescriptorWrites) { |
| 6363 | local_pDescriptorWrites = new safe_VkWriteDescriptorSet[descriptorWriteCount]; |
| 6364 | for (uint32_t index0 = 0; index0 < descriptorWriteCount; ++index0) { |
| 6365 | local_pDescriptorWrites[index0].initialize(&pDescriptorWrites[index0]); |
| 6366 | local_pDescriptorWrites[index0].pNext = CreateUnwrappedExtensionStructs(layer_data, local_pDescriptorWrites[index0].pNext); |
| 6367 | if (pDescriptorWrites[index0].dstSet) { |
| 6368 | local_pDescriptorWrites[index0].dstSet = layer_data->Unwrap(pDescriptorWrites[index0].dstSet); |
| 6369 | } |
| 6370 | if (local_pDescriptorWrites[index0].pImageInfo) { |
| 6371 | for (uint32_t index1 = 0; index1 < local_pDescriptorWrites[index0].descriptorCount; ++index1) { |
| 6372 | if (pDescriptorWrites[index0].pImageInfo[index1].sampler) { |
| 6373 | local_pDescriptorWrites[index0].pImageInfo[index1].sampler = layer_data->Unwrap(pDescriptorWrites[index0].pImageInfo[index1].sampler); |
| 6374 | } |
| 6375 | if (pDescriptorWrites[index0].pImageInfo[index1].imageView) { |
| 6376 | local_pDescriptorWrites[index0].pImageInfo[index1].imageView = layer_data->Unwrap(pDescriptorWrites[index0].pImageInfo[index1].imageView); |
| 6377 | } |
| 6378 | } |
| 6379 | } |
| 6380 | if (local_pDescriptorWrites[index0].pBufferInfo) { |
| 6381 | for (uint32_t index1 = 0; index1 < local_pDescriptorWrites[index0].descriptorCount; ++index1) { |
| 6382 | if (pDescriptorWrites[index0].pBufferInfo[index1].buffer) { |
| 6383 | local_pDescriptorWrites[index0].pBufferInfo[index1].buffer = layer_data->Unwrap(pDescriptorWrites[index0].pBufferInfo[index1].buffer); |
| 6384 | } |
| 6385 | } |
| 6386 | } |
| 6387 | if (local_pDescriptorWrites[index0].pTexelBufferView) { |
| 6388 | for (uint32_t index1 = 0; index1 < local_pDescriptorWrites[index0].descriptorCount; ++index1) { |
| 6389 | local_pDescriptorWrites[index0].pTexelBufferView[index1] = layer_data->Unwrap(local_pDescriptorWrites[index0].pTexelBufferView[index1]); |
| 6390 | } |
| 6391 | } |
| 6392 | } |
| 6393 | } |
| 6394 | } |
| 6395 | layer_data->device_dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, (const VkWriteDescriptorSet*)local_pDescriptorWrites); |
| 6396 | if (local_pDescriptorWrites) { |
| 6397 | for (uint32_t index0 = 0; index0 < descriptorWriteCount; ++index0) { |
| 6398 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pDescriptorWrites[index0].pNext)); |
| 6399 | } |
| 6400 | delete[] local_pDescriptorWrites; |
| 6401 | } |
| 6402 | } |
| 6403 | |
| 6404 | // Skip vkCmdPushDescriptorSetWithTemplateKHR dispatch, manually generated |
| 6405 | |
| 6406 | // Skip vkCreateDescriptorUpdateTemplateKHR dispatch, manually generated |
| 6407 | |
| 6408 | // Skip vkDestroyDescriptorUpdateTemplateKHR dispatch, manually generated |
| 6409 | |
| 6410 | // Skip vkUpdateDescriptorSetWithTemplateKHR dispatch, manually generated |
| 6411 | |
| 6412 | // Skip vkCreateRenderPass2KHR dispatch, manually generated |
| 6413 | |
| 6414 | void DispatchCmdBeginRenderPass2KHR( |
| 6415 | VkCommandBuffer commandBuffer, |
| 6416 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 6417 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo) |
| 6418 | { |
| 6419 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6420 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo); |
| 6421 | safe_VkRenderPassBeginInfo *local_pRenderPassBegin = NULL; |
| 6422 | { |
| 6423 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6424 | if (pRenderPassBegin) { |
| 6425 | local_pRenderPassBegin = new safe_VkRenderPassBeginInfo(pRenderPassBegin); |
| 6426 | if (pRenderPassBegin->renderPass) { |
| 6427 | local_pRenderPassBegin->renderPass = layer_data->Unwrap(pRenderPassBegin->renderPass); |
| 6428 | } |
| 6429 | if (pRenderPassBegin->framebuffer) { |
| 6430 | local_pRenderPassBegin->framebuffer = layer_data->Unwrap(pRenderPassBegin->framebuffer); |
| 6431 | } |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 6432 | local_pRenderPassBegin->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pRenderPassBegin->pNext); |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 6433 | } |
| 6434 | } |
| 6435 | layer_data->device_dispatch_table.CmdBeginRenderPass2KHR(commandBuffer, (const VkRenderPassBeginInfo*)local_pRenderPassBegin, pSubpassBeginInfo); |
| 6436 | if (local_pRenderPassBegin) { |
| Shannon McPherson | 0e65e19 | 2019-07-17 16:52:21 -0600 | [diff] [blame] | 6437 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pRenderPassBegin->pNext)); |
| Mike Schuchardt | 440d464 | 2019-06-20 17:14:57 -0700 | [diff] [blame] | 6438 | delete local_pRenderPassBegin; |
| 6439 | } |
| 6440 | } |
| 6441 | |
| 6442 | void DispatchCmdNextSubpass2KHR( |
| 6443 | VkCommandBuffer commandBuffer, |
| 6444 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo, |
| 6445 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 6446 | { |
| 6447 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6448 | layer_data->device_dispatch_table.CmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo); |
| 6449 | |
| 6450 | } |
| 6451 | |
| 6452 | void DispatchCmdEndRenderPass2KHR( |
| 6453 | VkCommandBuffer commandBuffer, |
| 6454 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 6455 | { |
| 6456 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6457 | layer_data->device_dispatch_table.CmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo); |
| 6458 | |
| 6459 | } |
| 6460 | |
| 6461 | VkResult DispatchGetSwapchainStatusKHR( |
| 6462 | VkDevice device, |
| 6463 | VkSwapchainKHR swapchain) |
| 6464 | { |
| 6465 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6466 | if (!wrap_handles) return layer_data->device_dispatch_table.GetSwapchainStatusKHR(device, swapchain); |
| 6467 | { |
| 6468 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6469 | swapchain = layer_data->Unwrap(swapchain); |
| 6470 | } |
| 6471 | VkResult result = layer_data->device_dispatch_table.GetSwapchainStatusKHR(device, swapchain); |
| 6472 | |
| 6473 | return result; |
| 6474 | } |
| 6475 | |
| 6476 | void DispatchGetPhysicalDeviceExternalFencePropertiesKHR( |
| 6477 | VkPhysicalDevice physicalDevice, |
| 6478 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 6479 | VkExternalFenceProperties* pExternalFenceProperties) |
| 6480 | { |
| 6481 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6482 | layer_data->instance_dispatch_table.GetPhysicalDeviceExternalFencePropertiesKHR(physicalDevice, pExternalFenceInfo, pExternalFenceProperties); |
| 6483 | |
| 6484 | } |
| 6485 | |
| 6486 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 6487 | |
| 6488 | VkResult DispatchImportFenceWin32HandleKHR( |
| 6489 | VkDevice device, |
| 6490 | const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) |
| 6491 | { |
| 6492 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6493 | if (!wrap_handles) return layer_data->device_dispatch_table.ImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo); |
| 6494 | safe_VkImportFenceWin32HandleInfoKHR *local_pImportFenceWin32HandleInfo = NULL; |
| 6495 | { |
| 6496 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6497 | if (pImportFenceWin32HandleInfo) { |
| 6498 | local_pImportFenceWin32HandleInfo = new safe_VkImportFenceWin32HandleInfoKHR(pImportFenceWin32HandleInfo); |
| 6499 | if (pImportFenceWin32HandleInfo->fence) { |
| 6500 | local_pImportFenceWin32HandleInfo->fence = layer_data->Unwrap(pImportFenceWin32HandleInfo->fence); |
| 6501 | } |
| 6502 | } |
| 6503 | } |
| 6504 | VkResult result = layer_data->device_dispatch_table.ImportFenceWin32HandleKHR(device, (const VkImportFenceWin32HandleInfoKHR*)local_pImportFenceWin32HandleInfo); |
| 6505 | if (local_pImportFenceWin32HandleInfo) { |
| 6506 | delete local_pImportFenceWin32HandleInfo; |
| 6507 | } |
| 6508 | return result; |
| 6509 | } |
| 6510 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 6511 | |
| 6512 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 6513 | |
| 6514 | VkResult DispatchGetFenceWin32HandleKHR( |
| 6515 | VkDevice device, |
| 6516 | const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 6517 | HANDLE* pHandle) |
| 6518 | { |
| 6519 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6520 | if (!wrap_handles) return layer_data->device_dispatch_table.GetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle); |
| 6521 | safe_VkFenceGetWin32HandleInfoKHR *local_pGetWin32HandleInfo = NULL; |
| 6522 | { |
| 6523 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6524 | if (pGetWin32HandleInfo) { |
| 6525 | local_pGetWin32HandleInfo = new safe_VkFenceGetWin32HandleInfoKHR(pGetWin32HandleInfo); |
| 6526 | if (pGetWin32HandleInfo->fence) { |
| 6527 | local_pGetWin32HandleInfo->fence = layer_data->Unwrap(pGetWin32HandleInfo->fence); |
| 6528 | } |
| 6529 | } |
| 6530 | } |
| 6531 | VkResult result = layer_data->device_dispatch_table.GetFenceWin32HandleKHR(device, (const VkFenceGetWin32HandleInfoKHR*)local_pGetWin32HandleInfo, pHandle); |
| 6532 | if (local_pGetWin32HandleInfo) { |
| 6533 | delete local_pGetWin32HandleInfo; |
| 6534 | } |
| 6535 | return result; |
| 6536 | } |
| 6537 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 6538 | |
| 6539 | VkResult DispatchImportFenceFdKHR( |
| 6540 | VkDevice device, |
| 6541 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo) |
| 6542 | { |
| 6543 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6544 | if (!wrap_handles) return layer_data->device_dispatch_table.ImportFenceFdKHR(device, pImportFenceFdInfo); |
| 6545 | safe_VkImportFenceFdInfoKHR *local_pImportFenceFdInfo = NULL; |
| 6546 | { |
| 6547 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6548 | if (pImportFenceFdInfo) { |
| 6549 | local_pImportFenceFdInfo = new safe_VkImportFenceFdInfoKHR(pImportFenceFdInfo); |
| 6550 | if (pImportFenceFdInfo->fence) { |
| 6551 | local_pImportFenceFdInfo->fence = layer_data->Unwrap(pImportFenceFdInfo->fence); |
| 6552 | } |
| 6553 | } |
| 6554 | } |
| 6555 | VkResult result = layer_data->device_dispatch_table.ImportFenceFdKHR(device, (const VkImportFenceFdInfoKHR*)local_pImportFenceFdInfo); |
| 6556 | if (local_pImportFenceFdInfo) { |
| 6557 | delete local_pImportFenceFdInfo; |
| 6558 | } |
| 6559 | return result; |
| 6560 | } |
| 6561 | |
| 6562 | VkResult DispatchGetFenceFdKHR( |
| 6563 | VkDevice device, |
| 6564 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 6565 | int* pFd) |
| 6566 | { |
| 6567 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6568 | if (!wrap_handles) return layer_data->device_dispatch_table.GetFenceFdKHR(device, pGetFdInfo, pFd); |
| 6569 | safe_VkFenceGetFdInfoKHR *local_pGetFdInfo = NULL; |
| 6570 | { |
| 6571 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6572 | if (pGetFdInfo) { |
| 6573 | local_pGetFdInfo = new safe_VkFenceGetFdInfoKHR(pGetFdInfo); |
| 6574 | if (pGetFdInfo->fence) { |
| 6575 | local_pGetFdInfo->fence = layer_data->Unwrap(pGetFdInfo->fence); |
| 6576 | } |
| 6577 | } |
| 6578 | } |
| 6579 | VkResult result = layer_data->device_dispatch_table.GetFenceFdKHR(device, (const VkFenceGetFdInfoKHR*)local_pGetFdInfo, pFd); |
| 6580 | if (local_pGetFdInfo) { |
| 6581 | delete local_pGetFdInfo; |
| 6582 | } |
| 6583 | return result; |
| 6584 | } |
| 6585 | |
| 6586 | VkResult DispatchGetPhysicalDeviceSurfaceCapabilities2KHR( |
| 6587 | VkPhysicalDevice physicalDevice, |
| 6588 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 6589 | VkSurfaceCapabilities2KHR* pSurfaceCapabilities) |
| 6590 | { |
| 6591 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6592 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo, pSurfaceCapabilities); |
| 6593 | safe_VkPhysicalDeviceSurfaceInfo2KHR *local_pSurfaceInfo = NULL; |
| 6594 | { |
| 6595 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6596 | if (pSurfaceInfo) { |
| 6597 | local_pSurfaceInfo = new safe_VkPhysicalDeviceSurfaceInfo2KHR(pSurfaceInfo); |
| 6598 | if (pSurfaceInfo->surface) { |
| 6599 | local_pSurfaceInfo->surface = layer_data->Unwrap(pSurfaceInfo->surface); |
| 6600 | } |
| 6601 | } |
| 6602 | } |
| 6603 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, (const VkPhysicalDeviceSurfaceInfo2KHR*)local_pSurfaceInfo, pSurfaceCapabilities); |
| 6604 | if (local_pSurfaceInfo) { |
| 6605 | delete local_pSurfaceInfo; |
| 6606 | } |
| 6607 | return result; |
| 6608 | } |
| 6609 | |
| 6610 | VkResult DispatchGetPhysicalDeviceSurfaceFormats2KHR( |
| 6611 | VkPhysicalDevice physicalDevice, |
| 6612 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 6613 | uint32_t* pSurfaceFormatCount, |
| 6614 | VkSurfaceFormat2KHR* pSurfaceFormats) |
| 6615 | { |
| 6616 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6617 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats); |
| 6618 | safe_VkPhysicalDeviceSurfaceInfo2KHR *local_pSurfaceInfo = NULL; |
| 6619 | { |
| 6620 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6621 | if (pSurfaceInfo) { |
| 6622 | local_pSurfaceInfo = new safe_VkPhysicalDeviceSurfaceInfo2KHR(pSurfaceInfo); |
| 6623 | if (pSurfaceInfo->surface) { |
| 6624 | local_pSurfaceInfo->surface = layer_data->Unwrap(pSurfaceInfo->surface); |
| 6625 | } |
| 6626 | } |
| 6627 | } |
| 6628 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, (const VkPhysicalDeviceSurfaceInfo2KHR*)local_pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats); |
| 6629 | if (local_pSurfaceInfo) { |
| 6630 | delete local_pSurfaceInfo; |
| 6631 | } |
| 6632 | return result; |
| 6633 | } |
| 6634 | |
| 6635 | // Skip vkGetPhysicalDeviceDisplayProperties2KHR dispatch, manually generated |
| 6636 | |
| 6637 | // Skip vkGetPhysicalDeviceDisplayPlaneProperties2KHR dispatch, manually generated |
| 6638 | |
| 6639 | // Skip vkGetDisplayModeProperties2KHR dispatch, manually generated |
| 6640 | |
| 6641 | VkResult DispatchGetDisplayPlaneCapabilities2KHR( |
| 6642 | VkPhysicalDevice physicalDevice, |
| 6643 | const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, |
| 6644 | VkDisplayPlaneCapabilities2KHR* pCapabilities) |
| 6645 | { |
| 6646 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 6647 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetDisplayPlaneCapabilities2KHR(physicalDevice, pDisplayPlaneInfo, pCapabilities); |
| 6648 | safe_VkDisplayPlaneInfo2KHR *local_pDisplayPlaneInfo = NULL; |
| 6649 | { |
| 6650 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6651 | if (pDisplayPlaneInfo) { |
| 6652 | local_pDisplayPlaneInfo = new safe_VkDisplayPlaneInfo2KHR(pDisplayPlaneInfo); |
| 6653 | if (pDisplayPlaneInfo->mode) { |
| 6654 | local_pDisplayPlaneInfo->mode = layer_data->Unwrap(pDisplayPlaneInfo->mode); |
| 6655 | } |
| 6656 | } |
| 6657 | } |
| 6658 | VkResult result = layer_data->instance_dispatch_table.GetDisplayPlaneCapabilities2KHR(physicalDevice, (const VkDisplayPlaneInfo2KHR*)local_pDisplayPlaneInfo, pCapabilities); |
| 6659 | if (local_pDisplayPlaneInfo) { |
| 6660 | delete local_pDisplayPlaneInfo; |
| 6661 | } |
| 6662 | return result; |
| 6663 | } |
| 6664 | |
| 6665 | void DispatchGetImageMemoryRequirements2KHR( |
| 6666 | VkDevice device, |
| 6667 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 6668 | VkMemoryRequirements2* pMemoryRequirements) |
| 6669 | { |
| 6670 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6671 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageMemoryRequirements2KHR(device, pInfo, pMemoryRequirements); |
| 6672 | safe_VkImageMemoryRequirementsInfo2 *local_pInfo = NULL; |
| 6673 | { |
| 6674 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6675 | if (pInfo) { |
| 6676 | local_pInfo = new safe_VkImageMemoryRequirementsInfo2(pInfo); |
| 6677 | if (pInfo->image) { |
| 6678 | local_pInfo->image = layer_data->Unwrap(pInfo->image); |
| 6679 | } |
| 6680 | } |
| 6681 | } |
| 6682 | layer_data->device_dispatch_table.GetImageMemoryRequirements2KHR(device, (const VkImageMemoryRequirementsInfo2*)local_pInfo, pMemoryRequirements); |
| 6683 | if (local_pInfo) { |
| 6684 | delete local_pInfo; |
| 6685 | } |
| 6686 | } |
| 6687 | |
| 6688 | void DispatchGetBufferMemoryRequirements2KHR( |
| 6689 | VkDevice device, |
| 6690 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 6691 | VkMemoryRequirements2* pMemoryRequirements) |
| 6692 | { |
| 6693 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6694 | if (!wrap_handles) return layer_data->device_dispatch_table.GetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements); |
| 6695 | safe_VkBufferMemoryRequirementsInfo2 *local_pInfo = NULL; |
| 6696 | { |
| 6697 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6698 | if (pInfo) { |
| 6699 | local_pInfo = new safe_VkBufferMemoryRequirementsInfo2(pInfo); |
| 6700 | if (pInfo->buffer) { |
| 6701 | local_pInfo->buffer = layer_data->Unwrap(pInfo->buffer); |
| 6702 | } |
| 6703 | } |
| 6704 | } |
| 6705 | layer_data->device_dispatch_table.GetBufferMemoryRequirements2KHR(device, (const VkBufferMemoryRequirementsInfo2*)local_pInfo, pMemoryRequirements); |
| 6706 | if (local_pInfo) { |
| 6707 | delete local_pInfo; |
| 6708 | } |
| 6709 | } |
| 6710 | |
| 6711 | void DispatchGetImageSparseMemoryRequirements2KHR( |
| 6712 | VkDevice device, |
| 6713 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 6714 | uint32_t* pSparseMemoryRequirementCount, |
| 6715 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 6716 | { |
| 6717 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6718 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 6719 | safe_VkImageSparseMemoryRequirementsInfo2 *local_pInfo = NULL; |
| 6720 | { |
| 6721 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6722 | if (pInfo) { |
| 6723 | local_pInfo = new safe_VkImageSparseMemoryRequirementsInfo2(pInfo); |
| 6724 | if (pInfo->image) { |
| 6725 | local_pInfo->image = layer_data->Unwrap(pInfo->image); |
| 6726 | } |
| 6727 | } |
| 6728 | } |
| 6729 | layer_data->device_dispatch_table.GetImageSparseMemoryRequirements2KHR(device, (const VkImageSparseMemoryRequirementsInfo2*)local_pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 6730 | if (local_pInfo) { |
| 6731 | delete local_pInfo; |
| 6732 | } |
| 6733 | } |
| 6734 | |
| 6735 | VkResult DispatchCreateSamplerYcbcrConversionKHR( |
| 6736 | VkDevice device, |
| 6737 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 6738 | const VkAllocationCallbacks* pAllocator, |
| 6739 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 6740 | { |
| 6741 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6742 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateSamplerYcbcrConversionKHR(device, pCreateInfo, pAllocator, pYcbcrConversion); |
| 6743 | safe_VkSamplerYcbcrConversionCreateInfo *local_pCreateInfo = NULL; |
| 6744 | { |
| 6745 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6746 | if (pCreateInfo) { |
| 6747 | local_pCreateInfo = new safe_VkSamplerYcbcrConversionCreateInfo(pCreateInfo); |
| 6748 | local_pCreateInfo->pNext = CreateUnwrappedExtensionStructs(layer_data, local_pCreateInfo->pNext); |
| 6749 | } |
| 6750 | } |
| 6751 | VkResult result = layer_data->device_dispatch_table.CreateSamplerYcbcrConversionKHR(device, (const VkSamplerYcbcrConversionCreateInfo*)local_pCreateInfo, pAllocator, pYcbcrConversion); |
| 6752 | if (local_pCreateInfo) { |
| 6753 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pCreateInfo->pNext)); |
| 6754 | delete local_pCreateInfo; |
| 6755 | } |
| 6756 | if (VK_SUCCESS == result) { |
| 6757 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6758 | *pYcbcrConversion = layer_data->WrapNew(*pYcbcrConversion); |
| 6759 | } |
| 6760 | return result; |
| 6761 | } |
| 6762 | |
| 6763 | void DispatchDestroySamplerYcbcrConversionKHR( |
| 6764 | VkDevice device, |
| 6765 | VkSamplerYcbcrConversion ycbcrConversion, |
| 6766 | const VkAllocationCallbacks* pAllocator) |
| 6767 | { |
| 6768 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6769 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator); |
| 6770 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 6771 | uint64_t ycbcrConversion_id = reinterpret_cast<uint64_t &>(ycbcrConversion); |
| 6772 | ycbcrConversion = (VkSamplerYcbcrConversion)unique_id_mapping[ycbcrConversion_id]; |
| 6773 | unique_id_mapping.erase(ycbcrConversion_id); |
| 6774 | lock.unlock(); |
| 6775 | layer_data->device_dispatch_table.DestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator); |
| 6776 | |
| 6777 | } |
| 6778 | |
| 6779 | VkResult DispatchBindBufferMemory2KHR( |
| 6780 | VkDevice device, |
| 6781 | uint32_t bindInfoCount, |
| 6782 | const VkBindBufferMemoryInfo* pBindInfos) |
| 6783 | { |
| 6784 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6785 | if (!wrap_handles) return layer_data->device_dispatch_table.BindBufferMemory2KHR(device, bindInfoCount, pBindInfos); |
| 6786 | safe_VkBindBufferMemoryInfo *local_pBindInfos = NULL; |
| 6787 | { |
| 6788 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6789 | if (pBindInfos) { |
| 6790 | local_pBindInfos = new safe_VkBindBufferMemoryInfo[bindInfoCount]; |
| 6791 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 6792 | local_pBindInfos[index0].initialize(&pBindInfos[index0]); |
| 6793 | if (pBindInfos[index0].buffer) { |
| 6794 | local_pBindInfos[index0].buffer = layer_data->Unwrap(pBindInfos[index0].buffer); |
| 6795 | } |
| 6796 | if (pBindInfos[index0].memory) { |
| 6797 | local_pBindInfos[index0].memory = layer_data->Unwrap(pBindInfos[index0].memory); |
| 6798 | } |
| 6799 | } |
| 6800 | } |
| 6801 | } |
| 6802 | VkResult result = layer_data->device_dispatch_table.BindBufferMemory2KHR(device, bindInfoCount, (const VkBindBufferMemoryInfo*)local_pBindInfos); |
| 6803 | if (local_pBindInfos) { |
| 6804 | delete[] local_pBindInfos; |
| 6805 | } |
| 6806 | return result; |
| 6807 | } |
| 6808 | |
| 6809 | VkResult DispatchBindImageMemory2KHR( |
| 6810 | VkDevice device, |
| 6811 | uint32_t bindInfoCount, |
| 6812 | const VkBindImageMemoryInfo* pBindInfos) |
| 6813 | { |
| 6814 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6815 | if (!wrap_handles) return layer_data->device_dispatch_table.BindImageMemory2KHR(device, bindInfoCount, pBindInfos); |
| 6816 | safe_VkBindImageMemoryInfo *local_pBindInfos = NULL; |
| 6817 | { |
| 6818 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6819 | if (pBindInfos) { |
| 6820 | local_pBindInfos = new safe_VkBindImageMemoryInfo[bindInfoCount]; |
| 6821 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 6822 | local_pBindInfos[index0].initialize(&pBindInfos[index0]); |
| 6823 | local_pBindInfos[index0].pNext = CreateUnwrappedExtensionStructs(layer_data, local_pBindInfos[index0].pNext); |
| 6824 | if (pBindInfos[index0].image) { |
| 6825 | local_pBindInfos[index0].image = layer_data->Unwrap(pBindInfos[index0].image); |
| 6826 | } |
| 6827 | if (pBindInfos[index0].memory) { |
| 6828 | local_pBindInfos[index0].memory = layer_data->Unwrap(pBindInfos[index0].memory); |
| 6829 | } |
| 6830 | } |
| 6831 | } |
| 6832 | } |
| 6833 | VkResult result = layer_data->device_dispatch_table.BindImageMemory2KHR(device, bindInfoCount, (const VkBindImageMemoryInfo*)local_pBindInfos); |
| 6834 | if (local_pBindInfos) { |
| 6835 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 6836 | FreeUnwrappedExtensionStructs(const_cast<void *>(local_pBindInfos[index0].pNext)); |
| 6837 | } |
| 6838 | delete[] local_pBindInfos; |
| 6839 | } |
| 6840 | return result; |
| 6841 | } |
| 6842 | |
| 6843 | void DispatchGetDescriptorSetLayoutSupportKHR( |
| 6844 | VkDevice device, |
| 6845 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 6846 | VkDescriptorSetLayoutSupport* pSupport) |
| 6847 | { |
| 6848 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6849 | if (!wrap_handles) return layer_data->device_dispatch_table.GetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport); |
| 6850 | safe_VkDescriptorSetLayoutCreateInfo *local_pCreateInfo = NULL; |
| 6851 | { |
| 6852 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6853 | if (pCreateInfo) { |
| 6854 | local_pCreateInfo = new safe_VkDescriptorSetLayoutCreateInfo(pCreateInfo); |
| 6855 | if (local_pCreateInfo->pBindings) { |
| 6856 | for (uint32_t index1 = 0; index1 < local_pCreateInfo->bindingCount; ++index1) { |
| 6857 | if (local_pCreateInfo->pBindings[index1].pImmutableSamplers) { |
| 6858 | for (uint32_t index2 = 0; index2 < local_pCreateInfo->pBindings[index1].descriptorCount; ++index2) { |
| 6859 | local_pCreateInfo->pBindings[index1].pImmutableSamplers[index2] = layer_data->Unwrap(local_pCreateInfo->pBindings[index1].pImmutableSamplers[index2]); |
| 6860 | } |
| 6861 | } |
| 6862 | } |
| 6863 | } |
| 6864 | } |
| 6865 | } |
| 6866 | layer_data->device_dispatch_table.GetDescriptorSetLayoutSupportKHR(device, (const VkDescriptorSetLayoutCreateInfo*)local_pCreateInfo, pSupport); |
| 6867 | if (local_pCreateInfo) { |
| 6868 | delete local_pCreateInfo; |
| 6869 | } |
| 6870 | } |
| 6871 | |
| 6872 | void DispatchCmdDrawIndirectCountKHR( |
| 6873 | VkCommandBuffer commandBuffer, |
| 6874 | VkBuffer buffer, |
| 6875 | VkDeviceSize offset, |
| 6876 | VkBuffer countBuffer, |
| 6877 | VkDeviceSize countBufferOffset, |
| 6878 | uint32_t maxDrawCount, |
| 6879 | uint32_t stride) |
| 6880 | { |
| 6881 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6882 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 6883 | { |
| 6884 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6885 | buffer = layer_data->Unwrap(buffer); |
| 6886 | countBuffer = layer_data->Unwrap(countBuffer); |
| 6887 | } |
| 6888 | layer_data->device_dispatch_table.CmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 6889 | |
| 6890 | } |
| 6891 | |
| 6892 | void DispatchCmdDrawIndexedIndirectCountKHR( |
| 6893 | VkCommandBuffer commandBuffer, |
| 6894 | VkBuffer buffer, |
| 6895 | VkDeviceSize offset, |
| 6896 | VkBuffer countBuffer, |
| 6897 | VkDeviceSize countBufferOffset, |
| 6898 | uint32_t maxDrawCount, |
| 6899 | uint32_t stride) |
| 6900 | { |
| 6901 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6902 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 6903 | { |
| 6904 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6905 | buffer = layer_data->Unwrap(buffer); |
| 6906 | countBuffer = layer_data->Unwrap(countBuffer); |
| 6907 | } |
| 6908 | layer_data->device_dispatch_table.CmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 6909 | |
| 6910 | } |
| 6911 | |
| 6912 | VkResult DispatchCreateDebugReportCallbackEXT( |
| 6913 | VkInstance instance, |
| 6914 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 6915 | const VkAllocationCallbacks* pAllocator, |
| 6916 | VkDebugReportCallbackEXT* pCallback) |
| 6917 | { |
| 6918 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 6919 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback); |
| 6920 | VkResult result = layer_data->instance_dispatch_table.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback); |
| 6921 | if (VK_SUCCESS == result) { |
| 6922 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 6923 | *pCallback = layer_data->WrapNew(*pCallback); |
| 6924 | } |
| 6925 | return result; |
| 6926 | } |
| 6927 | |
| 6928 | void DispatchDestroyDebugReportCallbackEXT( |
| 6929 | VkInstance instance, |
| 6930 | VkDebugReportCallbackEXT callback, |
| 6931 | const VkAllocationCallbacks* pAllocator) |
| 6932 | { |
| 6933 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 6934 | if (!wrap_handles) return layer_data->instance_dispatch_table.DestroyDebugReportCallbackEXT(instance, callback, pAllocator); |
| 6935 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 6936 | uint64_t callback_id = reinterpret_cast<uint64_t &>(callback); |
| 6937 | callback = (VkDebugReportCallbackEXT)unique_id_mapping[callback_id]; |
| 6938 | unique_id_mapping.erase(callback_id); |
| 6939 | lock.unlock(); |
| 6940 | layer_data->instance_dispatch_table.DestroyDebugReportCallbackEXT(instance, callback, pAllocator); |
| 6941 | |
| 6942 | } |
| 6943 | |
| 6944 | void DispatchDebugReportMessageEXT( |
| 6945 | VkInstance instance, |
| 6946 | VkDebugReportFlagsEXT flags, |
| 6947 | VkDebugReportObjectTypeEXT objectType, |
| 6948 | uint64_t object, |
| 6949 | size_t location, |
| 6950 | int32_t messageCode, |
| 6951 | const char* pLayerPrefix, |
| 6952 | const char* pMessage) |
| 6953 | { |
| 6954 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 6955 | layer_data->instance_dispatch_table.DebugReportMessageEXT(instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage); |
| 6956 | |
| 6957 | } |
| 6958 | |
| 6959 | // Skip vkDebugMarkerSetObjectTagEXT dispatch, manually generated |
| 6960 | |
| 6961 | // Skip vkDebugMarkerSetObjectNameEXT dispatch, manually generated |
| 6962 | |
| 6963 | void DispatchCmdDebugMarkerBeginEXT( |
| 6964 | VkCommandBuffer commandBuffer, |
| 6965 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 6966 | { |
| 6967 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6968 | layer_data->device_dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); |
| 6969 | |
| 6970 | } |
| 6971 | |
| 6972 | void DispatchCmdDebugMarkerEndEXT( |
| 6973 | VkCommandBuffer commandBuffer) |
| 6974 | { |
| 6975 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6976 | layer_data->device_dispatch_table.CmdDebugMarkerEndEXT(commandBuffer); |
| 6977 | |
| 6978 | } |
| 6979 | |
| 6980 | void DispatchCmdDebugMarkerInsertEXT( |
| 6981 | VkCommandBuffer commandBuffer, |
| 6982 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 6983 | { |
| 6984 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6985 | layer_data->device_dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); |
| 6986 | |
| 6987 | } |
| 6988 | |
| 6989 | void DispatchCmdBindTransformFeedbackBuffersEXT( |
| 6990 | VkCommandBuffer commandBuffer, |
| 6991 | uint32_t firstBinding, |
| 6992 | uint32_t bindingCount, |
| 6993 | const VkBuffer* pBuffers, |
| 6994 | const VkDeviceSize* pOffsets, |
| 6995 | const VkDeviceSize* pSizes) |
| 6996 | { |
| 6997 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6998 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes); |
| 6999 | VkBuffer *local_pBuffers = NULL; |
| 7000 | { |
| 7001 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7002 | if (pBuffers) { |
| 7003 | local_pBuffers = new VkBuffer[bindingCount]; |
| 7004 | for (uint32_t index0 = 0; index0 < bindingCount; ++index0) { |
| 7005 | local_pBuffers[index0] = layer_data->Unwrap(pBuffers[index0]); |
| 7006 | } |
| 7007 | } |
| 7008 | } |
| 7009 | layer_data->device_dispatch_table.CmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, (const VkBuffer*)local_pBuffers, pOffsets, pSizes); |
| 7010 | if (local_pBuffers) |
| 7011 | delete[] local_pBuffers; |
| 7012 | } |
| 7013 | |
| 7014 | void DispatchCmdBeginTransformFeedbackEXT( |
| 7015 | VkCommandBuffer commandBuffer, |
| 7016 | uint32_t firstCounterBuffer, |
| 7017 | uint32_t counterBufferCount, |
| 7018 | const VkBuffer* pCounterBuffers, |
| 7019 | const VkDeviceSize* pCounterBufferOffsets) |
| 7020 | { |
| 7021 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7022 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets); |
| 7023 | VkBuffer *local_pCounterBuffers = NULL; |
| 7024 | { |
| 7025 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7026 | if (pCounterBuffers) { |
| 7027 | local_pCounterBuffers = new VkBuffer[counterBufferCount]; |
| 7028 | for (uint32_t index0 = 0; index0 < counterBufferCount; ++index0) { |
| 7029 | local_pCounterBuffers[index0] = layer_data->Unwrap(pCounterBuffers[index0]); |
| 7030 | } |
| 7031 | } |
| 7032 | } |
| 7033 | layer_data->device_dispatch_table.CmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, (const VkBuffer*)local_pCounterBuffers, pCounterBufferOffsets); |
| 7034 | if (local_pCounterBuffers) |
| 7035 | delete[] local_pCounterBuffers; |
| 7036 | } |
| 7037 | |
| 7038 | void DispatchCmdEndTransformFeedbackEXT( |
| 7039 | VkCommandBuffer commandBuffer, |
| 7040 | uint32_t firstCounterBuffer, |
| 7041 | uint32_t counterBufferCount, |
| 7042 | const VkBuffer* pCounterBuffers, |
| 7043 | const VkDeviceSize* pCounterBufferOffsets) |
| 7044 | { |
| 7045 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7046 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets); |
| 7047 | VkBuffer *local_pCounterBuffers = NULL; |
| 7048 | { |
| 7049 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7050 | if (pCounterBuffers) { |
| 7051 | local_pCounterBuffers = new VkBuffer[counterBufferCount]; |
| 7052 | for (uint32_t index0 = 0; index0 < counterBufferCount; ++index0) { |
| 7053 | local_pCounterBuffers[index0] = layer_data->Unwrap(pCounterBuffers[index0]); |
| 7054 | } |
| 7055 | } |
| 7056 | } |
| 7057 | layer_data->device_dispatch_table.CmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, (const VkBuffer*)local_pCounterBuffers, pCounterBufferOffsets); |
| 7058 | if (local_pCounterBuffers) |
| 7059 | delete[] local_pCounterBuffers; |
| 7060 | } |
| 7061 | |
| 7062 | void DispatchCmdBeginQueryIndexedEXT( |
| 7063 | VkCommandBuffer commandBuffer, |
| 7064 | VkQueryPool queryPool, |
| 7065 | uint32_t query, |
| 7066 | VkQueryControlFlags flags, |
| 7067 | uint32_t index) |
| 7068 | { |
| 7069 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7070 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index); |
| 7071 | { |
| 7072 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7073 | queryPool = layer_data->Unwrap(queryPool); |
| 7074 | } |
| 7075 | layer_data->device_dispatch_table.CmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index); |
| 7076 | |
| 7077 | } |
| 7078 | |
| 7079 | void DispatchCmdEndQueryIndexedEXT( |
| 7080 | VkCommandBuffer commandBuffer, |
| 7081 | VkQueryPool queryPool, |
| 7082 | uint32_t query, |
| 7083 | uint32_t index) |
| 7084 | { |
| 7085 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7086 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index); |
| 7087 | { |
| 7088 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7089 | queryPool = layer_data->Unwrap(queryPool); |
| 7090 | } |
| 7091 | layer_data->device_dispatch_table.CmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index); |
| 7092 | |
| 7093 | } |
| 7094 | |
| 7095 | void DispatchCmdDrawIndirectByteCountEXT( |
| 7096 | VkCommandBuffer commandBuffer, |
| 7097 | uint32_t instanceCount, |
| 7098 | uint32_t firstInstance, |
| 7099 | VkBuffer counterBuffer, |
| 7100 | VkDeviceSize counterBufferOffset, |
| 7101 | uint32_t counterOffset, |
| 7102 | uint32_t vertexStride) |
| 7103 | { |
| 7104 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7105 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride); |
| 7106 | { |
| 7107 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7108 | counterBuffer = layer_data->Unwrap(counterBuffer); |
| 7109 | } |
| 7110 | layer_data->device_dispatch_table.CmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride); |
| 7111 | |
| 7112 | } |
| 7113 | |
| 7114 | uint32_t DispatchGetImageViewHandleNVX( |
| 7115 | VkDevice device, |
| 7116 | const VkImageViewHandleInfoNVX* pInfo) |
| 7117 | { |
| 7118 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7119 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageViewHandleNVX(device, pInfo); |
| 7120 | safe_VkImageViewHandleInfoNVX *local_pInfo = NULL; |
| 7121 | { |
| 7122 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7123 | if (pInfo) { |
| 7124 | local_pInfo = new safe_VkImageViewHandleInfoNVX(pInfo); |
| 7125 | if (pInfo->imageView) { |
| 7126 | local_pInfo->imageView = layer_data->Unwrap(pInfo->imageView); |
| 7127 | } |
| 7128 | if (pInfo->sampler) { |
| 7129 | local_pInfo->sampler = layer_data->Unwrap(pInfo->sampler); |
| 7130 | } |
| 7131 | } |
| 7132 | } |
| 7133 | uint32_t result = layer_data->device_dispatch_table.GetImageViewHandleNVX(device, (const VkImageViewHandleInfoNVX*)local_pInfo); |
| 7134 | if (local_pInfo) { |
| 7135 | delete local_pInfo; |
| 7136 | } |
| 7137 | return result; |
| 7138 | } |
| 7139 | |
| 7140 | void DispatchCmdDrawIndirectCountAMD( |
| 7141 | VkCommandBuffer commandBuffer, |
| 7142 | VkBuffer buffer, |
| 7143 | VkDeviceSize offset, |
| 7144 | VkBuffer countBuffer, |
| 7145 | VkDeviceSize countBufferOffset, |
| 7146 | uint32_t maxDrawCount, |
| 7147 | uint32_t stride) |
| 7148 | { |
| 7149 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7150 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 7151 | { |
| 7152 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7153 | buffer = layer_data->Unwrap(buffer); |
| 7154 | countBuffer = layer_data->Unwrap(countBuffer); |
| 7155 | } |
| 7156 | layer_data->device_dispatch_table.CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 7157 | |
| 7158 | } |
| 7159 | |
| 7160 | void DispatchCmdDrawIndexedIndirectCountAMD( |
| 7161 | VkCommandBuffer commandBuffer, |
| 7162 | VkBuffer buffer, |
| 7163 | VkDeviceSize offset, |
| 7164 | VkBuffer countBuffer, |
| 7165 | VkDeviceSize countBufferOffset, |
| 7166 | uint32_t maxDrawCount, |
| 7167 | uint32_t stride) |
| 7168 | { |
| 7169 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7170 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 7171 | { |
| 7172 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7173 | buffer = layer_data->Unwrap(buffer); |
| 7174 | countBuffer = layer_data->Unwrap(countBuffer); |
| 7175 | } |
| 7176 | layer_data->device_dispatch_table.CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 7177 | |
| 7178 | } |
| 7179 | |
| 7180 | VkResult DispatchGetShaderInfoAMD( |
| 7181 | VkDevice device, |
| 7182 | VkPipeline pipeline, |
| 7183 | VkShaderStageFlagBits shaderStage, |
| 7184 | VkShaderInfoTypeAMD infoType, |
| 7185 | size_t* pInfoSize, |
| 7186 | void* pInfo) |
| 7187 | { |
| 7188 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7189 | if (!wrap_handles) return layer_data->device_dispatch_table.GetShaderInfoAMD(device, pipeline, shaderStage, infoType, pInfoSize, pInfo); |
| 7190 | { |
| 7191 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7192 | pipeline = layer_data->Unwrap(pipeline); |
| 7193 | } |
| 7194 | VkResult result = layer_data->device_dispatch_table.GetShaderInfoAMD(device, pipeline, shaderStage, infoType, pInfoSize, pInfo); |
| 7195 | |
| 7196 | return result; |
| 7197 | } |
| 7198 | |
| 7199 | #ifdef VK_USE_PLATFORM_GGP |
| 7200 | |
| 7201 | VkResult DispatchCreateStreamDescriptorSurfaceGGP( |
| 7202 | VkInstance instance, |
| 7203 | const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, |
| 7204 | const VkAllocationCallbacks* pAllocator, |
| 7205 | VkSurfaceKHR* pSurface) |
| 7206 | { |
| 7207 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 7208 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface); |
| 7209 | VkResult result = layer_data->instance_dispatch_table.CreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface); |
| 7210 | if (VK_SUCCESS == result) { |
| 7211 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7212 | *pSurface = layer_data->WrapNew(*pSurface); |
| 7213 | } |
| 7214 | return result; |
| 7215 | } |
| 7216 | #endif // VK_USE_PLATFORM_GGP |
| 7217 | |
| 7218 | VkResult DispatchGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 7219 | VkPhysicalDevice physicalDevice, |
| 7220 | VkFormat format, |
| 7221 | VkImageType type, |
| 7222 | VkImageTiling tiling, |
| 7223 | VkImageUsageFlags usage, |
| 7224 | VkImageCreateFlags flags, |
| 7225 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 7226 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) |
| 7227 | { |
| 7228 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 7229 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties); |
| 7230 | |
| 7231 | return result; |
| 7232 | } |
| 7233 | |
| 7234 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 7235 | |
| 7236 | VkResult DispatchGetMemoryWin32HandleNV( |
| 7237 | VkDevice device, |
| 7238 | VkDeviceMemory memory, |
| 7239 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 7240 | HANDLE* pHandle) |
| 7241 | { |
| 7242 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7243 | if (!wrap_handles) return layer_data->device_dispatch_table.GetMemoryWin32HandleNV(device, memory, handleType, pHandle); |
| 7244 | { |
| 7245 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7246 | memory = layer_data->Unwrap(memory); |
| 7247 | } |
| 7248 | VkResult result = layer_data->device_dispatch_table.GetMemoryWin32HandleNV(device, memory, handleType, pHandle); |
| 7249 | |
| 7250 | return result; |
| 7251 | } |
| 7252 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 7253 | |
| 7254 | #ifdef VK_USE_PLATFORM_VI_NN |
| 7255 | |
| 7256 | VkResult DispatchCreateViSurfaceNN( |
| 7257 | VkInstance instance, |
| 7258 | const VkViSurfaceCreateInfoNN* pCreateInfo, |
| 7259 | const VkAllocationCallbacks* pAllocator, |
| 7260 | VkSurfaceKHR* pSurface) |
| 7261 | { |
| 7262 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 7263 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface); |
| 7264 | VkResult result = layer_data->instance_dispatch_table.CreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface); |
| 7265 | if (VK_SUCCESS == result) { |
| 7266 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7267 | *pSurface = layer_data->WrapNew(*pSurface); |
| 7268 | } |
| 7269 | return result; |
| 7270 | } |
| 7271 | #endif // VK_USE_PLATFORM_VI_NN |
| 7272 | |
| 7273 | void DispatchCmdBeginConditionalRenderingEXT( |
| 7274 | VkCommandBuffer commandBuffer, |
| 7275 | const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) |
| 7276 | { |
| 7277 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7278 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin); |
| 7279 | safe_VkConditionalRenderingBeginInfoEXT *local_pConditionalRenderingBegin = NULL; |
| 7280 | { |
| 7281 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7282 | if (pConditionalRenderingBegin) { |
| 7283 | local_pConditionalRenderingBegin = new safe_VkConditionalRenderingBeginInfoEXT(pConditionalRenderingBegin); |
| 7284 | if (pConditionalRenderingBegin->buffer) { |
| 7285 | local_pConditionalRenderingBegin->buffer = layer_data->Unwrap(pConditionalRenderingBegin->buffer); |
| 7286 | } |
| 7287 | } |
| 7288 | } |
| 7289 | layer_data->device_dispatch_table.CmdBeginConditionalRenderingEXT(commandBuffer, (const VkConditionalRenderingBeginInfoEXT*)local_pConditionalRenderingBegin); |
| 7290 | if (local_pConditionalRenderingBegin) { |
| 7291 | delete local_pConditionalRenderingBegin; |
| 7292 | } |
| 7293 | } |
| 7294 | |
| 7295 | void DispatchCmdEndConditionalRenderingEXT( |
| 7296 | VkCommandBuffer commandBuffer) |
| 7297 | { |
| 7298 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7299 | layer_data->device_dispatch_table.CmdEndConditionalRenderingEXT(commandBuffer); |
| 7300 | |
| 7301 | } |
| 7302 | |
| 7303 | void DispatchCmdProcessCommandsNVX( |
| 7304 | VkCommandBuffer commandBuffer, |
| 7305 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) |
| 7306 | { |
| 7307 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7308 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); |
| 7309 | safe_VkCmdProcessCommandsInfoNVX *local_pProcessCommandsInfo = NULL; |
| 7310 | { |
| 7311 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7312 | if (pProcessCommandsInfo) { |
| 7313 | local_pProcessCommandsInfo = new safe_VkCmdProcessCommandsInfoNVX(pProcessCommandsInfo); |
| 7314 | if (pProcessCommandsInfo->objectTable) { |
| 7315 | local_pProcessCommandsInfo->objectTable = layer_data->Unwrap(pProcessCommandsInfo->objectTable); |
| 7316 | } |
| 7317 | if (pProcessCommandsInfo->indirectCommandsLayout) { |
| 7318 | local_pProcessCommandsInfo->indirectCommandsLayout = layer_data->Unwrap(pProcessCommandsInfo->indirectCommandsLayout); |
| 7319 | } |
| 7320 | if (local_pProcessCommandsInfo->pIndirectCommandsTokens) { |
| 7321 | for (uint32_t index1 = 0; index1 < local_pProcessCommandsInfo->indirectCommandsTokenCount; ++index1) { |
| 7322 | if (pProcessCommandsInfo->pIndirectCommandsTokens[index1].buffer) { |
| 7323 | local_pProcessCommandsInfo->pIndirectCommandsTokens[index1].buffer = layer_data->Unwrap(pProcessCommandsInfo->pIndirectCommandsTokens[index1].buffer); |
| 7324 | } |
| 7325 | } |
| 7326 | } |
| 7327 | if (pProcessCommandsInfo->sequencesCountBuffer) { |
| 7328 | local_pProcessCommandsInfo->sequencesCountBuffer = layer_data->Unwrap(pProcessCommandsInfo->sequencesCountBuffer); |
| 7329 | } |
| 7330 | if (pProcessCommandsInfo->sequencesIndexBuffer) { |
| 7331 | local_pProcessCommandsInfo->sequencesIndexBuffer = layer_data->Unwrap(pProcessCommandsInfo->sequencesIndexBuffer); |
| 7332 | } |
| 7333 | } |
| 7334 | } |
| 7335 | layer_data->device_dispatch_table.CmdProcessCommandsNVX(commandBuffer, (const VkCmdProcessCommandsInfoNVX*)local_pProcessCommandsInfo); |
| 7336 | if (local_pProcessCommandsInfo) { |
| 7337 | delete local_pProcessCommandsInfo; |
| 7338 | } |
| 7339 | } |
| 7340 | |
| 7341 | void DispatchCmdReserveSpaceForCommandsNVX( |
| 7342 | VkCommandBuffer commandBuffer, |
| 7343 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) |
| 7344 | { |
| 7345 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7346 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); |
| 7347 | safe_VkCmdReserveSpaceForCommandsInfoNVX *local_pReserveSpaceInfo = NULL; |
| 7348 | { |
| 7349 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7350 | if (pReserveSpaceInfo) { |
| 7351 | local_pReserveSpaceInfo = new safe_VkCmdReserveSpaceForCommandsInfoNVX(pReserveSpaceInfo); |
| 7352 | if (pReserveSpaceInfo->objectTable) { |
| 7353 | local_pReserveSpaceInfo->objectTable = layer_data->Unwrap(pReserveSpaceInfo->objectTable); |
| 7354 | } |
| 7355 | if (pReserveSpaceInfo->indirectCommandsLayout) { |
| 7356 | local_pReserveSpaceInfo->indirectCommandsLayout = layer_data->Unwrap(pReserveSpaceInfo->indirectCommandsLayout); |
| 7357 | } |
| 7358 | } |
| 7359 | } |
| 7360 | layer_data->device_dispatch_table.CmdReserveSpaceForCommandsNVX(commandBuffer, (const VkCmdReserveSpaceForCommandsInfoNVX*)local_pReserveSpaceInfo); |
| 7361 | if (local_pReserveSpaceInfo) { |
| 7362 | delete local_pReserveSpaceInfo; |
| 7363 | } |
| 7364 | } |
| 7365 | |
| 7366 | VkResult DispatchCreateIndirectCommandsLayoutNVX( |
| 7367 | VkDevice device, |
| 7368 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 7369 | const VkAllocationCallbacks* pAllocator, |
| 7370 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) |
| 7371 | { |
| 7372 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7373 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); |
| 7374 | VkResult result = layer_data->device_dispatch_table.CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); |
| 7375 | if (VK_SUCCESS == result) { |
| 7376 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7377 | *pIndirectCommandsLayout = layer_data->WrapNew(*pIndirectCommandsLayout); |
| 7378 | } |
| 7379 | return result; |
| 7380 | } |
| 7381 | |
| 7382 | void DispatchDestroyIndirectCommandsLayoutNVX( |
| 7383 | VkDevice device, |
| 7384 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 7385 | const VkAllocationCallbacks* pAllocator) |
| 7386 | { |
| 7387 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7388 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); |
| 7389 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 7390 | uint64_t indirectCommandsLayout_id = reinterpret_cast<uint64_t &>(indirectCommandsLayout); |
| 7391 | indirectCommandsLayout = (VkIndirectCommandsLayoutNVX)unique_id_mapping[indirectCommandsLayout_id]; |
| 7392 | unique_id_mapping.erase(indirectCommandsLayout_id); |
| 7393 | lock.unlock(); |
| 7394 | layer_data->device_dispatch_table.DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); |
| 7395 | |
| 7396 | } |
| 7397 | |
| 7398 | VkResult DispatchCreateObjectTableNVX( |
| 7399 | VkDevice device, |
| 7400 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 7401 | const VkAllocationCallbacks* pAllocator, |
| 7402 | VkObjectTableNVX* pObjectTable) |
| 7403 | { |
| 7404 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7405 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); |
| 7406 | VkResult result = layer_data->device_dispatch_table.CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); |
| 7407 | if (VK_SUCCESS == result) { |
| 7408 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7409 | *pObjectTable = layer_data->WrapNew(*pObjectTable); |
| 7410 | } |
| 7411 | return result; |
| 7412 | } |
| 7413 | |
| 7414 | void DispatchDestroyObjectTableNVX( |
| 7415 | VkDevice device, |
| 7416 | VkObjectTableNVX objectTable, |
| 7417 | const VkAllocationCallbacks* pAllocator) |
| 7418 | { |
| 7419 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7420 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyObjectTableNVX(device, objectTable, pAllocator); |
| 7421 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 7422 | uint64_t objectTable_id = reinterpret_cast<uint64_t &>(objectTable); |
| 7423 | objectTable = (VkObjectTableNVX)unique_id_mapping[objectTable_id]; |
| 7424 | unique_id_mapping.erase(objectTable_id); |
| 7425 | lock.unlock(); |
| 7426 | layer_data->device_dispatch_table.DestroyObjectTableNVX(device, objectTable, pAllocator); |
| 7427 | |
| 7428 | } |
| 7429 | |
| 7430 | VkResult DispatchRegisterObjectsNVX( |
| 7431 | VkDevice device, |
| 7432 | VkObjectTableNVX objectTable, |
| 7433 | uint32_t objectCount, |
| 7434 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 7435 | const uint32_t* pObjectIndices) |
| 7436 | { |
| 7437 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7438 | if (!wrap_handles) return layer_data->device_dispatch_table.RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); |
| 7439 | { |
| 7440 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7441 | objectTable = layer_data->Unwrap(objectTable); |
| 7442 | } |
| 7443 | VkResult result = layer_data->device_dispatch_table.RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); |
| 7444 | |
| 7445 | return result; |
| 7446 | } |
| 7447 | |
| 7448 | VkResult DispatchUnregisterObjectsNVX( |
| 7449 | VkDevice device, |
| 7450 | VkObjectTableNVX objectTable, |
| 7451 | uint32_t objectCount, |
| 7452 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 7453 | const uint32_t* pObjectIndices) |
| 7454 | { |
| 7455 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7456 | if (!wrap_handles) return layer_data->device_dispatch_table.UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); |
| 7457 | { |
| 7458 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7459 | objectTable = layer_data->Unwrap(objectTable); |
| 7460 | } |
| 7461 | VkResult result = layer_data->device_dispatch_table.UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); |
| 7462 | |
| 7463 | return result; |
| 7464 | } |
| 7465 | |
| 7466 | void DispatchGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 7467 | VkPhysicalDevice physicalDevice, |
| 7468 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 7469 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) |
| 7470 | { |
| 7471 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 7472 | layer_data->instance_dispatch_table.GetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits); |
| 7473 | |
| 7474 | } |
| 7475 | |
| 7476 | void DispatchCmdSetViewportWScalingNV( |
| 7477 | VkCommandBuffer commandBuffer, |
| 7478 | uint32_t firstViewport, |
| 7479 | uint32_t viewportCount, |
| 7480 | const VkViewportWScalingNV* pViewportWScalings) |
| 7481 | { |
| 7482 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7483 | layer_data->device_dispatch_table.CmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings); |
| 7484 | |
| 7485 | } |
| 7486 | |
| 7487 | VkResult DispatchReleaseDisplayEXT( |
| 7488 | VkPhysicalDevice physicalDevice, |
| 7489 | VkDisplayKHR display) |
| 7490 | { |
| 7491 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 7492 | if (!wrap_handles) return layer_data->instance_dispatch_table.ReleaseDisplayEXT(physicalDevice, display); |
| 7493 | { |
| 7494 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7495 | display = layer_data->Unwrap(display); |
| 7496 | } |
| 7497 | VkResult result = layer_data->instance_dispatch_table.ReleaseDisplayEXT(physicalDevice, display); |
| 7498 | |
| 7499 | return result; |
| 7500 | } |
| 7501 | |
| 7502 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 7503 | |
| 7504 | VkResult DispatchAcquireXlibDisplayEXT( |
| 7505 | VkPhysicalDevice physicalDevice, |
| 7506 | Display* dpy, |
| 7507 | VkDisplayKHR display) |
| 7508 | { |
| 7509 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 7510 | if (!wrap_handles) return layer_data->instance_dispatch_table.AcquireXlibDisplayEXT(physicalDevice, dpy, display); |
| 7511 | { |
| 7512 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7513 | display = layer_data->Unwrap(display); |
| 7514 | } |
| 7515 | VkResult result = layer_data->instance_dispatch_table.AcquireXlibDisplayEXT(physicalDevice, dpy, display); |
| 7516 | |
| 7517 | return result; |
| 7518 | } |
| 7519 | #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 7520 | |
| 7521 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 7522 | |
| 7523 | VkResult DispatchGetRandROutputDisplayEXT( |
| 7524 | VkPhysicalDevice physicalDevice, |
| 7525 | Display* dpy, |
| 7526 | RROutput rrOutput, |
| 7527 | VkDisplayKHR* pDisplay) |
| 7528 | { |
| 7529 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 7530 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay); |
| 7531 | VkResult result = layer_data->instance_dispatch_table.GetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay); |
| 7532 | if (VK_SUCCESS == result) { |
| 7533 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7534 | *pDisplay = layer_data->WrapNew(*pDisplay); |
| 7535 | } |
| 7536 | return result; |
| 7537 | } |
| 7538 | #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 7539 | |
| 7540 | VkResult DispatchGetPhysicalDeviceSurfaceCapabilities2EXT( |
| 7541 | VkPhysicalDevice physicalDevice, |
| 7542 | VkSurfaceKHR surface, |
| 7543 | VkSurfaceCapabilities2EXT* pSurfaceCapabilities) |
| 7544 | { |
| 7545 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 7546 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities); |
| 7547 | { |
| 7548 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7549 | surface = layer_data->Unwrap(surface); |
| 7550 | } |
| 7551 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities); |
| 7552 | |
| 7553 | return result; |
| 7554 | } |
| 7555 | |
| 7556 | VkResult DispatchDisplayPowerControlEXT( |
| 7557 | VkDevice device, |
| 7558 | VkDisplayKHR display, |
| 7559 | const VkDisplayPowerInfoEXT* pDisplayPowerInfo) |
| 7560 | { |
| 7561 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7562 | if (!wrap_handles) return layer_data->device_dispatch_table.DisplayPowerControlEXT(device, display, pDisplayPowerInfo); |
| 7563 | { |
| 7564 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7565 | display = layer_data->Unwrap(display); |
| 7566 | } |
| 7567 | VkResult result = layer_data->device_dispatch_table.DisplayPowerControlEXT(device, display, pDisplayPowerInfo); |
| 7568 | |
| 7569 | return result; |
| 7570 | } |
| 7571 | |
| 7572 | VkResult DispatchRegisterDeviceEventEXT( |
| 7573 | VkDevice device, |
| 7574 | const VkDeviceEventInfoEXT* pDeviceEventInfo, |
| 7575 | const VkAllocationCallbacks* pAllocator, |
| 7576 | VkFence* pFence) |
| 7577 | { |
| 7578 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7579 | if (!wrap_handles) return layer_data->device_dispatch_table.RegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence); |
| 7580 | VkResult result = layer_data->device_dispatch_table.RegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence); |
| 7581 | if (VK_SUCCESS == result) { |
| 7582 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7583 | *pFence = layer_data->WrapNew(*pFence); |
| 7584 | } |
| 7585 | return result; |
| 7586 | } |
| 7587 | |
| 7588 | VkResult DispatchRegisterDisplayEventEXT( |
| 7589 | VkDevice device, |
| 7590 | VkDisplayKHR display, |
| 7591 | const VkDisplayEventInfoEXT* pDisplayEventInfo, |
| 7592 | const VkAllocationCallbacks* pAllocator, |
| 7593 | VkFence* pFence) |
| 7594 | { |
| 7595 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7596 | if (!wrap_handles) return layer_data->device_dispatch_table.RegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence); |
| 7597 | { |
| 7598 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7599 | display = layer_data->Unwrap(display); |
| 7600 | } |
| 7601 | VkResult result = layer_data->device_dispatch_table.RegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence); |
| 7602 | if (VK_SUCCESS == result) { |
| 7603 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7604 | *pFence = layer_data->WrapNew(*pFence); |
| 7605 | } |
| 7606 | return result; |
| 7607 | } |
| 7608 | |
| 7609 | VkResult DispatchGetSwapchainCounterEXT( |
| 7610 | VkDevice device, |
| 7611 | VkSwapchainKHR swapchain, |
| 7612 | VkSurfaceCounterFlagBitsEXT counter, |
| 7613 | uint64_t* pCounterValue) |
| 7614 | { |
| 7615 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7616 | if (!wrap_handles) return layer_data->device_dispatch_table.GetSwapchainCounterEXT(device, swapchain, counter, pCounterValue); |
| 7617 | { |
| 7618 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7619 | swapchain = layer_data->Unwrap(swapchain); |
| 7620 | } |
| 7621 | VkResult result = layer_data->device_dispatch_table.GetSwapchainCounterEXT(device, swapchain, counter, pCounterValue); |
| 7622 | |
| 7623 | return result; |
| 7624 | } |
| 7625 | |
| 7626 | VkResult DispatchGetRefreshCycleDurationGOOGLE( |
| 7627 | VkDevice device, |
| 7628 | VkSwapchainKHR swapchain, |
| 7629 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) |
| 7630 | { |
| 7631 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7632 | if (!wrap_handles) return layer_data->device_dispatch_table.GetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties); |
| 7633 | { |
| 7634 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7635 | swapchain = layer_data->Unwrap(swapchain); |
| 7636 | } |
| 7637 | VkResult result = layer_data->device_dispatch_table.GetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties); |
| 7638 | |
| 7639 | return result; |
| 7640 | } |
| 7641 | |
| 7642 | VkResult DispatchGetPastPresentationTimingGOOGLE( |
| 7643 | VkDevice device, |
| 7644 | VkSwapchainKHR swapchain, |
| 7645 | uint32_t* pPresentationTimingCount, |
| 7646 | VkPastPresentationTimingGOOGLE* pPresentationTimings) |
| 7647 | { |
| 7648 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7649 | if (!wrap_handles) return layer_data->device_dispatch_table.GetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings); |
| 7650 | { |
| 7651 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7652 | swapchain = layer_data->Unwrap(swapchain); |
| 7653 | } |
| 7654 | VkResult result = layer_data->device_dispatch_table.GetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings); |
| 7655 | |
| 7656 | return result; |
| 7657 | } |
| 7658 | |
| 7659 | void DispatchCmdSetDiscardRectangleEXT( |
| 7660 | VkCommandBuffer commandBuffer, |
| 7661 | uint32_t firstDiscardRectangle, |
| 7662 | uint32_t discardRectangleCount, |
| 7663 | const VkRect2D* pDiscardRectangles) |
| 7664 | { |
| 7665 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7666 | layer_data->device_dispatch_table.CmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles); |
| 7667 | |
| 7668 | } |
| 7669 | |
| 7670 | void DispatchSetHdrMetadataEXT( |
| 7671 | VkDevice device, |
| 7672 | uint32_t swapchainCount, |
| 7673 | const VkSwapchainKHR* pSwapchains, |
| 7674 | const VkHdrMetadataEXT* pMetadata) |
| 7675 | { |
| 7676 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7677 | if (!wrap_handles) return layer_data->device_dispatch_table.SetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata); |
| 7678 | VkSwapchainKHR *local_pSwapchains = NULL; |
| 7679 | { |
| 7680 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7681 | if (pSwapchains) { |
| 7682 | local_pSwapchains = new VkSwapchainKHR[swapchainCount]; |
| 7683 | for (uint32_t index0 = 0; index0 < swapchainCount; ++index0) { |
| 7684 | local_pSwapchains[index0] = layer_data->Unwrap(pSwapchains[index0]); |
| 7685 | } |
| 7686 | } |
| 7687 | } |
| 7688 | layer_data->device_dispatch_table.SetHdrMetadataEXT(device, swapchainCount, (const VkSwapchainKHR*)local_pSwapchains, pMetadata); |
| 7689 | if (local_pSwapchains) |
| 7690 | delete[] local_pSwapchains; |
| 7691 | } |
| 7692 | |
| 7693 | #ifdef VK_USE_PLATFORM_IOS_MVK |
| 7694 | |
| 7695 | VkResult DispatchCreateIOSSurfaceMVK( |
| 7696 | VkInstance instance, |
| 7697 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, |
| 7698 | const VkAllocationCallbacks* pAllocator, |
| 7699 | VkSurfaceKHR* pSurface) |
| 7700 | { |
| 7701 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 7702 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); |
| 7703 | VkResult result = layer_data->instance_dispatch_table.CreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); |
| 7704 | if (VK_SUCCESS == result) { |
| 7705 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7706 | *pSurface = layer_data->WrapNew(*pSurface); |
| 7707 | } |
| 7708 | return result; |
| 7709 | } |
| 7710 | #endif // VK_USE_PLATFORM_IOS_MVK |
| 7711 | |
| 7712 | #ifdef VK_USE_PLATFORM_MACOS_MVK |
| 7713 | |
| 7714 | VkResult DispatchCreateMacOSSurfaceMVK( |
| 7715 | VkInstance instance, |
| 7716 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, |
| 7717 | const VkAllocationCallbacks* pAllocator, |
| 7718 | VkSurfaceKHR* pSurface) |
| 7719 | { |
| 7720 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 7721 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); |
| 7722 | VkResult result = layer_data->instance_dispatch_table.CreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); |
| 7723 | if (VK_SUCCESS == result) { |
| 7724 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7725 | *pSurface = layer_data->WrapNew(*pSurface); |
| 7726 | } |
| 7727 | return result; |
| 7728 | } |
| 7729 | #endif // VK_USE_PLATFORM_MACOS_MVK |
| 7730 | |
| 7731 | // Skip vkSetDebugUtilsObjectNameEXT dispatch, manually generated |
| 7732 | |
| 7733 | // Skip vkSetDebugUtilsObjectTagEXT dispatch, manually generated |
| 7734 | |
| 7735 | void DispatchQueueBeginDebugUtilsLabelEXT( |
| 7736 | VkQueue queue, |
| 7737 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 7738 | { |
| 7739 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 7740 | layer_data->device_dispatch_table.QueueBeginDebugUtilsLabelEXT(queue, pLabelInfo); |
| 7741 | |
| 7742 | } |
| 7743 | |
| 7744 | void DispatchQueueEndDebugUtilsLabelEXT( |
| 7745 | VkQueue queue) |
| 7746 | { |
| 7747 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 7748 | layer_data->device_dispatch_table.QueueEndDebugUtilsLabelEXT(queue); |
| 7749 | |
| 7750 | } |
| 7751 | |
| 7752 | void DispatchQueueInsertDebugUtilsLabelEXT( |
| 7753 | VkQueue queue, |
| 7754 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 7755 | { |
| 7756 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 7757 | layer_data->device_dispatch_table.QueueInsertDebugUtilsLabelEXT(queue, pLabelInfo); |
| 7758 | |
| 7759 | } |
| 7760 | |
| 7761 | void DispatchCmdBeginDebugUtilsLabelEXT( |
| 7762 | VkCommandBuffer commandBuffer, |
| 7763 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 7764 | { |
| 7765 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7766 | layer_data->device_dispatch_table.CmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo); |
| 7767 | |
| 7768 | } |
| 7769 | |
| 7770 | void DispatchCmdEndDebugUtilsLabelEXT( |
| 7771 | VkCommandBuffer commandBuffer) |
| 7772 | { |
| 7773 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7774 | layer_data->device_dispatch_table.CmdEndDebugUtilsLabelEXT(commandBuffer); |
| 7775 | |
| 7776 | } |
| 7777 | |
| 7778 | void DispatchCmdInsertDebugUtilsLabelEXT( |
| 7779 | VkCommandBuffer commandBuffer, |
| 7780 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 7781 | { |
| 7782 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7783 | layer_data->device_dispatch_table.CmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo); |
| 7784 | |
| 7785 | } |
| 7786 | |
| 7787 | VkResult DispatchCreateDebugUtilsMessengerEXT( |
| 7788 | VkInstance instance, |
| 7789 | const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, |
| 7790 | const VkAllocationCallbacks* pAllocator, |
| 7791 | VkDebugUtilsMessengerEXT* pMessenger) |
| 7792 | { |
| 7793 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 7794 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); |
| 7795 | VkResult result = layer_data->instance_dispatch_table.CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); |
| 7796 | if (VK_SUCCESS == result) { |
| 7797 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7798 | *pMessenger = layer_data->WrapNew(*pMessenger); |
| 7799 | } |
| 7800 | return result; |
| 7801 | } |
| 7802 | |
| 7803 | void DispatchDestroyDebugUtilsMessengerEXT( |
| 7804 | VkInstance instance, |
| 7805 | VkDebugUtilsMessengerEXT messenger, |
| 7806 | const VkAllocationCallbacks* pAllocator) |
| 7807 | { |
| 7808 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 7809 | if (!wrap_handles) return layer_data->instance_dispatch_table.DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); |
| 7810 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 7811 | uint64_t messenger_id = reinterpret_cast<uint64_t &>(messenger); |
| 7812 | messenger = (VkDebugUtilsMessengerEXT)unique_id_mapping[messenger_id]; |
| 7813 | unique_id_mapping.erase(messenger_id); |
| 7814 | lock.unlock(); |
| 7815 | layer_data->instance_dispatch_table.DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); |
| 7816 | |
| 7817 | } |
| 7818 | |
| 7819 | void DispatchSubmitDebugUtilsMessageEXT( |
| 7820 | VkInstance instance, |
| 7821 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 7822 | VkDebugUtilsMessageTypeFlagsEXT messageTypes, |
| 7823 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) |
| 7824 | { |
| 7825 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 7826 | layer_data->instance_dispatch_table.SubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData); |
| 7827 | |
| 7828 | } |
| 7829 | |
| 7830 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 7831 | |
| 7832 | VkResult DispatchGetAndroidHardwareBufferPropertiesANDROID( |
| 7833 | VkDevice device, |
| 7834 | const struct AHardwareBuffer* buffer, |
| 7835 | VkAndroidHardwareBufferPropertiesANDROID* pProperties) |
| 7836 | { |
| 7837 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7838 | VkResult result = layer_data->device_dispatch_table.GetAndroidHardwareBufferPropertiesANDROID(device, buffer, pProperties); |
| 7839 | |
| 7840 | return result; |
| 7841 | } |
| 7842 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 7843 | |
| 7844 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 7845 | |
| 7846 | VkResult DispatchGetMemoryAndroidHardwareBufferANDROID( |
| 7847 | VkDevice device, |
| 7848 | const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, |
| 7849 | struct AHardwareBuffer** pBuffer) |
| 7850 | { |
| 7851 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7852 | if (!wrap_handles) return layer_data->device_dispatch_table.GetMemoryAndroidHardwareBufferANDROID(device, pInfo, pBuffer); |
| 7853 | safe_VkMemoryGetAndroidHardwareBufferInfoANDROID *local_pInfo = NULL; |
| 7854 | { |
| 7855 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7856 | if (pInfo) { |
| 7857 | local_pInfo = new safe_VkMemoryGetAndroidHardwareBufferInfoANDROID(pInfo); |
| 7858 | if (pInfo->memory) { |
| 7859 | local_pInfo->memory = layer_data->Unwrap(pInfo->memory); |
| 7860 | } |
| 7861 | } |
| 7862 | } |
| 7863 | VkResult result = layer_data->device_dispatch_table.GetMemoryAndroidHardwareBufferANDROID(device, (const VkMemoryGetAndroidHardwareBufferInfoANDROID*)local_pInfo, pBuffer); |
| 7864 | if (local_pInfo) { |
| 7865 | delete local_pInfo; |
| 7866 | } |
| 7867 | return result; |
| 7868 | } |
| 7869 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
| 7870 | |
| 7871 | void DispatchCmdSetSampleLocationsEXT( |
| 7872 | VkCommandBuffer commandBuffer, |
| 7873 | const VkSampleLocationsInfoEXT* pSampleLocationsInfo) |
| 7874 | { |
| 7875 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7876 | layer_data->device_dispatch_table.CmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo); |
| 7877 | |
| 7878 | } |
| 7879 | |
| 7880 | void DispatchGetPhysicalDeviceMultisamplePropertiesEXT( |
| 7881 | VkPhysicalDevice physicalDevice, |
| 7882 | VkSampleCountFlagBits samples, |
| 7883 | VkMultisamplePropertiesEXT* pMultisampleProperties) |
| 7884 | { |
| 7885 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 7886 | layer_data->instance_dispatch_table.GetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples, pMultisampleProperties); |
| 7887 | |
| 7888 | } |
| 7889 | |
| 7890 | VkResult DispatchGetImageDrmFormatModifierPropertiesEXT( |
| 7891 | VkDevice device, |
| 7892 | VkImage image, |
| 7893 | VkImageDrmFormatModifierPropertiesEXT* pProperties) |
| 7894 | { |
| 7895 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7896 | if (!wrap_handles) return layer_data->device_dispatch_table.GetImageDrmFormatModifierPropertiesEXT(device, image, pProperties); |
| 7897 | { |
| 7898 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7899 | image = layer_data->Unwrap(image); |
| 7900 | } |
| 7901 | VkResult result = layer_data->device_dispatch_table.GetImageDrmFormatModifierPropertiesEXT(device, image, pProperties); |
| 7902 | |
| 7903 | return result; |
| 7904 | } |
| 7905 | |
| 7906 | VkResult DispatchCreateValidationCacheEXT( |
| 7907 | VkDevice device, |
| 7908 | const VkValidationCacheCreateInfoEXT* pCreateInfo, |
| 7909 | const VkAllocationCallbacks* pAllocator, |
| 7910 | VkValidationCacheEXT* pValidationCache) |
| 7911 | { |
| 7912 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7913 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateValidationCacheEXT(device, pCreateInfo, pAllocator, pValidationCache); |
| 7914 | VkResult result = layer_data->device_dispatch_table.CreateValidationCacheEXT(device, pCreateInfo, pAllocator, pValidationCache); |
| 7915 | if (VK_SUCCESS == result) { |
| 7916 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7917 | *pValidationCache = layer_data->WrapNew(*pValidationCache); |
| 7918 | } |
| 7919 | return result; |
| 7920 | } |
| 7921 | |
| 7922 | void DispatchDestroyValidationCacheEXT( |
| 7923 | VkDevice device, |
| 7924 | VkValidationCacheEXT validationCache, |
| 7925 | const VkAllocationCallbacks* pAllocator) |
| 7926 | { |
| 7927 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7928 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyValidationCacheEXT(device, validationCache, pAllocator); |
| 7929 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 7930 | uint64_t validationCache_id = reinterpret_cast<uint64_t &>(validationCache); |
| 7931 | validationCache = (VkValidationCacheEXT)unique_id_mapping[validationCache_id]; |
| 7932 | unique_id_mapping.erase(validationCache_id); |
| 7933 | lock.unlock(); |
| 7934 | layer_data->device_dispatch_table.DestroyValidationCacheEXT(device, validationCache, pAllocator); |
| 7935 | |
| 7936 | } |
| 7937 | |
| 7938 | VkResult DispatchMergeValidationCachesEXT( |
| 7939 | VkDevice device, |
| 7940 | VkValidationCacheEXT dstCache, |
| 7941 | uint32_t srcCacheCount, |
| 7942 | const VkValidationCacheEXT* pSrcCaches) |
| 7943 | { |
| 7944 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7945 | if (!wrap_handles) return layer_data->device_dispatch_table.MergeValidationCachesEXT(device, dstCache, srcCacheCount, pSrcCaches); |
| 7946 | VkValidationCacheEXT *local_pSrcCaches = NULL; |
| 7947 | { |
| 7948 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7949 | dstCache = layer_data->Unwrap(dstCache); |
| 7950 | if (pSrcCaches) { |
| 7951 | local_pSrcCaches = new VkValidationCacheEXT[srcCacheCount]; |
| 7952 | for (uint32_t index0 = 0; index0 < srcCacheCount; ++index0) { |
| 7953 | local_pSrcCaches[index0] = layer_data->Unwrap(pSrcCaches[index0]); |
| 7954 | } |
| 7955 | } |
| 7956 | } |
| 7957 | VkResult result = layer_data->device_dispatch_table.MergeValidationCachesEXT(device, dstCache, srcCacheCount, (const VkValidationCacheEXT*)local_pSrcCaches); |
| 7958 | if (local_pSrcCaches) |
| 7959 | delete[] local_pSrcCaches; |
| 7960 | return result; |
| 7961 | } |
| 7962 | |
| 7963 | VkResult DispatchGetValidationCacheDataEXT( |
| 7964 | VkDevice device, |
| 7965 | VkValidationCacheEXT validationCache, |
| 7966 | size_t* pDataSize, |
| 7967 | void* pData) |
| 7968 | { |
| 7969 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 7970 | if (!wrap_handles) return layer_data->device_dispatch_table.GetValidationCacheDataEXT(device, validationCache, pDataSize, pData); |
| 7971 | { |
| 7972 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7973 | validationCache = layer_data->Unwrap(validationCache); |
| 7974 | } |
| 7975 | VkResult result = layer_data->device_dispatch_table.GetValidationCacheDataEXT(device, validationCache, pDataSize, pData); |
| 7976 | |
| 7977 | return result; |
| 7978 | } |
| 7979 | |
| 7980 | void DispatchCmdBindShadingRateImageNV( |
| 7981 | VkCommandBuffer commandBuffer, |
| 7982 | VkImageView imageView, |
| 7983 | VkImageLayout imageLayout) |
| 7984 | { |
| 7985 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 7986 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout); |
| 7987 | { |
| 7988 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 7989 | imageView = layer_data->Unwrap(imageView); |
| 7990 | } |
| 7991 | layer_data->device_dispatch_table.CmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout); |
| 7992 | |
| 7993 | } |
| 7994 | |
| 7995 | void DispatchCmdSetViewportShadingRatePaletteNV( |
| 7996 | VkCommandBuffer commandBuffer, |
| 7997 | uint32_t firstViewport, |
| 7998 | uint32_t viewportCount, |
| 7999 | const VkShadingRatePaletteNV* pShadingRatePalettes) |
| 8000 | { |
| 8001 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8002 | layer_data->device_dispatch_table.CmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount, pShadingRatePalettes); |
| 8003 | |
| 8004 | } |
| 8005 | |
| 8006 | void DispatchCmdSetCoarseSampleOrderNV( |
| 8007 | VkCommandBuffer commandBuffer, |
| 8008 | VkCoarseSampleOrderTypeNV sampleOrderType, |
| 8009 | uint32_t customSampleOrderCount, |
| 8010 | const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) |
| 8011 | { |
| 8012 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8013 | layer_data->device_dispatch_table.CmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount, pCustomSampleOrders); |
| 8014 | |
| 8015 | } |
| 8016 | |
| 8017 | VkResult DispatchCreateAccelerationStructureNV( |
| 8018 | VkDevice device, |
| 8019 | const VkAccelerationStructureCreateInfoNV* pCreateInfo, |
| 8020 | const VkAllocationCallbacks* pAllocator, |
| 8021 | VkAccelerationStructureNV* pAccelerationStructure) |
| 8022 | { |
| 8023 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8024 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure); |
| 8025 | safe_VkAccelerationStructureCreateInfoNV *local_pCreateInfo = NULL; |
| 8026 | { |
| 8027 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8028 | if (pCreateInfo) { |
| 8029 | local_pCreateInfo = new safe_VkAccelerationStructureCreateInfoNV(pCreateInfo); |
| 8030 | if (local_pCreateInfo->info.pGeometries) { |
| 8031 | for (uint32_t index2 = 0; index2 < local_pCreateInfo->info.geometryCount; ++index2) { |
| 8032 | if (pCreateInfo->info.pGeometries[index2].geometry.triangles.vertexData) { |
| 8033 | local_pCreateInfo->info.pGeometries[index2].geometry.triangles.vertexData = layer_data->Unwrap(pCreateInfo->info.pGeometries[index2].geometry.triangles.vertexData); |
| 8034 | } |
| 8035 | if (pCreateInfo->info.pGeometries[index2].geometry.triangles.indexData) { |
| 8036 | local_pCreateInfo->info.pGeometries[index2].geometry.triangles.indexData = layer_data->Unwrap(pCreateInfo->info.pGeometries[index2].geometry.triangles.indexData); |
| 8037 | } |
| 8038 | if (pCreateInfo->info.pGeometries[index2].geometry.triangles.transformData) { |
| 8039 | local_pCreateInfo->info.pGeometries[index2].geometry.triangles.transformData = layer_data->Unwrap(pCreateInfo->info.pGeometries[index2].geometry.triangles.transformData); |
| 8040 | } |
| 8041 | if (pCreateInfo->info.pGeometries[index2].geometry.aabbs.aabbData) { |
| 8042 | local_pCreateInfo->info.pGeometries[index2].geometry.aabbs.aabbData = layer_data->Unwrap(pCreateInfo->info.pGeometries[index2].geometry.aabbs.aabbData); |
| 8043 | } |
| 8044 | } |
| 8045 | } |
| 8046 | } |
| 8047 | } |
| 8048 | VkResult result = layer_data->device_dispatch_table.CreateAccelerationStructureNV(device, (const VkAccelerationStructureCreateInfoNV*)local_pCreateInfo, pAllocator, pAccelerationStructure); |
| 8049 | if (local_pCreateInfo) { |
| 8050 | delete local_pCreateInfo; |
| 8051 | } |
| 8052 | if (VK_SUCCESS == result) { |
| 8053 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8054 | *pAccelerationStructure = layer_data->WrapNew(*pAccelerationStructure); |
| 8055 | } |
| 8056 | return result; |
| 8057 | } |
| 8058 | |
| 8059 | void DispatchDestroyAccelerationStructureNV( |
| 8060 | VkDevice device, |
| 8061 | VkAccelerationStructureNV accelerationStructure, |
| 8062 | const VkAllocationCallbacks* pAllocator) |
| 8063 | { |
| 8064 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8065 | if (!wrap_handles) return layer_data->device_dispatch_table.DestroyAccelerationStructureNV(device, accelerationStructure, pAllocator); |
| 8066 | std::unique_lock<std::mutex> lock(dispatch_lock); |
| 8067 | uint64_t accelerationStructure_id = reinterpret_cast<uint64_t &>(accelerationStructure); |
| 8068 | accelerationStructure = (VkAccelerationStructureNV)unique_id_mapping[accelerationStructure_id]; |
| 8069 | unique_id_mapping.erase(accelerationStructure_id); |
| 8070 | lock.unlock(); |
| 8071 | layer_data->device_dispatch_table.DestroyAccelerationStructureNV(device, accelerationStructure, pAllocator); |
| 8072 | |
| 8073 | } |
| 8074 | |
| 8075 | void DispatchGetAccelerationStructureMemoryRequirementsNV( |
| 8076 | VkDevice device, |
| 8077 | const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, |
| 8078 | VkMemoryRequirements2KHR* pMemoryRequirements) |
| 8079 | { |
| 8080 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8081 | if (!wrap_handles) return layer_data->device_dispatch_table.GetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements); |
| 8082 | safe_VkAccelerationStructureMemoryRequirementsInfoNV *local_pInfo = NULL; |
| 8083 | { |
| 8084 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8085 | if (pInfo) { |
| 8086 | local_pInfo = new safe_VkAccelerationStructureMemoryRequirementsInfoNV(pInfo); |
| 8087 | if (pInfo->accelerationStructure) { |
| 8088 | local_pInfo->accelerationStructure = layer_data->Unwrap(pInfo->accelerationStructure); |
| 8089 | } |
| 8090 | } |
| 8091 | } |
| 8092 | layer_data->device_dispatch_table.GetAccelerationStructureMemoryRequirementsNV(device, (const VkAccelerationStructureMemoryRequirementsInfoNV*)local_pInfo, pMemoryRequirements); |
| 8093 | if (local_pInfo) { |
| 8094 | delete local_pInfo; |
| 8095 | } |
| 8096 | } |
| 8097 | |
| 8098 | VkResult DispatchBindAccelerationStructureMemoryNV( |
| 8099 | VkDevice device, |
| 8100 | uint32_t bindInfoCount, |
| 8101 | const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) |
| 8102 | { |
| 8103 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8104 | if (!wrap_handles) return layer_data->device_dispatch_table.BindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos); |
| 8105 | safe_VkBindAccelerationStructureMemoryInfoNV *local_pBindInfos = NULL; |
| 8106 | { |
| 8107 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8108 | if (pBindInfos) { |
| 8109 | local_pBindInfos = new safe_VkBindAccelerationStructureMemoryInfoNV[bindInfoCount]; |
| 8110 | for (uint32_t index0 = 0; index0 < bindInfoCount; ++index0) { |
| 8111 | local_pBindInfos[index0].initialize(&pBindInfos[index0]); |
| 8112 | if (pBindInfos[index0].accelerationStructure) { |
| 8113 | local_pBindInfos[index0].accelerationStructure = layer_data->Unwrap(pBindInfos[index0].accelerationStructure); |
| 8114 | } |
| 8115 | if (pBindInfos[index0].memory) { |
| 8116 | local_pBindInfos[index0].memory = layer_data->Unwrap(pBindInfos[index0].memory); |
| 8117 | } |
| 8118 | } |
| 8119 | } |
| 8120 | } |
| 8121 | VkResult result = layer_data->device_dispatch_table.BindAccelerationStructureMemoryNV(device, bindInfoCount, (const VkBindAccelerationStructureMemoryInfoNV*)local_pBindInfos); |
| 8122 | if (local_pBindInfos) { |
| 8123 | delete[] local_pBindInfos; |
| 8124 | } |
| 8125 | return result; |
| 8126 | } |
| 8127 | |
| 8128 | void DispatchCmdBuildAccelerationStructureNV( |
| 8129 | VkCommandBuffer commandBuffer, |
| 8130 | const VkAccelerationStructureInfoNV* pInfo, |
| 8131 | VkBuffer instanceData, |
| 8132 | VkDeviceSize instanceOffset, |
| 8133 | VkBool32 update, |
| 8134 | VkAccelerationStructureNV dst, |
| 8135 | VkAccelerationStructureNV src, |
| 8136 | VkBuffer scratch, |
| 8137 | VkDeviceSize scratchOffset) |
| 8138 | { |
| 8139 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8140 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset, update, dst, src, scratch, scratchOffset); |
| 8141 | safe_VkAccelerationStructureInfoNV *local_pInfo = NULL; |
| 8142 | { |
| 8143 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8144 | if (pInfo) { |
| 8145 | local_pInfo = new safe_VkAccelerationStructureInfoNV(pInfo); |
| 8146 | if (local_pInfo->pGeometries) { |
| 8147 | for (uint32_t index1 = 0; index1 < local_pInfo->geometryCount; ++index1) { |
| 8148 | if (pInfo->pGeometries[index1].geometry.triangles.vertexData) { |
| 8149 | local_pInfo->pGeometries[index1].geometry.triangles.vertexData = layer_data->Unwrap(pInfo->pGeometries[index1].geometry.triangles.vertexData); |
| 8150 | } |
| 8151 | if (pInfo->pGeometries[index1].geometry.triangles.indexData) { |
| 8152 | local_pInfo->pGeometries[index1].geometry.triangles.indexData = layer_data->Unwrap(pInfo->pGeometries[index1].geometry.triangles.indexData); |
| 8153 | } |
| 8154 | if (pInfo->pGeometries[index1].geometry.triangles.transformData) { |
| 8155 | local_pInfo->pGeometries[index1].geometry.triangles.transformData = layer_data->Unwrap(pInfo->pGeometries[index1].geometry.triangles.transformData); |
| 8156 | } |
| 8157 | if (pInfo->pGeometries[index1].geometry.aabbs.aabbData) { |
| 8158 | local_pInfo->pGeometries[index1].geometry.aabbs.aabbData = layer_data->Unwrap(pInfo->pGeometries[index1].geometry.aabbs.aabbData); |
| 8159 | } |
| 8160 | } |
| 8161 | } |
| 8162 | } |
| 8163 | instanceData = layer_data->Unwrap(instanceData); |
| 8164 | dst = layer_data->Unwrap(dst); |
| 8165 | src = layer_data->Unwrap(src); |
| 8166 | scratch = layer_data->Unwrap(scratch); |
| 8167 | } |
| 8168 | layer_data->device_dispatch_table.CmdBuildAccelerationStructureNV(commandBuffer, (const VkAccelerationStructureInfoNV*)local_pInfo, instanceData, instanceOffset, update, dst, src, scratch, scratchOffset); |
| 8169 | if (local_pInfo) { |
| 8170 | delete local_pInfo; |
| 8171 | } |
| 8172 | } |
| 8173 | |
| 8174 | void DispatchCmdCopyAccelerationStructureNV( |
| 8175 | VkCommandBuffer commandBuffer, |
| 8176 | VkAccelerationStructureNV dst, |
| 8177 | VkAccelerationStructureNV src, |
| 8178 | VkCopyAccelerationStructureModeNV mode) |
| 8179 | { |
| 8180 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8181 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode); |
| 8182 | { |
| 8183 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8184 | dst = layer_data->Unwrap(dst); |
| 8185 | src = layer_data->Unwrap(src); |
| 8186 | } |
| 8187 | layer_data->device_dispatch_table.CmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode); |
| 8188 | |
| 8189 | } |
| 8190 | |
| 8191 | void DispatchCmdTraceRaysNV( |
| 8192 | VkCommandBuffer commandBuffer, |
| 8193 | VkBuffer raygenShaderBindingTableBuffer, |
| 8194 | VkDeviceSize raygenShaderBindingOffset, |
| 8195 | VkBuffer missShaderBindingTableBuffer, |
| 8196 | VkDeviceSize missShaderBindingOffset, |
| 8197 | VkDeviceSize missShaderBindingStride, |
| 8198 | VkBuffer hitShaderBindingTableBuffer, |
| 8199 | VkDeviceSize hitShaderBindingOffset, |
| 8200 | VkDeviceSize hitShaderBindingStride, |
| 8201 | VkBuffer callableShaderBindingTableBuffer, |
| 8202 | VkDeviceSize callableShaderBindingOffset, |
| 8203 | VkDeviceSize callableShaderBindingStride, |
| 8204 | uint32_t width, |
| 8205 | uint32_t height, |
| 8206 | uint32_t depth) |
| 8207 | { |
| 8208 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8209 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdTraceRaysNV(commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset, missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride, hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride, callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride, width, height, depth); |
| 8210 | { |
| 8211 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8212 | raygenShaderBindingTableBuffer = layer_data->Unwrap(raygenShaderBindingTableBuffer); |
| 8213 | missShaderBindingTableBuffer = layer_data->Unwrap(missShaderBindingTableBuffer); |
| 8214 | hitShaderBindingTableBuffer = layer_data->Unwrap(hitShaderBindingTableBuffer); |
| 8215 | callableShaderBindingTableBuffer = layer_data->Unwrap(callableShaderBindingTableBuffer); |
| 8216 | } |
| 8217 | layer_data->device_dispatch_table.CmdTraceRaysNV(commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset, missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride, hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride, callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride, width, height, depth); |
| 8218 | |
| 8219 | } |
| 8220 | |
| 8221 | VkResult DispatchCreateRayTracingPipelinesNV( |
| 8222 | VkDevice device, |
| 8223 | VkPipelineCache pipelineCache, |
| 8224 | uint32_t createInfoCount, |
| 8225 | const VkRayTracingPipelineCreateInfoNV* pCreateInfos, |
| 8226 | const VkAllocationCallbacks* pAllocator, |
| 8227 | VkPipeline* pPipelines) |
| 8228 | { |
| 8229 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8230 | if (!wrap_handles) return layer_data->device_dispatch_table.CreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); |
| 8231 | safe_VkRayTracingPipelineCreateInfoNV *local_pCreateInfos = NULL; |
| 8232 | { |
| 8233 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8234 | pipelineCache = layer_data->Unwrap(pipelineCache); |
| 8235 | if (pCreateInfos) { |
| 8236 | local_pCreateInfos = new safe_VkRayTracingPipelineCreateInfoNV[createInfoCount]; |
| 8237 | for (uint32_t index0 = 0; index0 < createInfoCount; ++index0) { |
| 8238 | local_pCreateInfos[index0].initialize(&pCreateInfos[index0]); |
| 8239 | if (local_pCreateInfos[index0].pStages) { |
| 8240 | for (uint32_t index1 = 0; index1 < local_pCreateInfos[index0].stageCount; ++index1) { |
| 8241 | if (pCreateInfos[index0].pStages[index1].module) { |
| 8242 | local_pCreateInfos[index0].pStages[index1].module = layer_data->Unwrap(pCreateInfos[index0].pStages[index1].module); |
| 8243 | } |
| 8244 | } |
| 8245 | } |
| 8246 | if (pCreateInfos[index0].layout) { |
| 8247 | local_pCreateInfos[index0].layout = layer_data->Unwrap(pCreateInfos[index0].layout); |
| 8248 | } |
| 8249 | if (pCreateInfos[index0].basePipelineHandle) { |
| 8250 | local_pCreateInfos[index0].basePipelineHandle = layer_data->Unwrap(pCreateInfos[index0].basePipelineHandle); |
| 8251 | } |
| 8252 | } |
| 8253 | } |
| 8254 | } |
| 8255 | VkResult result = layer_data->device_dispatch_table.CreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, (const VkRayTracingPipelineCreateInfoNV*)local_pCreateInfos, pAllocator, pPipelines); |
| 8256 | if (local_pCreateInfos) { |
| 8257 | delete[] local_pCreateInfos; |
| 8258 | } |
| 8259 | if (VK_SUCCESS == result) { |
| 8260 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8261 | for (uint32_t index0 = 0; index0 < createInfoCount; index0++) { |
| 8262 | pPipelines[index0] = layer_data->WrapNew(pPipelines[index0]); |
| 8263 | } |
| 8264 | } |
| 8265 | return result; |
| 8266 | } |
| 8267 | |
| 8268 | VkResult DispatchGetRayTracingShaderGroupHandlesNV( |
| 8269 | VkDevice device, |
| 8270 | VkPipeline pipeline, |
| 8271 | uint32_t firstGroup, |
| 8272 | uint32_t groupCount, |
| 8273 | size_t dataSize, |
| 8274 | void* pData) |
| 8275 | { |
| 8276 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8277 | if (!wrap_handles) return layer_data->device_dispatch_table.GetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount, dataSize, pData); |
| 8278 | { |
| 8279 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8280 | pipeline = layer_data->Unwrap(pipeline); |
| 8281 | } |
| 8282 | VkResult result = layer_data->device_dispatch_table.GetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount, dataSize, pData); |
| 8283 | |
| 8284 | return result; |
| 8285 | } |
| 8286 | |
| 8287 | VkResult DispatchGetAccelerationStructureHandleNV( |
| 8288 | VkDevice device, |
| 8289 | VkAccelerationStructureNV accelerationStructure, |
| 8290 | size_t dataSize, |
| 8291 | void* pData) |
| 8292 | { |
| 8293 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8294 | if (!wrap_handles) return layer_data->device_dispatch_table.GetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData); |
| 8295 | { |
| 8296 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8297 | accelerationStructure = layer_data->Unwrap(accelerationStructure); |
| 8298 | } |
| 8299 | VkResult result = layer_data->device_dispatch_table.GetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData); |
| 8300 | |
| 8301 | return result; |
| 8302 | } |
| 8303 | |
| 8304 | void DispatchCmdWriteAccelerationStructuresPropertiesNV( |
| 8305 | VkCommandBuffer commandBuffer, |
| 8306 | uint32_t accelerationStructureCount, |
| 8307 | const VkAccelerationStructureNV* pAccelerationStructures, |
| 8308 | VkQueryType queryType, |
| 8309 | VkQueryPool queryPool, |
| 8310 | uint32_t firstQuery) |
| 8311 | { |
| 8312 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8313 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery); |
| 8314 | VkAccelerationStructureNV *local_pAccelerationStructures = NULL; |
| 8315 | { |
| 8316 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8317 | if (pAccelerationStructures) { |
| 8318 | local_pAccelerationStructures = new VkAccelerationStructureNV[accelerationStructureCount]; |
| 8319 | for (uint32_t index0 = 0; index0 < accelerationStructureCount; ++index0) { |
| 8320 | local_pAccelerationStructures[index0] = layer_data->Unwrap(pAccelerationStructures[index0]); |
| 8321 | } |
| 8322 | } |
| 8323 | queryPool = layer_data->Unwrap(queryPool); |
| 8324 | } |
| 8325 | layer_data->device_dispatch_table.CmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount, (const VkAccelerationStructureNV*)local_pAccelerationStructures, queryType, queryPool, firstQuery); |
| 8326 | if (local_pAccelerationStructures) |
| 8327 | delete[] local_pAccelerationStructures; |
| 8328 | } |
| 8329 | |
| 8330 | VkResult DispatchCompileDeferredNV( |
| 8331 | VkDevice device, |
| 8332 | VkPipeline pipeline, |
| 8333 | uint32_t shader) |
| 8334 | { |
| 8335 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8336 | if (!wrap_handles) return layer_data->device_dispatch_table.CompileDeferredNV(device, pipeline, shader); |
| 8337 | { |
| 8338 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8339 | pipeline = layer_data->Unwrap(pipeline); |
| 8340 | } |
| 8341 | VkResult result = layer_data->device_dispatch_table.CompileDeferredNV(device, pipeline, shader); |
| 8342 | |
| 8343 | return result; |
| 8344 | } |
| 8345 | |
| 8346 | VkResult DispatchGetMemoryHostPointerPropertiesEXT( |
| 8347 | VkDevice device, |
| 8348 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 8349 | const void* pHostPointer, |
| 8350 | VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) |
| 8351 | { |
| 8352 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8353 | VkResult result = layer_data->device_dispatch_table.GetMemoryHostPointerPropertiesEXT(device, handleType, pHostPointer, pMemoryHostPointerProperties); |
| 8354 | |
| 8355 | return result; |
| 8356 | } |
| 8357 | |
| 8358 | void DispatchCmdWriteBufferMarkerAMD( |
| 8359 | VkCommandBuffer commandBuffer, |
| 8360 | VkPipelineStageFlagBits pipelineStage, |
| 8361 | VkBuffer dstBuffer, |
| 8362 | VkDeviceSize dstOffset, |
| 8363 | uint32_t marker) |
| 8364 | { |
| 8365 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8366 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker); |
| 8367 | { |
| 8368 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8369 | dstBuffer = layer_data->Unwrap(dstBuffer); |
| 8370 | } |
| 8371 | layer_data->device_dispatch_table.CmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker); |
| 8372 | |
| 8373 | } |
| 8374 | |
| 8375 | VkResult DispatchGetPhysicalDeviceCalibrateableTimeDomainsEXT( |
| 8376 | VkPhysicalDevice physicalDevice, |
| 8377 | uint32_t* pTimeDomainCount, |
| 8378 | VkTimeDomainEXT* pTimeDomains) |
| 8379 | { |
| 8380 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 8381 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice, pTimeDomainCount, pTimeDomains); |
| 8382 | |
| 8383 | return result; |
| 8384 | } |
| 8385 | |
| 8386 | VkResult DispatchGetCalibratedTimestampsEXT( |
| 8387 | VkDevice device, |
| 8388 | uint32_t timestampCount, |
| 8389 | const VkCalibratedTimestampInfoEXT* pTimestampInfos, |
| 8390 | uint64_t* pTimestamps, |
| 8391 | uint64_t* pMaxDeviation) |
| 8392 | { |
| 8393 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8394 | VkResult result = layer_data->device_dispatch_table.GetCalibratedTimestampsEXT(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation); |
| 8395 | |
| 8396 | return result; |
| 8397 | } |
| 8398 | |
| 8399 | void DispatchCmdDrawMeshTasksNV( |
| 8400 | VkCommandBuffer commandBuffer, |
| 8401 | uint32_t taskCount, |
| 8402 | uint32_t firstTask) |
| 8403 | { |
| 8404 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8405 | layer_data->device_dispatch_table.CmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask); |
| 8406 | |
| 8407 | } |
| 8408 | |
| 8409 | void DispatchCmdDrawMeshTasksIndirectNV( |
| 8410 | VkCommandBuffer commandBuffer, |
| 8411 | VkBuffer buffer, |
| 8412 | VkDeviceSize offset, |
| 8413 | uint32_t drawCount, |
| 8414 | uint32_t stride) |
| 8415 | { |
| 8416 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8417 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride); |
| 8418 | { |
| 8419 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8420 | buffer = layer_data->Unwrap(buffer); |
| 8421 | } |
| 8422 | layer_data->device_dispatch_table.CmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride); |
| 8423 | |
| 8424 | } |
| 8425 | |
| 8426 | void DispatchCmdDrawMeshTasksIndirectCountNV( |
| 8427 | VkCommandBuffer commandBuffer, |
| 8428 | VkBuffer buffer, |
| 8429 | VkDeviceSize offset, |
| 8430 | VkBuffer countBuffer, |
| 8431 | VkDeviceSize countBufferOffset, |
| 8432 | uint32_t maxDrawCount, |
| 8433 | uint32_t stride) |
| 8434 | { |
| 8435 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8436 | if (!wrap_handles) return layer_data->device_dispatch_table.CmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 8437 | { |
| 8438 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8439 | buffer = layer_data->Unwrap(buffer); |
| 8440 | countBuffer = layer_data->Unwrap(countBuffer); |
| 8441 | } |
| 8442 | layer_data->device_dispatch_table.CmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); |
| 8443 | |
| 8444 | } |
| 8445 | |
| 8446 | void DispatchCmdSetExclusiveScissorNV( |
| 8447 | VkCommandBuffer commandBuffer, |
| 8448 | uint32_t firstExclusiveScissor, |
| 8449 | uint32_t exclusiveScissorCount, |
| 8450 | const VkRect2D* pExclusiveScissors) |
| 8451 | { |
| 8452 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8453 | layer_data->device_dispatch_table.CmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors); |
| 8454 | |
| 8455 | } |
| 8456 | |
| 8457 | void DispatchCmdSetCheckpointNV( |
| 8458 | VkCommandBuffer commandBuffer, |
| 8459 | const void* pCheckpointMarker) |
| 8460 | { |
| 8461 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8462 | layer_data->device_dispatch_table.CmdSetCheckpointNV(commandBuffer, pCheckpointMarker); |
| 8463 | |
| 8464 | } |
| 8465 | |
| 8466 | void DispatchGetQueueCheckpointDataNV( |
| 8467 | VkQueue queue, |
| 8468 | uint32_t* pCheckpointDataCount, |
| 8469 | VkCheckpointDataNV* pCheckpointData) |
| 8470 | { |
| 8471 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 8472 | layer_data->device_dispatch_table.GetQueueCheckpointDataNV(queue, pCheckpointDataCount, pCheckpointData); |
| 8473 | |
| 8474 | } |
| 8475 | |
| 8476 | VkResult DispatchInitializePerformanceApiINTEL( |
| 8477 | VkDevice device, |
| 8478 | const VkInitializePerformanceApiInfoINTEL* pInitializeInfo) |
| 8479 | { |
| 8480 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8481 | VkResult result = layer_data->device_dispatch_table.InitializePerformanceApiINTEL(device, pInitializeInfo); |
| 8482 | |
| 8483 | return result; |
| 8484 | } |
| 8485 | |
| 8486 | void DispatchUninitializePerformanceApiINTEL( |
| 8487 | VkDevice device) |
| 8488 | { |
| 8489 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8490 | layer_data->device_dispatch_table.UninitializePerformanceApiINTEL(device); |
| 8491 | |
| 8492 | } |
| 8493 | |
| 8494 | VkResult DispatchCmdSetPerformanceMarkerINTEL( |
| 8495 | VkCommandBuffer commandBuffer, |
| 8496 | const VkPerformanceMarkerInfoINTEL* pMarkerInfo) |
| 8497 | { |
| 8498 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8499 | VkResult result = layer_data->device_dispatch_table.CmdSetPerformanceMarkerINTEL(commandBuffer, pMarkerInfo); |
| 8500 | |
| 8501 | return result; |
| 8502 | } |
| 8503 | |
| 8504 | VkResult DispatchCmdSetPerformanceStreamMarkerINTEL( |
| 8505 | VkCommandBuffer commandBuffer, |
| 8506 | const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo) |
| 8507 | { |
| 8508 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8509 | VkResult result = layer_data->device_dispatch_table.CmdSetPerformanceStreamMarkerINTEL(commandBuffer, pMarkerInfo); |
| 8510 | |
| 8511 | return result; |
| 8512 | } |
| 8513 | |
| 8514 | VkResult DispatchCmdSetPerformanceOverrideINTEL( |
| 8515 | VkCommandBuffer commandBuffer, |
| 8516 | const VkPerformanceOverrideInfoINTEL* pOverrideInfo) |
| 8517 | { |
| 8518 | auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 8519 | VkResult result = layer_data->device_dispatch_table.CmdSetPerformanceOverrideINTEL(commandBuffer, pOverrideInfo); |
| 8520 | |
| 8521 | return result; |
| 8522 | } |
| 8523 | |
| 8524 | VkResult DispatchAcquirePerformanceConfigurationINTEL( |
| 8525 | VkDevice device, |
| 8526 | const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, |
| 8527 | VkPerformanceConfigurationINTEL* pConfiguration) |
| 8528 | { |
| 8529 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8530 | if (!wrap_handles) return layer_data->device_dispatch_table.AcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration); |
| 8531 | { |
| 8532 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8533 | pConfiguration = layer_data->Unwrap(pConfiguration); |
| 8534 | } |
| 8535 | VkResult result = layer_data->device_dispatch_table.AcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration); |
| 8536 | |
| 8537 | return result; |
| 8538 | } |
| 8539 | |
| 8540 | VkResult DispatchReleasePerformanceConfigurationINTEL( |
| 8541 | VkDevice device, |
| 8542 | VkPerformanceConfigurationINTEL configuration) |
| 8543 | { |
| 8544 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8545 | if (!wrap_handles) return layer_data->device_dispatch_table.ReleasePerformanceConfigurationINTEL(device, configuration); |
| 8546 | { |
| 8547 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8548 | configuration = layer_data->Unwrap(configuration); |
| 8549 | } |
| 8550 | VkResult result = layer_data->device_dispatch_table.ReleasePerformanceConfigurationINTEL(device, configuration); |
| 8551 | |
| 8552 | return result; |
| 8553 | } |
| 8554 | |
| 8555 | VkResult DispatchQueueSetPerformanceConfigurationINTEL( |
| 8556 | VkQueue queue, |
| 8557 | VkPerformanceConfigurationINTEL configuration) |
| 8558 | { |
| 8559 | auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
| 8560 | if (!wrap_handles) return layer_data->device_dispatch_table.QueueSetPerformanceConfigurationINTEL(queue, configuration); |
| 8561 | { |
| 8562 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8563 | configuration = layer_data->Unwrap(configuration); |
| 8564 | } |
| 8565 | VkResult result = layer_data->device_dispatch_table.QueueSetPerformanceConfigurationINTEL(queue, configuration); |
| 8566 | |
| 8567 | return result; |
| 8568 | } |
| 8569 | |
| 8570 | VkResult DispatchGetPerformanceParameterINTEL( |
| 8571 | VkDevice device, |
| 8572 | VkPerformanceParameterTypeINTEL parameter, |
| 8573 | VkPerformanceValueINTEL* pValue) |
| 8574 | { |
| 8575 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8576 | VkResult result = layer_data->device_dispatch_table.GetPerformanceParameterINTEL(device, parameter, pValue); |
| 8577 | |
| 8578 | return result; |
| 8579 | } |
| 8580 | |
| 8581 | void DispatchSetLocalDimmingAMD( |
| 8582 | VkDevice device, |
| 8583 | VkSwapchainKHR swapChain, |
| 8584 | VkBool32 localDimmingEnable) |
| 8585 | { |
| 8586 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8587 | if (!wrap_handles) return layer_data->device_dispatch_table.SetLocalDimmingAMD(device, swapChain, localDimmingEnable); |
| 8588 | { |
| 8589 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8590 | swapChain = layer_data->Unwrap(swapChain); |
| 8591 | } |
| 8592 | layer_data->device_dispatch_table.SetLocalDimmingAMD(device, swapChain, localDimmingEnable); |
| 8593 | |
| 8594 | } |
| 8595 | |
| 8596 | #ifdef VK_USE_PLATFORM_FUCHSIA |
| 8597 | |
| 8598 | VkResult DispatchCreateImagePipeSurfaceFUCHSIA( |
| 8599 | VkInstance instance, |
| 8600 | const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, |
| 8601 | const VkAllocationCallbacks* pAllocator, |
| 8602 | VkSurfaceKHR* pSurface) |
| 8603 | { |
| 8604 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 8605 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface); |
| 8606 | VkResult result = layer_data->instance_dispatch_table.CreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface); |
| 8607 | if (VK_SUCCESS == result) { |
| 8608 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8609 | *pSurface = layer_data->WrapNew(*pSurface); |
| 8610 | } |
| 8611 | return result; |
| 8612 | } |
| 8613 | #endif // VK_USE_PLATFORM_FUCHSIA |
| 8614 | |
| 8615 | #ifdef VK_USE_PLATFORM_METAL_EXT |
| 8616 | |
| 8617 | VkResult DispatchCreateMetalSurfaceEXT( |
| 8618 | VkInstance instance, |
| 8619 | const VkMetalSurfaceCreateInfoEXT* pCreateInfo, |
| 8620 | const VkAllocationCallbacks* pAllocator, |
| 8621 | VkSurfaceKHR* pSurface) |
| 8622 | { |
| 8623 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 8624 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface); |
| 8625 | VkResult result = layer_data->instance_dispatch_table.CreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface); |
| 8626 | if (VK_SUCCESS == result) { |
| 8627 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8628 | *pSurface = layer_data->WrapNew(*pSurface); |
| 8629 | } |
| 8630 | return result; |
| 8631 | } |
| 8632 | #endif // VK_USE_PLATFORM_METAL_EXT |
| 8633 | |
| 8634 | VkDeviceAddress DispatchGetBufferDeviceAddressEXT( |
| 8635 | VkDevice device, |
| 8636 | const VkBufferDeviceAddressInfoEXT* pInfo) |
| 8637 | { |
| 8638 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8639 | if (!wrap_handles) return layer_data->device_dispatch_table.GetBufferDeviceAddressEXT(device, pInfo); |
| 8640 | safe_VkBufferDeviceAddressInfoEXT *local_pInfo = NULL; |
| 8641 | { |
| 8642 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8643 | if (pInfo) { |
| 8644 | local_pInfo = new safe_VkBufferDeviceAddressInfoEXT(pInfo); |
| 8645 | if (pInfo->buffer) { |
| 8646 | local_pInfo->buffer = layer_data->Unwrap(pInfo->buffer); |
| 8647 | } |
| 8648 | } |
| 8649 | } |
| 8650 | VkDeviceAddress result = layer_data->device_dispatch_table.GetBufferDeviceAddressEXT(device, (const VkBufferDeviceAddressInfoEXT*)local_pInfo); |
| 8651 | if (local_pInfo) { |
| 8652 | delete local_pInfo; |
| 8653 | } |
| 8654 | return result; |
| 8655 | } |
| 8656 | |
| 8657 | VkResult DispatchGetPhysicalDeviceCooperativeMatrixPropertiesNV( |
| 8658 | VkPhysicalDevice physicalDevice, |
| 8659 | uint32_t* pPropertyCount, |
| 8660 | VkCooperativeMatrixPropertiesNV* pProperties) |
| 8661 | { |
| 8662 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 8663 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceCooperativeMatrixPropertiesNV(physicalDevice, pPropertyCount, pProperties); |
| 8664 | |
| 8665 | return result; |
| 8666 | } |
| 8667 | |
| 8668 | VkResult DispatchGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( |
| 8669 | VkPhysicalDevice physicalDevice, |
| 8670 | uint32_t* pCombinationCount, |
| 8671 | VkFramebufferMixedSamplesCombinationNV* pCombinations) |
| 8672 | { |
| 8673 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 8674 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(physicalDevice, pCombinationCount, pCombinations); |
| 8675 | |
| 8676 | return result; |
| 8677 | } |
| 8678 | |
| 8679 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 8680 | |
| 8681 | VkResult DispatchGetPhysicalDeviceSurfacePresentModes2EXT( |
| 8682 | VkPhysicalDevice physicalDevice, |
| 8683 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 8684 | uint32_t* pPresentModeCount, |
| 8685 | VkPresentModeKHR* pPresentModes) |
| 8686 | { |
| 8687 | auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); |
| 8688 | if (!wrap_handles) return layer_data->instance_dispatch_table.GetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes); |
| 8689 | safe_VkPhysicalDeviceSurfaceInfo2KHR *local_pSurfaceInfo = NULL; |
| 8690 | { |
| 8691 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8692 | if (pSurfaceInfo) { |
| 8693 | local_pSurfaceInfo = new safe_VkPhysicalDeviceSurfaceInfo2KHR(pSurfaceInfo); |
| 8694 | if (pSurfaceInfo->surface) { |
| 8695 | local_pSurfaceInfo->surface = layer_data->Unwrap(pSurfaceInfo->surface); |
| 8696 | } |
| 8697 | } |
| 8698 | } |
| 8699 | VkResult result = layer_data->instance_dispatch_table.GetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice, (const VkPhysicalDeviceSurfaceInfo2KHR*)local_pSurfaceInfo, pPresentModeCount, pPresentModes); |
| 8700 | if (local_pSurfaceInfo) { |
| 8701 | delete local_pSurfaceInfo; |
| 8702 | } |
| 8703 | return result; |
| 8704 | } |
| 8705 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 8706 | |
| 8707 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 8708 | |
| 8709 | VkResult DispatchAcquireFullScreenExclusiveModeEXT( |
| 8710 | VkDevice device, |
| 8711 | VkSwapchainKHR swapchain) |
| 8712 | { |
| 8713 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8714 | if (!wrap_handles) return layer_data->device_dispatch_table.AcquireFullScreenExclusiveModeEXT(device, swapchain); |
| 8715 | { |
| 8716 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8717 | swapchain = layer_data->Unwrap(swapchain); |
| 8718 | } |
| 8719 | VkResult result = layer_data->device_dispatch_table.AcquireFullScreenExclusiveModeEXT(device, swapchain); |
| 8720 | |
| 8721 | return result; |
| 8722 | } |
| 8723 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 8724 | |
| 8725 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 8726 | |
| 8727 | VkResult DispatchReleaseFullScreenExclusiveModeEXT( |
| 8728 | VkDevice device, |
| 8729 | VkSwapchainKHR swapchain) |
| 8730 | { |
| 8731 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8732 | if (!wrap_handles) return layer_data->device_dispatch_table.ReleaseFullScreenExclusiveModeEXT(device, swapchain); |
| 8733 | { |
| 8734 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8735 | swapchain = layer_data->Unwrap(swapchain); |
| 8736 | } |
| 8737 | VkResult result = layer_data->device_dispatch_table.ReleaseFullScreenExclusiveModeEXT(device, swapchain); |
| 8738 | |
| 8739 | return result; |
| 8740 | } |
| 8741 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 8742 | |
| 8743 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 8744 | |
| 8745 | VkResult DispatchGetDeviceGroupSurfacePresentModes2EXT( |
| 8746 | VkDevice device, |
| 8747 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 8748 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 8749 | { |
| 8750 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8751 | if (!wrap_handles) return layer_data->device_dispatch_table.GetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes); |
| 8752 | safe_VkPhysicalDeviceSurfaceInfo2KHR *local_pSurfaceInfo = NULL; |
| 8753 | { |
| 8754 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8755 | if (pSurfaceInfo) { |
| 8756 | local_pSurfaceInfo = new safe_VkPhysicalDeviceSurfaceInfo2KHR(pSurfaceInfo); |
| 8757 | if (pSurfaceInfo->surface) { |
| 8758 | local_pSurfaceInfo->surface = layer_data->Unwrap(pSurfaceInfo->surface); |
| 8759 | } |
| 8760 | } |
| 8761 | } |
| 8762 | VkResult result = layer_data->device_dispatch_table.GetDeviceGroupSurfacePresentModes2EXT(device, (const VkPhysicalDeviceSurfaceInfo2KHR*)local_pSurfaceInfo, pModes); |
| 8763 | if (local_pSurfaceInfo) { |
| 8764 | delete local_pSurfaceInfo; |
| 8765 | } |
| 8766 | return result; |
| 8767 | } |
| 8768 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 8769 | |
| 8770 | VkResult DispatchCreateHeadlessSurfaceEXT( |
| 8771 | VkInstance instance, |
| 8772 | const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo, |
| 8773 | const VkAllocationCallbacks* pAllocator, |
| 8774 | VkSurfaceKHR* pSurface) |
| 8775 | { |
| 8776 | auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); |
| 8777 | if (!wrap_handles) return layer_data->instance_dispatch_table.CreateHeadlessSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface); |
| 8778 | VkResult result = layer_data->instance_dispatch_table.CreateHeadlessSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface); |
| 8779 | if (VK_SUCCESS == result) { |
| 8780 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8781 | *pSurface = layer_data->WrapNew(*pSurface); |
| 8782 | } |
| 8783 | return result; |
| 8784 | } |
| 8785 | |
| 8786 | void DispatchResetQueryPoolEXT( |
| 8787 | VkDevice device, |
| 8788 | VkQueryPool queryPool, |
| 8789 | uint32_t firstQuery, |
| 8790 | uint32_t queryCount) |
| 8791 | { |
| 8792 | auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 8793 | if (!wrap_handles) return layer_data->device_dispatch_table.ResetQueryPoolEXT(device, queryPool, firstQuery, queryCount); |
| 8794 | { |
| 8795 | std::lock_guard<std::mutex> lock(dispatch_lock); |
| 8796 | queryPool = layer_data->Unwrap(queryPool); |
| 8797 | } |
| 8798 | layer_data->device_dispatch_table.ResetQueryPoolEXT(device, queryPool, firstQuery, queryCount); |
| 8799 | |
| 8800 | } |