1 /* Copyright (c) 2015-2019 The Khronos Group Inc. 2 * Copyright (c) 2015-2019 Valve Corporation 3 * Copyright (c) 2015-2019 LunarG, Inc. 4 * Copyright (C) 2015-2019 Google Inc. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 * Author: Courtney Goeltzenleuchter <courtneygo@google.com> 19 * Author: Tobin Ehlis <tobine@google.com> 20 * Author: Chris Forbes <chrisf@ijw.co.nz> 21 * Author: Mark Lobodzinski <mark@lunarg.com> 22 * Author: Dave Houlton <daveh@lunarg.com> 23 */ 24 25 #pragma once 26 #include "core_validation_error_enums.h" 27 #include "core_validation_types.h" 28 #include "descriptor_sets.h" 29 #include "shader_validation.h" 30 #include "gpu_validation.h" 31 #include "vk_layer_logging.h" 32 #include "vulkan/vk_layer.h" 33 #include "vk_typemap_helper.h" 34 #include "vk_layer_data.h" 35 #include <atomic> 36 #include <functional> 37 #include <memory> 38 #include <unordered_map> 39 #include <unordered_set> 40 #include <vector> 41 #include <list> 42 #include <deque> 43 #include <map> 44 45 enum SyncScope { 46 kSyncScopeInternal, 47 kSyncScopeExternalTemporary, 48 kSyncScopeExternalPermanent, 49 }; 50 51 enum FENCE_STATUS { FENCE_UNSIGNALED, FENCE_INFLIGHT, FENCE_RETIRED }; 52 53 class FENCE_STATE { 54 public: 55 VkFence fence; 56 VkFenceCreateInfo createInfo; 57 std::pair<VkQueue, uint64_t> signaler; 58 FENCE_STATUS state; 59 SyncScope scope; 60 61 // Default constructor FENCE_STATE()62 FENCE_STATE() : state(FENCE_UNSIGNALED), scope(kSyncScopeInternal) {} 63 }; 64 65 class SEMAPHORE_STATE : public BASE_NODE { 66 public: 67 std::pair<VkQueue, uint64_t> signaler; 68 bool signaled; 69 SyncScope scope; 70 }; 71 72 class EVENT_STATE : public BASE_NODE { 73 public: 74 int write_in_use; 75 VkPipelineStageFlags stageMask; 76 }; 77 78 class QUEUE_STATE { 79 public: 80 VkQueue queue; 81 uint32_t queueFamilyIndex; 82 std::unordered_map<VkEvent, VkPipelineStageFlags> eventToStageMap; 83 std::map<QueryObject, QueryState> queryToStateMap; 84 85 uint64_t seq; 86 std::deque<CB_SUBMISSION> submissions; 87 }; 88 89 class QUERY_POOL_STATE : public BASE_NODE { 90 public: 91 VkQueryPoolCreateInfo createInfo; 92 }; 93 94 struct PHYSICAL_DEVICE_STATE { 95 // Track the call state and array sizes for various query functions 96 CALL_STATE vkGetPhysicalDeviceQueueFamilyPropertiesState = UNCALLED; 97 CALL_STATE vkGetPhysicalDeviceLayerPropertiesState = UNCALLED; 98 CALL_STATE vkGetPhysicalDeviceExtensionPropertiesState = UNCALLED; 99 CALL_STATE vkGetPhysicalDeviceFeaturesState = UNCALLED; 100 CALL_STATE vkGetPhysicalDeviceSurfaceCapabilitiesKHRState = UNCALLED; 101 CALL_STATE vkGetPhysicalDeviceSurfacePresentModesKHRState = UNCALLED; 102 CALL_STATE vkGetPhysicalDeviceSurfaceFormatsKHRState = UNCALLED; 103 CALL_STATE vkGetPhysicalDeviceDisplayPlanePropertiesKHRState = UNCALLED; 104 safe_VkPhysicalDeviceFeatures2 features2 = {}; 105 VkPhysicalDevice phys_device = VK_NULL_HANDLE; 106 uint32_t queue_family_known_count = 1; // spec implies one QF must always be supported 107 std::vector<VkQueueFamilyProperties> queue_family_properties; 108 VkSurfaceCapabilitiesKHR surfaceCapabilities = {}; 109 std::vector<VkPresentModeKHR> present_modes; 110 std::vector<VkSurfaceFormatKHR> surface_formats; 111 uint32_t display_plane_property_count = 0; 112 }; 113 114 // This structure is used to save data across the CreateGraphicsPipelines down-chain API call 115 struct create_graphics_pipeline_api_state { 116 std::vector<safe_VkGraphicsPipelineCreateInfo> gpu_create_infos; 117 std::vector<std::unique_ptr<PIPELINE_STATE>> pipe_state; 118 const VkGraphicsPipelineCreateInfo* pCreateInfos; 119 }; 120 121 // This structure is used to save data across the CreateComputePipelines down-chain API call 122 struct create_compute_pipeline_api_state { 123 std::vector<safe_VkComputePipelineCreateInfo> gpu_create_infos; 124 std::vector<std::unique_ptr<PIPELINE_STATE>> pipe_state; 125 const VkComputePipelineCreateInfo* pCreateInfos; 126 }; 127 128 // This structure is used to save data across the CreateRayTracingPipelinesNV down-chain API call. 129 struct create_ray_tracing_pipeline_api_state { 130 std::vector<safe_VkRayTracingPipelineCreateInfoNV> gpu_create_infos; 131 std::vector<std::unique_ptr<PIPELINE_STATE>> pipe_state; 132 const VkRayTracingPipelineCreateInfoNV* pCreateInfos; 133 }; 134 135 // This structure is used modify parameters for the CreatePipelineLayout down-chain API call 136 struct create_pipeline_layout_api_state { 137 std::vector<VkDescriptorSetLayout> new_layouts; 138 VkPipelineLayoutCreateInfo modified_create_info; 139 }; 140 141 // This structure is used modify and pass parameters for the CreateShaderModule down-chain API call 142 143 struct create_shader_module_api_state { 144 uint32_t unique_shader_id; 145 VkShaderModuleCreateInfo instrumented_create_info; 146 std::vector<unsigned int> instrumented_pgm; 147 }; 148 149 struct GpuQueue { 150 VkPhysicalDevice gpu; 151 uint32_t queue_family_index; 152 }; 153 154 struct SubresourceRangeErrorCodes { 155 const char *base_mip_err, *mip_count_err, *base_layer_err, *layer_count_err; 156 }; 157 158 inline bool operator==(GpuQueue const& lhs, GpuQueue const& rhs) { 159 return (lhs.gpu == rhs.gpu && lhs.queue_family_index == rhs.queue_family_index); 160 } 161 162 namespace std { 163 template <> 164 struct hash<GpuQueue> { 165 size_t operator()(GpuQueue gq) const throw() { 166 return hash<uint64_t>()((uint64_t)(gq.gpu)) ^ hash<uint32_t>()(gq.queue_family_index); 167 } 168 }; 169 } // namespace std 170 171 struct SURFACE_STATE { 172 VkSurfaceKHR surface = VK_NULL_HANDLE; 173 SWAPCHAIN_NODE* swapchain = nullptr; 174 std::unordered_map<GpuQueue, bool> gpu_queue_support; 175 176 SURFACE_STATE() {} 177 SURFACE_STATE(VkSurfaceKHR surface) : surface(surface) {} 178 }; 179 180 struct SubpassLayout { 181 uint32_t index; 182 VkImageLayout layout; 183 }; 184 185 using std::unordered_map; 186 struct GpuValidationState; 187 188 #define VALSTATETRACK_MAP_AND_TRAITS_IMPL(handle_type, state_type, map_member, instance_scope) \ 189 template <typename Dummy> \ 190 struct AccessorStateHandle<state_type, Dummy> { \ 191 using StateType = state_type; \ 192 using HandleType = handle_type; \ 193 }; \ 194 AccessorTraitsTypes<state_type>::MapType map_member; \ 195 template <typename Dummy> \ 196 struct AccessorTraits<state_type, Dummy> : AccessorTraitsTypes<state_type> { \ 197 static const bool kInstanceScope = instance_scope; \ 198 static MapType ValidationStateTracker::*Map() { return &ValidationStateTracker::map_member; } \ 199 }; 200 201 #define VALSTATETRACK_MAP_AND_TRAITS(handle_type, state_type, map_member) \ 202 VALSTATETRACK_MAP_AND_TRAITS_IMPL(handle_type, state_type, map_member, false) 203 #define VALSTATETRACK_MAP_AND_TRAITS_INSTANCE_SCOPE(handle_type, state_type, map_member) \ 204 VALSTATETRACK_MAP_AND_TRAITS_IMPL(handle_type, state_type, map_member, true) 205 206 class ValidationStateTracker : public ValidationObject { 207 public: 208 // TODO -- move to private 209 // TODO -- make consistent with traits approach below. 210 unordered_map<VkQueue, QUEUE_STATE> queueMap; 211 unordered_map<VkEvent, EVENT_STATE> eventMap; 212 213 unordered_map<VkRenderPass, std::shared_ptr<RENDER_PASS_STATE>> renderPassMap; 214 unordered_map<VkDescriptorSetLayout, std::shared_ptr<cvdescriptorset::DescriptorSetLayout>> descriptorSetLayoutMap; 215 216 std::unordered_set<VkQueue> queues; // All queues under given device 217 std::map<QueryObject, QueryState> queryToStateMap; 218 unordered_map<VkSamplerYcbcrConversion, uint64_t> ycbcr_conversion_ahb_fmt_map; 219 220 // Traits for State function resolution. Specializations defined in the macro. 221 // NOTE: The Dummy argument allows for *partial* specialization at class scope, as full specialization at class scope 222 // isn't supported until C++17. Since the Dummy has a default all instantiations of the template can ignore it, but all 223 // specializations of the template must list it (and not give it a default). 224 template <typename StateType, typename Dummy = int> 225 struct AccessorStateHandle {}; 226 template <typename StateType, typename Dummy = int> 227 struct AccessorTraits {}; 228 template <typename StateType_> 229 struct AccessorTraitsTypes { 230 using StateType = StateType_; 231 using HandleType = typename AccessorStateHandle<StateType>::HandleType; 232 using ReturnType = StateType*; 233 using MappedType = std::unique_ptr<StateType>; 234 using MapType = unordered_map<HandleType, MappedType>; 235 }; 236 237 VALSTATETRACK_MAP_AND_TRAITS(VkSampler, SAMPLER_STATE, samplerMap) 238 VALSTATETRACK_MAP_AND_TRAITS(VkImageView, IMAGE_VIEW_STATE, imageViewMap) 239 VALSTATETRACK_MAP_AND_TRAITS(VkImage, IMAGE_STATE, imageMap) 240 VALSTATETRACK_MAP_AND_TRAITS(VkBufferView, BUFFER_VIEW_STATE, bufferViewMap) 241 VALSTATETRACK_MAP_AND_TRAITS(VkBuffer, BUFFER_STATE, bufferMap) 242 VALSTATETRACK_MAP_AND_TRAITS(VkPipeline, PIPELINE_STATE, pipelineMap) 243 VALSTATETRACK_MAP_AND_TRAITS(VkDeviceMemory, DEVICE_MEMORY_STATE, memObjMap) 244 VALSTATETRACK_MAP_AND_TRAITS(VkFramebuffer, FRAMEBUFFER_STATE, frameBufferMap) 245 VALSTATETRACK_MAP_AND_TRAITS(VkShaderModule, SHADER_MODULE_STATE, shaderModuleMap) 246 VALSTATETRACK_MAP_AND_TRAITS(VkDescriptorUpdateTemplateKHR, TEMPLATE_STATE, desc_template_map) 247 VALSTATETRACK_MAP_AND_TRAITS(VkSwapchainKHR, SWAPCHAIN_NODE, swapchainMap) 248 VALSTATETRACK_MAP_AND_TRAITS(VkDescriptorPool, DESCRIPTOR_POOL_STATE, descriptorPoolMap) 249 VALSTATETRACK_MAP_AND_TRAITS(VkDescriptorSet, cvdescriptorset::DescriptorSet, setMap) 250 VALSTATETRACK_MAP_AND_TRAITS(VkCommandBuffer, CMD_BUFFER_STATE, commandBufferMap) 251 VALSTATETRACK_MAP_AND_TRAITS(VkCommandPool, COMMAND_POOL_STATE, commandPoolMap) 252 VALSTATETRACK_MAP_AND_TRAITS(VkPipelineLayout, PIPELINE_LAYOUT_STATE, pipelineLayoutMap) 253 VALSTATETRACK_MAP_AND_TRAITS(VkFence, FENCE_STATE, fenceMap) 254 VALSTATETRACK_MAP_AND_TRAITS(VkQueryPool, QUERY_POOL_STATE, queryPoolMap) 255 VALSTATETRACK_MAP_AND_TRAITS(VkSemaphore, SEMAPHORE_STATE, semaphoreMap) 256 VALSTATETRACK_MAP_AND_TRAITS(VkAccelerationStructureNV, ACCELERATION_STRUCTURE_STATE, accelerationStructureMap) 257 VALSTATETRACK_MAP_AND_TRAITS_INSTANCE_SCOPE(VkSurfaceKHR, SURFACE_STATE, surface_map) 258 259 public: 260 template <typename State> 261 typename AccessorTraits<State>::ReturnType Get(typename AccessorTraits<State>::Handle handle) { 262 using Traits = AccessorTraits<State>; 263 auto map_member = Traits::Map(); 264 const typename Traits::MapType& map = 265 (Traits::kInstanceScope && (this->*map_member).size() == 0) ? instance_state->*map_member : this->*map_member; 266 267 const auto found_it = map.find(handle); 268 if (found_it == map.end()) { 269 return nullptr; 270 } 271 return found_it->second.get(); 272 }; 273 274 template <typename State> 275 const typename AccessorTraits<State>::ReturnType Get(typename AccessorTraits<State>::HandleType handle) const { 276 using Traits = AccessorTraits<State>; 277 auto map_member = Traits::Map(); 278 const typename Traits::MapType& map = 279 (Traits::kInstanceScope && (this->*map_member).size() == 0) ? instance_state->*map_member : this->*map_member; 280 281 const auto found_it = map.find(handle); 282 if (found_it == map.cend()) { 283 return nullptr; 284 } 285 return found_it->second.get(); 286 }; 287 288 // Accessors for the VALSTATE... maps 289 const SAMPLER_STATE* GetSamplerState(VkSampler sampler) const { return Get<SAMPLER_STATE>(sampler); } 290 SAMPLER_STATE* GetSamplerState(VkSampler sampler) { return Get<SAMPLER_STATE>(sampler); } 291 const IMAGE_VIEW_STATE* GetImageViewState(VkImageView image_view) const { return Get<IMAGE_VIEW_STATE>(image_view); } 292 IMAGE_VIEW_STATE* GetImageViewState(VkImageView image_view) { return Get<IMAGE_VIEW_STATE>(image_view); } 293 const IMAGE_STATE* GetImageState(VkImage image) const { return Get<IMAGE_STATE>(image); } 294 IMAGE_STATE* GetImageState(VkImage image) { return Get<IMAGE_STATE>(image); } 295 const BUFFER_VIEW_STATE* GetBufferViewState(VkBufferView buffer_view) const { return Get<BUFFER_VIEW_STATE>(buffer_view); } 296 BUFFER_VIEW_STATE* GetBufferViewState(VkBufferView buffer_view) { return Get<BUFFER_VIEW_STATE>(buffer_view); } 297 const BUFFER_STATE* GetBufferState(VkBuffer buffer) const { return Get<BUFFER_STATE>(buffer); } 298 BUFFER_STATE* GetBufferState(VkBuffer buffer) { return Get<BUFFER_STATE>(buffer); } 299 const PIPELINE_STATE* GetPipelineState(VkPipeline pipeline) const { return Get<PIPELINE_STATE>(pipeline); } 300 PIPELINE_STATE* GetPipelineState(VkPipeline pipeline) { return Get<PIPELINE_STATE>(pipeline); } 301 const DEVICE_MEMORY_STATE* GetDevMemState(VkDeviceMemory mem) const { return Get<DEVICE_MEMORY_STATE>(mem); } 302 DEVICE_MEMORY_STATE* GetDevMemState(VkDeviceMemory mem) { return Get<DEVICE_MEMORY_STATE>(mem); } 303 const FRAMEBUFFER_STATE* GetFramebufferState(VkFramebuffer framebuffer) const { return Get<FRAMEBUFFER_STATE>(framebuffer); } 304 FRAMEBUFFER_STATE* GetFramebufferState(VkFramebuffer framebuffer) { return Get<FRAMEBUFFER_STATE>(framebuffer); } 305 const SHADER_MODULE_STATE* GetShaderModuleState(VkShaderModule module) const { return Get<SHADER_MODULE_STATE>(module); } 306 SHADER_MODULE_STATE* GetShaderModuleState(VkShaderModule module) { return Get<SHADER_MODULE_STATE>(module); } 307 const TEMPLATE_STATE* GetDescriptorTemplateState(VkDescriptorUpdateTemplateKHR descriptor_update_template) const { 308 return Get<TEMPLATE_STATE>(descriptor_update_template); 309 } 310 TEMPLATE_STATE* GetDescriptorTemplateState(VkDescriptorUpdateTemplateKHR descriptor_update_template) { 311 return Get<TEMPLATE_STATE>(descriptor_update_template); 312 } 313 const SWAPCHAIN_NODE* GetSwapchainState(VkSwapchainKHR swapchain) const { return Get<SWAPCHAIN_NODE>(swapchain); } 314 SWAPCHAIN_NODE* GetSwapchainState(VkSwapchainKHR swapchain) { return Get<SWAPCHAIN_NODE>(swapchain); } 315 const DESCRIPTOR_POOL_STATE* GetDescriptorPoolState(const VkDescriptorPool pool) const { 316 return Get<DESCRIPTOR_POOL_STATE>(pool); 317 } 318 DESCRIPTOR_POOL_STATE* GetDescriptorPoolState(const VkDescriptorPool pool) { return Get<DESCRIPTOR_POOL_STATE>(pool); } 319 const cvdescriptorset::DescriptorSet* GetSetNode(VkDescriptorSet set) const { return Get<cvdescriptorset::DescriptorSet>(set); } 320 cvdescriptorset::DescriptorSet* GetSetNode(VkDescriptorSet set) { return Get<cvdescriptorset::DescriptorSet>(set); } 321 const CMD_BUFFER_STATE* GetCBState(const VkCommandBuffer cb) const { return Get<CMD_BUFFER_STATE>(cb); } 322 CMD_BUFFER_STATE* GetCBState(const VkCommandBuffer cb) { return Get<CMD_BUFFER_STATE>(cb); } 323 const COMMAND_POOL_STATE* GetCommandPoolState(VkCommandPool pool) const { return Get<COMMAND_POOL_STATE>(pool); } 324 COMMAND_POOL_STATE* GetCommandPoolState(VkCommandPool pool) { return Get<COMMAND_POOL_STATE>(pool); } 325 const PIPELINE_LAYOUT_STATE* GetPipelineLayout(VkPipelineLayout pipeLayout) const { 326 return Get<PIPELINE_LAYOUT_STATE>(pipeLayout); 327 } 328 PIPELINE_LAYOUT_STATE* GetPipelineLayout(VkPipelineLayout pipeLayout) { return Get<PIPELINE_LAYOUT_STATE>(pipeLayout); } 329 const FENCE_STATE* GetFenceState(VkFence fence) const { return Get<FENCE_STATE>(fence); } 330 FENCE_STATE* GetFenceState(VkFence fence) { return Get<FENCE_STATE>(fence); } 331 const QUERY_POOL_STATE* GetQueryPoolState(VkQueryPool query_pool) const { return Get<QUERY_POOL_STATE>(query_pool); } 332 QUERY_POOL_STATE* GetQueryPoolState(VkQueryPool query_pool) { return Get<QUERY_POOL_STATE>(query_pool); } 333 const SEMAPHORE_STATE* GetSemaphoreState(VkSemaphore semaphore) const { return Get<SEMAPHORE_STATE>(semaphore); } 334 SEMAPHORE_STATE* GetSemaphoreState(VkSemaphore semaphore) { return Get<SEMAPHORE_STATE>(semaphore); } 335 const ACCELERATION_STRUCTURE_STATE* GetAccelerationStructureState(VkAccelerationStructureNV as) const { 336 return Get<ACCELERATION_STRUCTURE_STATE>(as); 337 } 338 ACCELERATION_STRUCTURE_STATE* GetAccelerationStructureState(VkAccelerationStructureNV as) { 339 return Get<ACCELERATION_STRUCTURE_STATE>(as); 340 } 341 const SURFACE_STATE* GetSurfaceState(VkSurfaceKHR surface) const { return Get<SURFACE_STATE>(surface); } 342 SURFACE_STATE* GetSurfaceState(VkSurfaceKHR surface) { return Get<SURFACE_STATE>(surface); } 343 344 // Class Declarations for helper functions 345 IMAGE_VIEW_STATE* GetAttachmentImageViewState(FRAMEBUFFER_STATE* framebuffer, uint32_t index); 346 const RENDER_PASS_STATE* GetRenderPassState(VkRenderPass renderpass) const; 347 RENDER_PASS_STATE* GetRenderPassState(VkRenderPass renderpass); 348 std::shared_ptr<RENDER_PASS_STATE> GetRenderPassStateSharedPtr(VkRenderPass renderpass); 349 EVENT_STATE* GetEventState(VkEvent event); 350 const QUEUE_STATE* GetQueueState(VkQueue queue) const; 351 QUEUE_STATE* GetQueueState(VkQueue queue); 352 const BINDABLE* GetObjectMemBinding(const VulkanTypedHandle& typed_handle) const; 353 BINDABLE* GetObjectMemBinding(const VulkanTypedHandle& typed_handle); 354 355 // Used for instance versions of this object 356 unordered_map<VkPhysicalDevice, PHYSICAL_DEVICE_STATE> physical_device_map; 357 // Link to the device's physical-device data 358 PHYSICAL_DEVICE_STATE* physical_device_state; 359 360 // Link for derived device objects back to their parent instance object 361 ValidationStateTracker* instance_state; 362 363 const PHYSICAL_DEVICE_STATE* GetPhysicalDeviceState(VkPhysicalDevice phys) const; 364 PHYSICAL_DEVICE_STATE* GetPhysicalDeviceState(VkPhysicalDevice phys); 365 PHYSICAL_DEVICE_STATE* GetPhysicalDeviceState(); 366 const PHYSICAL_DEVICE_STATE* GetPhysicalDeviceState() const; 367 368 using CommandBufferResetCallback = std::function<void(VkCommandBuffer)>; 369 std::unique_ptr<CommandBufferResetCallback> command_buffer_reset_callback; 370 template <typename Fn> 371 void SetCommandBufferResetCallback(Fn&& fn) { 372 command_buffer_reset_callback.reset(new CommandBufferResetCallback(std::forward<Fn>(fn))); 373 } 374 375 using SetImageViewInitialLayoutCallback = std::function<void(CMD_BUFFER_STATE*, const IMAGE_VIEW_STATE&, VkImageLayout)>; 376 std::unique_ptr<SetImageViewInitialLayoutCallback> set_image_view_initial_layout_callback; 377 template <typename Fn> 378 void SetSetImageViewInitialLayoutCallback(Fn&& fn) { 379 set_image_view_initial_layout_callback.reset(new SetImageViewInitialLayoutCallback(std::forward<Fn>(fn))); 380 } 381 382 void CallSetImageViewInitialLayoutCallback(CMD_BUFFER_STATE* cb_node, const IMAGE_VIEW_STATE& iv_state, VkImageLayout layout) { 383 if (set_image_view_initial_layout_callback) { 384 (*set_image_view_initial_layout_callback)(cb_node, iv_state, layout); 385 } 386 } 387 388 // State update functions 389 // Gets/Enumerations 390 void PostCallRecordEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, 391 VkPhysicalDeviceGroupPropertiesKHR* pPhysicalDeviceGroupProperties, 392 VkResult result); 393 void PostCallRecordEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, 394 VkPhysicalDeviceGroupPropertiesKHR* pPhysicalDeviceGroupProperties, 395 VkResult result); 396 void PostCallRecordEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, 397 VkPhysicalDevice* pPhysicalDevices, VkResult result); 398 void PostCallRecordGetAccelerationStructureMemoryRequirementsNV(VkDevice device, 399 const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, 400 VkMemoryRequirements2KHR* pMemoryRequirements); 401 void PostCallRecordGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); 402 void PostCallRecordGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2KHR* pInfo, 403 VkMemoryRequirements2KHR* pMemoryRequirements); 404 void PostCallRecordGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2KHR* pInfo, 405 VkMemoryRequirements2KHR* pMemoryRequirements); 406 void PostCallRecordGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); 407 void PostCallRecordGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue); 408 void PostCallRecordGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); 409 void PostCallRecordGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, 410 VkMemoryRequirements2* pMemoryRequirements); 411 void PostCallRecordGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, 412 VkMemoryRequirements2* pMemoryRequirements); 413 void PostCallRecordGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, 414 VkSparseImageMemoryRequirements* pSparseMemoryRequirements); 415 void PostCallRecordGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2KHR* pInfo, 416 uint32_t* pSparseMemoryRequirementCount, 417 VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements); 418 void PostCallRecordGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2KHR* pInfo, 419 uint32_t* pSparseMemoryRequirementCount, 420 VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements); 421 void PostCallRecordGetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, 422 VkDisplayPlanePropertiesKHR* pProperties, VkResult result); 423 void PostCallRecordGetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, 424 VkDisplayPlaneProperties2KHR* pProperties, VkResult result); 425 void PostCallRecordGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, 426 VkQueueFamilyProperties* pQueueFamilyProperties); 427 void PostCallRecordGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, 428 VkQueueFamilyProperties2KHR* pQueueFamilyProperties); 429 void PostCallRecordGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, 430 uint32_t* pQueueFamilyPropertyCount, 431 VkQueueFamilyProperties2KHR* pQueueFamilyProperties); 432 void PostCallRecordGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 433 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities, VkResult result); 434 void PostCallRecordGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, 435 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, 436 VkSurfaceCapabilities2KHR* pSurfaceCapabilities, VkResult result); 437 void PostCallRecordGetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 438 VkSurfaceCapabilities2EXT* pSurfaceCapabilities, VkResult result); 439 void PostCallRecordGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 440 uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats, 441 VkResult result); 442 void PostCallRecordGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, 443 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, 444 uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats, 445 VkResult result); 446 void PostCallRecordGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 447 uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes, 448 VkResult result); 449 void PostCallRecordGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 450 VkSurfaceKHR surface, VkBool32* pSupported, VkResult result); 451 452 // Create/Destroy/Bind 453 void PostCallRecordBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, 454 const VkBindAccelerationStructureMemoryInfoNV* pBindInfos, 455 VkResult result); 456 void PostCallRecordBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset, 457 VkResult result); 458 void PostCallRecordBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR* pBindInfos, 459 VkResult result); 460 void PostCallRecordBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR* pBindInfos, 461 VkResult result); 462 void PostCallRecordBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memoryOffset, 463 VkResult result); 464 void PostCallRecordBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos, 465 VkResult result); 466 void PostCallRecordBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos, 467 VkResult result); 468 469 void PostCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, 470 const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, VkResult result); 471 void PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator); 472 473 void PostCallRecordCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, 474 const VkAllocationCallbacks* pAllocator, 475 VkAccelerationStructureNV* pAccelerationStructure, VkResult result); 476 void PreCallRecordDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, 477 const VkAllocationCallbacks* pAllocator); 478 void PostCallRecordCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 479 VkBuffer* pBuffer, VkResult result); 480 void PreCallRecordDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); 481 void PostCallRecordCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, 482 const VkAllocationCallbacks* pAllocator, VkBufferView* pView, VkResult result); 483 void PreCallRecordDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); 484 void PostCallRecordCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, 485 const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool, VkResult result); 486 void PreCallRecordDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); 487 void PostCallRecordCreateDisplayPlaneSurfaceKHR(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, 488 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, 489 VkResult result); 490 void PostCallRecordCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 491 VkEvent* pEvent, VkResult result); 492 void PreCallRecordDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator); 493 void PostCallRecordCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, 494 const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool, 495 VkResult result); 496 void PreCallRecordDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, 497 const VkAllocationCallbacks* pAllocator); 498 void PostCallRecordCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, 499 const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout, 500 VkResult result); 501 void PostCallRecordResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags, VkResult result); 502 void PostCallRecordResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags, VkResult result); 503 bool PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 504 const VkComputePipelineCreateInfo* pCreateInfos, 505 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* pipe_state); 506 void PostCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 507 const VkComputePipelineCreateInfo* pCreateInfos, 508 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, 509 void* pipe_state); 510 void PostCallRecordResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags, 511 VkResult result); 512 void PreCallRecordDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, 513 const VkAllocationCallbacks* pAllocator); 514 void PostCallRecordCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, 515 const VkAllocationCallbacks* pAllocator, 516 VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate, VkResult result); 517 void PostCallRecordCreateDescriptorUpdateTemplateKHR(VkDevice device, 518 const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, 519 const VkAllocationCallbacks* pAllocator, 520 VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate, VkResult result); 521 void PreCallRecordDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, 522 const VkAllocationCallbacks* pAllocator); 523 void PreCallRecordDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, 524 const VkAllocationCallbacks* pAllocator); 525 void PostCallRecordCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 526 VkFence* pFence, VkResult result); 527 void PreCallRecordDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); 528 void PostCallRecordCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, 529 const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer, VkResult result); 530 void PreCallRecordDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator); 531 bool PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 532 const VkGraphicsPipelineCreateInfo* pCreateInfos, 533 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* cgpl_state); 534 void PostCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 535 const VkGraphicsPipelineCreateInfo* pCreateInfos, 536 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, 537 void* cgpl_state); 538 void PostCallRecordCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 539 VkImage* pImage, VkResult result); 540 void PreCallRecordDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); 541 void PostCallRecordCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, 542 const VkAllocationCallbacks* pAllocator, VkImageView* pView, VkResult result); 543 void PreCallRecordDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); 544 545 void PreCallRecordDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); 546 void PostCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, 547 const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout, 548 VkResult result); 549 void PreCallRecordDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, 550 const VkAllocationCallbacks* pAllocator); 551 void PostCallRecordCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, 552 const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool, VkResult result); 553 void PreCallRecordDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); 554 void PostCallRecordResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); 555 bool PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 556 const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 557 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 558 void* pipe_state); 559 void PostCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 560 const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 561 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, 562 void* pipe_state); 563 void PostCallRecordCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, 564 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, VkResult result); 565 void PostCallRecordCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR* pCreateInfo, 566 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, VkResult result); 567 void PreCallRecordDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); 568 void PostCallRecordCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, 569 const VkAllocationCallbacks* pAllocator, VkSampler* pSampler, VkResult result); 570 void PreCallRecordDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); 571 void PostCallRecordCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, 572 const VkAllocationCallbacks* pAllocator, 573 VkSamplerYcbcrConversion* pYcbcrConversion, VkResult result); 574 void PostCallRecordDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, 575 const VkAllocationCallbacks* pAllocator); 576 void PostCallRecordCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, 577 const VkAllocationCallbacks* pAllocator, 578 VkSamplerYcbcrConversion* pYcbcrConversion, VkResult result); 579 void PostCallRecordDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, 580 const VkAllocationCallbacks* pAllocator); 581 void PostCallRecordCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, 582 const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore, VkResult result); 583 void PreCallRecordDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); 584 void PostCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, 585 const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, VkResult result, 586 void* csm_state); 587 void PreCallRecordDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); 588 void PreCallRecordDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); 589 void PostCallRecordCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, 590 const VkSwapchainCreateInfoKHR* pCreateInfos, 591 const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains, 592 VkResult result); 593 void PostCallRecordCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, 594 const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain, VkResult result); 595 void PreCallRecordDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); 596 597 // CommandBuffer Control 598 void PreCallRecordBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); 599 void PostCallRecordEndCommandBuffer(VkCommandBuffer commandBuffer, VkResult result); 600 void PostCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence, 601 VkResult result); 602 603 // Allocate/Free 604 void PostCallRecordAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pCreateInfo, 605 VkCommandBuffer* pCommandBuffer, VkResult result); 606 void PostCallRecordAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, 607 VkDescriptorSet* pDescriptorSets, VkResult result, void* ads_state); 608 void PostCallRecordAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, 609 const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory, VkResult result); 610 void PreCallRecordFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, 611 const VkCommandBuffer* pCommandBuffers); 612 void PreCallRecordFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, 613 const VkDescriptorSet* pDescriptorSets); 614 void PreCallRecordFreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks* pAllocator); 615 void PreCallRecordUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, 616 const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, 617 const VkCopyDescriptorSet* pDescriptorCopies); 618 void PreCallRecordUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, 619 VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); 620 void PreCallRecordUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, 621 VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData); 622 623 // Recorded Commands 624 void PreCallRecordCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); 625 void PostCallRecordCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags); 626 void PostCallRecordCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, 627 VkQueryControlFlags flags, uint32_t index); 628 void PreCallRecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 629 VkSubpassContents contents); 630 void PreCallRecordCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 631 const VkSubpassBeginInfoKHR* pSubpassBeginInfo); 632 void PreCallRecordCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, 633 VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, 634 const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, 635 const uint32_t* pDynamicOffsets); 636 void PreCallRecordCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 637 VkIndexType indexType); 638 void PreCallRecordCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); 639 void PreCallRecordCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); 640 void PreCallRecordCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, 641 const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); 642 void PreCallRecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 643 VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, 644 VkFilter filter); 645 void PostCallRecordCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, 646 VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, 647 VkAccelerationStructureNV dst, VkAccelerationStructureNV src, 648 VkBuffer scratch, VkDeviceSize scratchOffset); 649 void PreCallRecordCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 650 const VkClearColorValue* pColor, uint32_t rangeCount, 651 const VkImageSubresourceRange* pRanges); 652 void PreCallRecordCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 653 const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, 654 const VkImageSubresourceRange* pRanges); 655 void PostCallRecordCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, 656 VkAccelerationStructureNV src, VkCopyAccelerationStructureModeNV mode); 657 void PreCallRecordCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, 658 const VkBufferCopy* pRegions); 659 void PreCallRecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, 660 VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); 661 void PreCallRecordCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 662 VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); 663 void PreCallRecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 664 VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); 665 void PostCallRecordCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 666 uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, 667 VkQueryResultFlags flags); 668 void PostCallRecordCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z); 669 void PostCallRecordCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); 670 void PostCallRecordCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, 671 uint32_t firstInstance); 672 void PostCallRecordCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, 673 uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); 674 void PostCallRecordCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, 675 uint32_t stride); 676 void PostCallRecordCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, 677 uint32_t stride); 678 void PreCallRecordCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 679 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 680 uint32_t stride); 681 void PreCallRecordCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 682 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 683 uint32_t stride); 684 void PreCallRecordCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 685 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 686 uint32_t stride); 687 void PreCallRecordCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 688 uint32_t drawCount, uint32_t stride); 689 void PreCallRecordCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); 690 void PostCallRecordCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer); 691 void PostCallRecordCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot); 692 void PostCallRecordCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index); 693 void PostCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer); 694 void PostCallRecordCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo); 695 void PreCallRecordCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, 696 const VkCommandBuffer* pCommandBuffers); 697 void PreCallRecordCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, 698 uint32_t data); 699 void PreCallRecordCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); 700 void PostCallRecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); 701 void PostCallRecordCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo, 702 const VkSubpassEndInfoKHR* pSubpassEndInfo); 703 void PostCallRecordCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 704 uint32_t queryCount); 705 void PreCallRecordCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 706 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, 707 const VkImageResolve* pRegions); 708 void PreCallRecordCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]); 709 void PreCallRecordCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, 710 float depthBiasSlopeFactor); 711 void PreCallRecordCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); 712 void PreCallRecordCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, 713 uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors); 714 void PreCallRecordCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth); 715 void PreCallRecordCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); 716 void PreCallRecordCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, 717 const VkRect2D* pScissors); 718 void PreCallRecordCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); 719 void PreCallRecordCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); 720 void PreCallRecordCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); 721 void PreCallRecordCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, 722 const VkViewport* pViewports); 723 void PreCallRecordCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, 724 uint32_t viewportCount, 725 const VkShadingRatePaletteNV* pShadingRatePalettes); 726 void PostCallRecordCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, 727 VkDeviceSize dataSize, const void* pData); 728 729 // WSI 730 void PostCallRecordAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, 731 VkFence fence, uint32_t* pImageIndex, VkResult result); 732 void PostCallRecordAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex, 733 VkResult result); 734 #ifdef VK_USE_PLATFORM_ANDROID_KHR 735 void PostCallRecordCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, 736 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result); 737 #endif // VK_USE_PLATFORM_ANDROID_KHR 738 #ifdef VK_USE_PLATFORM_IOS_MVK 739 void PostCallRecordCreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, 740 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result); 741 #endif // VK_USE_PLATFORM_IOS_MVK 742 #ifdef VK_USE_PLATFORM_MACOS_MVK 743 void PostCallRecordCreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, 744 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result); 745 #endif // VK_USE_PLATFORM_MACOS_MVK 746 #ifdef VK_USE_PLATFORM_WIN32_KHR 747 void PostCallRecordCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, 748 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result); 749 #endif // VK_USE_PLATFORM_WIN32_KHR 750 #ifdef VK_USE_PLATFORM_WAYLAND_KHR 751 void PostCallRecordCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, 752 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result); 753 #endif // VK_USE_PLATFORM_WAYLAND_KHR 754 #ifdef VK_USE_PLATFORM_XCB_KHR 755 void PostCallRecordCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, 756 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result); 757 #endif // VK_USE_PLATFORM_XCB_KHR 758 #ifdef VK_USE_PLATFORM_XLIB_KHR 759 void PostCallRecordCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, 760 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result); 761 #endif // VK_USE_PLATFORM_XLIB_KHR 762 763 // State Utilty functions 764 void AddCommandBufferBinding(std::unordered_set<CMD_BUFFER_STATE*>* cb_bindings, const VulkanTypedHandle& obj, 765 CMD_BUFFER_STATE* cb_node); 766 void AddCommandBufferBindingAccelerationStructure(CMD_BUFFER_STATE*, ACCELERATION_STRUCTURE_STATE*); 767 void AddCommandBufferBindingBuffer(CMD_BUFFER_STATE*, BUFFER_STATE*); 768 void AddCommandBufferBindingBufferView(CMD_BUFFER_STATE*, BUFFER_VIEW_STATE*); 769 void AddCommandBufferBindingImage(CMD_BUFFER_STATE*, IMAGE_STATE*); 770 void AddCommandBufferBindingImageView(CMD_BUFFER_STATE*, IMAGE_VIEW_STATE*); 771 void AddCommandBufferBindingSampler(CMD_BUFFER_STATE*, SAMPLER_STATE*); 772 void AddMemObjInfo(void* object, const VkDeviceMemory mem, const VkMemoryAllocateInfo* pAllocateInfo); 773 void AddFramebufferBinding(CMD_BUFFER_STATE* cb_state, FRAMEBUFFER_STATE* fb_state); 774 void ClearCmdBufAndMemReferences(CMD_BUFFER_STATE* cb_node); 775 void ClearMemoryObjectBindings(const VulkanTypedHandle& typed_handle); 776 void ClearMemoryObjectBinding(const VulkanTypedHandle& typed_handle, VkDeviceMemory mem); 777 void DecrementBoundResources(CMD_BUFFER_STATE const* cb_node); 778 void DeleteDescriptorSetPools(); 779 void FreeCommandBufferStates(COMMAND_POOL_STATE* pool_state, const uint32_t command_buffer_count, 780 const VkCommandBuffer* command_buffers); 781 void FreeDescriptorSet(cvdescriptorset::DescriptorSet* descriptor_set); 782 BASE_NODE* GetStateStructPtrFromObject(const VulkanTypedHandle& object_struct); 783 void IncrementBoundObjects(CMD_BUFFER_STATE const* cb_node); 784 void IncrementResources(CMD_BUFFER_STATE* cb_node); 785 void InsertAccelerationStructureMemoryRange(VkAccelerationStructureNV as, DEVICE_MEMORY_STATE* mem_info, 786 VkDeviceSize mem_offset, const VkMemoryRequirements& mem_reqs); 787 void InsertBufferMemoryRange(VkBuffer buffer, DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset, 788 const VkMemoryRequirements& mem_reqs); 789 void InsertImageMemoryRange(VkImage image, DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset, 790 VkMemoryRequirements mem_reqs, bool is_linear); 791 void InsertMemoryRange(const VulkanTypedHandle& typed_handle, DEVICE_MEMORY_STATE* mem_info, VkDeviceSize memoryOffset, 792 VkMemoryRequirements memRequirements, bool is_linear); 793 void InvalidateCommandBuffers(std::unordered_set<CMD_BUFFER_STATE*> const& cb_nodes, const VulkanTypedHandle& obj); 794 void PerformAllocateDescriptorSets(const VkDescriptorSetAllocateInfo*, const VkDescriptorSet*, 795 const cvdescriptorset::AllocateDescriptorSetsData*); 796 void PerformUpdateDescriptorSetsWithTemplateKHR(VkDescriptorSet descriptorSet, const TEMPLATE_STATE* template_state, 797 const void* pData); 798 void RecordAcquireNextImageState(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, 799 VkFence fence, uint32_t* pImageIndex); 800 void RecordCmdBeginQuery(CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj); 801 void RecordCmdEndQuery(CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj); 802 void RecordCmdEndRenderPassState(VkCommandBuffer commandBuffer); 803 void RecordCmdBeginRenderPassState(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 804 const VkSubpassContents contents); 805 void RecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); 806 void RecordCreateImageANDROID(const VkImageCreateInfo* create_info, IMAGE_STATE* is_node); 807 void RecordCreateRenderPassState(RenderPassCreateVersion rp_version, std::shared_ptr<RENDER_PASS_STATE>& render_pass, 808 VkRenderPass* pRenderPass); 809 void RecordCreateSamplerYcbcrConversionState(const VkSamplerYcbcrConversionCreateInfo* create_info, 810 VkSamplerYcbcrConversion ycbcr_conversion); 811 void RecordCreateSamplerYcbcrConversionANDROID(const VkSamplerYcbcrConversionCreateInfo* create_info, 812 VkSamplerYcbcrConversion ycbcr_conversion); 813 void RecordCreateSwapchainState(VkResult result, const VkSwapchainCreateInfoKHR* pCreateInfo, VkSwapchainKHR* pSwapchain, 814 SURFACE_STATE* surface_state, SWAPCHAIN_NODE* old_swapchain_state); 815 void RecordDestroySamplerYcbcrConversionANDROID(VkSamplerYcbcrConversion ycbcr_conversion); 816 void RecordEnumeratePhysicalDeviceGroupsState(uint32_t* pPhysicalDeviceGroupCount, 817 VkPhysicalDeviceGroupPropertiesKHR* pPhysicalDeviceGroupProperties); 818 void RecordGetBufferMemoryRequirementsState(VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); 819 void RecordGetDeviceQueueState(uint32_t queue_family_index, VkQueue queue); 820 void RecordGetImageMemoryRequiementsState(VkImage image, VkMemoryRequirements* pMemoryRequirements); 821 void RecordGetPhysicalDeviceDisplayPlanePropertiesState(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, 822 void* pProperties); 823 void RecordUpdateDescriptorSetWithTemplateState(VkDescriptorSet descriptorSet, 824 VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData); 825 void RecordCreateDescriptorUpdateTemplateState(const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, 826 VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); 827 void RecordPipelineShaderStage(const VkPipelineShaderStageCreateInfo* pStage, PIPELINE_STATE* pipeline, 828 PIPELINE_STATE::StageState* stage_state); 829 void RecordRenderPassDAG(RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2KHR* pCreateInfo, 830 RENDER_PASS_STATE* render_pass); 831 void RecordVulkanSurface(VkSurfaceKHR* pSurface); 832 void RemoveAccelerationStructureMemoryRange(uint64_t handle, DEVICE_MEMORY_STATE* mem_info); 833 void RemoveCommandBufferBinding(const VulkanTypedHandle& object, CMD_BUFFER_STATE* cb_node); 834 void RemoveBufferMemoryRange(uint64_t handle, DEVICE_MEMORY_STATE* mem_info); 835 void RemoveImageMemoryRange(uint64_t handle, DEVICE_MEMORY_STATE* mem_info); 836 void ResetCommandBufferState(const VkCommandBuffer cb); 837 void RetireWorkOnQueue(QUEUE_STATE* pQueue, uint64_t seq, bool switch_finished_queries); 838 void SetMemBinding(VkDeviceMemory mem, BINDABLE* mem_binding, VkDeviceSize memory_offset, 839 const VulkanTypedHandle& typed_handle); 840 bool SetQueryState(VkQueue queue, VkCommandBuffer commandBuffer, QueryObject object, QueryState value); 841 bool SetQueryStateMulti(VkQueue queue, VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 842 uint32_t queryCount, QueryState value); 843 void UpdateBindBufferMemoryState(VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset); 844 void UpdateBindImageMemoryState(const VkBindImageMemoryInfo& bindInfo); 845 void UpdateLastBoundDescriptorSets(CMD_BUFFER_STATE* cb_state, VkPipelineBindPoint pipeline_bind_point, 846 const PIPELINE_LAYOUT_STATE* pipeline_layout, uint32_t first_set, uint32_t set_count, 847 const VkDescriptorSet* pDescriptorSets, cvdescriptorset::DescriptorSet* push_descriptor_set, 848 uint32_t dynamic_offset_count, const uint32_t* p_dynamic_offsets); 849 void UpdateStateCmdDrawDispatchType(CMD_BUFFER_STATE* cb_state, VkPipelineBindPoint bind_point); 850 void UpdateStateCmdDrawType(CMD_BUFFER_STATE* cb_state, VkPipelineBindPoint bind_point); 851 void UpdateDrawState(CMD_BUFFER_STATE* cb_state, const VkPipelineBindPoint bind_point); 852 853 DeviceFeatures enabled_features = {}; 854 // Device specific data 855 VkPhysicalDeviceMemoryProperties phys_dev_mem_props = {}; 856 VkPhysicalDeviceProperties phys_dev_props = {}; 857 uint32_t physical_device_count; 858 859 // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2KHR::pNext chain 860 struct DeviceExtensionProperties { 861 uint32_t max_push_descriptors; // from VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors 862 VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_props; 863 VkPhysicalDeviceShadingRateImagePropertiesNV shading_rate_image_props; 864 VkPhysicalDeviceMeshShaderPropertiesNV mesh_shader_props; 865 VkPhysicalDeviceInlineUniformBlockPropertiesEXT inline_uniform_block_props; 866 VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vtx_attrib_divisor_props; 867 VkPhysicalDeviceDepthStencilResolvePropertiesKHR depth_stencil_resolve_props; 868 VkPhysicalDeviceCooperativeMatrixPropertiesNV cooperative_matrix_props; 869 VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback_props; 870 VkPhysicalDeviceSubgroupProperties subgroup_props; 871 VkPhysicalDeviceRayTracingPropertiesNV ray_tracing_props; 872 VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT texel_buffer_alignment_props; 873 VkPhysicalDeviceFragmentDensityMapPropertiesEXT fragment_density_map_props; 874 }; 875 DeviceExtensionProperties phys_dev_ext_props = {}; 876 std::vector<VkCooperativeMatrixPropertiesNV> cooperative_matrix_properties; 877 878 // Map for queue family index to queue count 879 unordered_map<uint32_t, uint32_t> queue_family_index_map; 880 881 template <typename ExtProp> 882 void GetPhysicalDeviceExtProperties(VkPhysicalDevice gpu, bool enabled, ExtProp* ext_prop) { 883 assert(ext_prop); 884 if (enabled) { 885 *ext_prop = lvl_init_struct<ExtProp>(); 886 auto prop2 = lvl_init_struct<VkPhysicalDeviceProperties2KHR>(ext_prop); 887 DispatchGetPhysicalDeviceProperties2KHR(gpu, &prop2); 888 } 889 } 890 891 // This controls output of a state tracking warning (s.t. it only emits once) 892 bool external_sync_warning = false; 893 }; 894 895 class CoreChecks : public ValidationStateTracker { 896 public: 897 using StateTracker = ValidationStateTracker; 898 std::unordered_set<uint64_t> ahb_ext_formats_set; 899 GlobalQFOTransferBarrierMap<VkImageMemoryBarrier> qfo_release_image_barrier_map; 900 GlobalQFOTransferBarrierMap<VkBufferMemoryBarrier> qfo_release_buffer_barrier_map; 901 unordered_map<VkImage, std::vector<ImageSubresourcePair>> imageSubresourceMap; 902 using ImageSubresPairLayoutMap = std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_STATE>; 903 ImageSubresPairLayoutMap imageLayoutMap; 904 905 std::unique_ptr<GpuValidationState> gpu_validation_state; 906 907 bool VerifyQueueStateToSeq(QUEUE_STATE* initial_queue, uint64_t initial_seq); 908 bool ValidateSetMemBinding(VkDeviceMemory mem, const VulkanTypedHandle& typed_handle, const char* apiName) const; 909 bool SetSparseMemBinding(MEM_BINDING binding, const VulkanTypedHandle& typed_handle); 910 bool ValidateDeviceQueueFamily(uint32_t queue_family, const char* cmd_name, const char* parameter_name, const char* error_code, 911 bool optional) const; 912 bool ValidateBindBufferMemory(VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset, const char* api_name) const; 913 bool ValidateGetImageMemoryRequirements2(const VkImageMemoryRequirementsInfo2* pInfo) const; 914 bool CheckCommandBuffersInFlight(const COMMAND_POOL_STATE* pPool, const char* action, const char* error_code) const; 915 bool CheckCommandBufferInFlight(const CMD_BUFFER_STATE* cb_node, const char* action, const char* error_code) const; 916 bool VerifyQueueStateToFence(VkFence fence); 917 bool VerifyWaitFenceState(VkFence fence, const char* apiCall); 918 void RetireFence(VkFence fence); 919 void StoreMemRanges(VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size); 920 bool ValidateIdleDescriptorSet(VkDescriptorSet set, const char* func_str); 921 void InitializeAndTrackMemory(VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, void** ppData); 922 bool ValidatePipelineLocked(std::vector<std::unique_ptr<PIPELINE_STATE>> const& pPipelines, int pipelineIndex) const; 923 bool ValidatePipelineUnlocked(const PIPELINE_STATE* pPipeline, uint32_t pipelineIndex) const; 924 bool ValidImageBufferQueue(const CMD_BUFFER_STATE* cb_node, const VulkanTypedHandle& object, VkQueue queue, uint32_t count, 925 const uint32_t* indices) const; 926 bool ValidateFenceForSubmit(const FENCE_STATE* pFence) const; 927 bool ValidateSemaphoresForSubmit(VkQueue queue, const VkSubmitInfo* submit, 928 std::unordered_set<VkSemaphore>* unsignaled_sema_arg, 929 std::unordered_set<VkSemaphore>* signaled_sema_arg, 930 std::unordered_set<VkSemaphore>* internal_sema_arg) const; 931 bool ValidateCommandBuffersForSubmit(VkQueue queue, const VkSubmitInfo* submit, 932 ImageSubresPairLayoutMap* localImageLayoutMap_arg, 933 std::vector<VkCommandBuffer>* current_cmds_arg) const; 934 bool ValidateStatus(const CMD_BUFFER_STATE* pNode, CBStatusFlags status_mask, VkFlags msg_flags, const char* fail_msg, 935 const char* msg_code) const; 936 bool ValidateDrawStateFlags(const CMD_BUFFER_STATE* pCB, const PIPELINE_STATE* pPipe, bool indexed, const char* msg_code) const; 937 bool LogInvalidAttachmentMessage(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 938 const RENDER_PASS_STATE* rp2_state, uint32_t primary_attach, uint32_t secondary_attach, 939 const char* msg, const char* caller, const char* error_code) const; 940 bool ValidateStageMaskGsTsEnables(VkPipelineStageFlags stageMask, const char* caller, const char* geo_error_id, 941 const char* tess_error_id, const char* mesh_error_id, const char* task_error_id) const; 942 bool ValidateMapMemRange(VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size); 943 bool ValidatePushConstantRange(const uint32_t offset, const uint32_t size, const char* caller_name, uint32_t index) const; 944 bool ValidateRenderPassDAG(RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2KHR* pCreateInfo) const; 945 bool ValidateAttachmentCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 946 const RENDER_PASS_STATE* rp2_state, uint32_t primary_attach, uint32_t secondary_attach, 947 const char* caller, const char* error_code) const; 948 bool ValidateSubpassCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 949 const RENDER_PASS_STATE* rp2_state, const int subpass, const char* caller, 950 const char* error_code) const; 951 bool ValidateRenderPassCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 952 const RENDER_PASS_STATE* rp2_state, const char* caller, const char* error_code) const; 953 bool ReportInvalidCommandBuffer(const CMD_BUFFER_STATE* cb_state, const char* call_source) const; 954 void InitGpuValidation(); 955 bool ValidateQueueFamilyIndex(const PHYSICAL_DEVICE_STATE* pd_state, uint32_t requested_queue_family, const char* err_code, 956 const char* cmd_name, const char* queue_family_var_name); 957 bool ValidateDeviceQueueCreateInfos(const PHYSICAL_DEVICE_STATE* pd_state, uint32_t info_count, 958 const VkDeviceQueueCreateInfo* infos); 959 960 bool ValidatePipelineVertexDivisors(std::vector<std::unique_ptr<PIPELINE_STATE>> const& pipe_state_vec, const uint32_t count, 961 const VkGraphicsPipelineCreateInfo* pipe_cis) const; 962 bool ValidateImageBarrierImage(const char* funcName, CMD_BUFFER_STATE const* cb_state, VkFramebuffer framebuffer, 963 uint32_t active_subpass, const safe_VkSubpassDescription2KHR& sub_desc, 964 const VulkanTypedHandle& rp_handle, uint32_t img_index, const VkImageMemoryBarrier& img_barrier); 965 bool ValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, RenderPassCreateVersion rp_version, 966 const VkRenderPassBeginInfo* pRenderPassBegin) const; 967 bool ValidateDependencies(FRAMEBUFFER_STATE const* framebuffer, RENDER_PASS_STATE const* renderPass) const; 968 bool ValidateBarriers(const char* funcName, CMD_BUFFER_STATE* cb_state, VkPipelineStageFlags src_stage_mask, 969 VkPipelineStageFlags dst_stage_mask, uint32_t memBarrierCount, const VkMemoryBarrier* pMemBarriers, 970 uint32_t bufferBarrierCount, const VkBufferMemoryBarrier* pBufferMemBarriers, 971 uint32_t imageMemBarrierCount, const VkImageMemoryBarrier* pImageMemBarriers); 972 bool ValidateBarrierQueueFamilies(const char* func_name, CMD_BUFFER_STATE* cb_state, const VkImageMemoryBarrier& barrier, 973 const IMAGE_STATE* state_data); 974 bool ValidateBarrierQueueFamilies(const char* func_name, CMD_BUFFER_STATE* cb_state, const VkBufferMemoryBarrier& barrier, 975 const BUFFER_STATE* state_data); 976 bool ValidateCreateSwapchain(const char* func_name, VkSwapchainCreateInfoKHR const* pCreateInfo, 977 const SURFACE_STATE* surface_state, const SWAPCHAIN_NODE* old_swapchain_state) const; 978 void RecordCmdPushDescriptorSetState(CMD_BUFFER_STATE* cb_state, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, 979 uint32_t set, uint32_t descriptorWriteCount, 980 const VkWriteDescriptorSet* pDescriptorWrites); 981 bool ValidatePipelineBindPoint(const CMD_BUFFER_STATE* cb_state, VkPipelineBindPoint bind_point, const char* func_name, 982 const std::map<VkPipelineBindPoint, std::string>& bind_errors) const; 983 bool ValidateMemoryIsMapped(const char* funcName, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges); 984 bool ValidateAndCopyNoncoherentMemoryToDriver(uint32_t mem_range_count, const VkMappedMemoryRange* mem_ranges); 985 void CopyNoncoherentMemoryFromDriver(uint32_t mem_range_count, const VkMappedMemoryRange* mem_ranges); 986 bool ValidateMappedMemoryRangeDeviceLimits(const char* func_name, uint32_t mem_range_count, 987 const VkMappedMemoryRange* mem_ranges); 988 BarrierOperationsType ComputeBarrierOperationsType(CMD_BUFFER_STATE* cb_state, uint32_t buffer_barrier_count, 989 const VkBufferMemoryBarrier* buffer_barriers, uint32_t image_barrier_count, 990 const VkImageMemoryBarrier* image_barriers); 991 bool ValidateStageMasksAgainstQueueCapabilities(CMD_BUFFER_STATE const* cb_state, VkPipelineStageFlags source_stage_mask, 992 VkPipelineStageFlags dest_stage_mask, BarrierOperationsType barrier_op_type, 993 const char* function, const char* error_code); 994 bool SetEventStageMask(VkQueue queue, VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); 995 bool ValidateRenderPassImageBarriers(const char* funcName, CMD_BUFFER_STATE* cb_state, uint32_t active_subpass, 996 const safe_VkSubpassDescription2KHR& sub_desc, const VulkanTypedHandle& rp_handle, 997 const safe_VkSubpassDependency2KHR* dependencies, 998 const std::vector<uint32_t>& self_dependencies, uint32_t image_mem_barrier_count, 999 const VkImageMemoryBarrier* image_barriers); 1000 bool ValidateSecondaryCommandBufferState(const CMD_BUFFER_STATE* pCB, const CMD_BUFFER_STATE* pSubCB); 1001 bool ValidateFramebuffer(VkCommandBuffer primaryBuffer, const CMD_BUFFER_STATE* pCB, VkCommandBuffer secondaryBuffer, 1002 const CMD_BUFFER_STATE* pSubCB, const char* caller); 1003 bool ValidateDescriptorUpdateTemplate(const char* func_name, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo); 1004 bool ValidateCreateSamplerYcbcrConversion(const char* func_name, const VkSamplerYcbcrConversionCreateInfo* create_info) const; 1005 bool ValidateImportFence(VkFence fence, const char* caller_name); 1006 void RecordImportFenceState(VkFence fence, VkExternalFenceHandleTypeFlagBitsKHR handle_type, VkFenceImportFlagsKHR flags); 1007 void RecordGetExternalFenceState(VkFence fence, VkExternalFenceHandleTypeFlagBitsKHR handle_type); 1008 bool ValidateAcquireNextImage(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, 1009 uint32_t* pImageIndex, const char* func_name) const; 1010 bool VerifyRenderAreaBounds(const VkRenderPassBeginInfo* pRenderPassBegin) const; 1011 bool VerifyFramebufferAndRenderPassImageViews(const VkRenderPassBeginInfo* pRenderPassBeginInfo) const; 1012 bool ValidatePrimaryCommandBuffer(const CMD_BUFFER_STATE* pCB, char const* cmd_name, const char* error_code) const; 1013 void RecordCmdNextSubpassLayouts(VkCommandBuffer commandBuffer, VkSubpassContents contents); 1014 bool ValidateCmdEndRenderPass(RenderPassCreateVersion rp_version, VkCommandBuffer commandBuffer) const; 1015 void RecordCmdEndRenderPassLayouts(VkCommandBuffer commandBuffer); 1016 bool ValidateFramebufferCreateInfo(const VkFramebufferCreateInfo* pCreateInfo) const; 1017 bool MatchUsage(uint32_t count, const VkAttachmentReference2KHR* attachments, const VkFramebufferCreateInfo* fbci, 1018 VkImageUsageFlagBits usage_flag, const char* error_code) const; 1019 bool IsImageLayoutReadOnly(VkImageLayout layout) const; 1020 bool CheckDependencyExists(const uint32_t subpass, const VkImageLayout layout, 1021 const std::vector<SubpassLayout>& dependent_subpasses, const std::vector<DAGNode>& subpass_to_node, 1022 bool& skip) const; 1023 bool CheckPreserved(const VkRenderPassCreateInfo2KHR* pCreateInfo, const int index, const uint32_t attachment, 1024 const std::vector<DAGNode>& subpass_to_node, int depth, bool& skip) const; 1025 bool ValidateBindImageMemory(const VkBindImageMemoryInfo& bindInfo, const char* api_name) const; 1026 bool ValidateGetPhysicalDeviceDisplayPlanePropertiesKHRQuery(VkPhysicalDevice physicalDevice, uint32_t planeIndex, 1027 const char* api_name) const; 1028 bool ValidateQuery(VkQueue queue, CMD_BUFFER_STATE* pCB, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, 1029 VkQueryResultFlags flags) const; 1030 QueryState GetQueryState(const QUEUE_STATE* queue_data, VkQueryPool queryPool, uint32_t queryIndex) const; 1031 bool VerifyQueryIsReset(VkQueue queue, VkCommandBuffer commandBuffer, QueryObject query_obj) const; 1032 bool ValidateImportSemaphore(VkSemaphore semaphore, const char* caller_name); 1033 void RecordImportSemaphoreState(VkSemaphore semaphore, VkExternalSemaphoreHandleTypeFlagBitsKHR handle_type, 1034 VkSemaphoreImportFlagsKHR flags); 1035 void RecordGetExternalSemaphoreState(VkSemaphore semaphore, VkExternalSemaphoreHandleTypeFlagBitsKHR handle_type); 1036 bool ValidateBeginQuery(const CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj, VkFlags flags, CMD_TYPE cmd, 1037 const char* cmd_name, const char* vuid_queue_flags, const char* vuid_queue_feedback, 1038 const char* vuid_queue_occlusion, const char* vuid_precise, const char* vuid_query_count) const; 1039 bool ValidateCmdEndQuery(const CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj, CMD_TYPE cmd, const char* cmd_name, 1040 const char* vuid_queue_flags, const char* vuid_active_queries) const; 1041 bool ValidateCmdDrawType(VkCommandBuffer cmd_buffer, bool indexed, VkPipelineBindPoint bind_point, CMD_TYPE cmd_type, 1042 const char* caller, VkQueueFlags queue_flags, const char* queue_flag_code, 1043 const char* renderpass_msg_code, const char* pipebound_msg_code, 1044 const char* dynamic_state_msg_code) const; 1045 bool ValidateCmdNextSubpass(RenderPassCreateVersion rp_version, VkCommandBuffer commandBuffer) const; 1046 bool ValidateInsertMemoryRange(const VulkanTypedHandle& typed_handle, const DEVICE_MEMORY_STATE* mem_info, 1047 VkDeviceSize memoryOffset, const VkMemoryRequirements& memRequirements, bool is_linear, 1048 const char* api_name) const; 1049 bool ValidateInsertImageMemoryRange(VkImage image, const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset, 1050 const VkMemoryRequirements& mem_reqs, bool is_linear, const char* api_name) const; 1051 bool ValidateInsertBufferMemoryRange(VkBuffer buffer, const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset, 1052 const VkMemoryRequirements& mem_reqs, const char* api_name) const; 1053 bool ValidateInsertAccelerationStructureMemoryRange(VkAccelerationStructureNV as, const DEVICE_MEMORY_STATE* mem_info, 1054 VkDeviceSize mem_offset, const VkMemoryRequirements& mem_reqs, 1055 const char* api_name) const; 1056 1057 bool ValidateMemoryTypes(const DEVICE_MEMORY_STATE* mem_info, const uint32_t memory_type_bits, const char* funcName, 1058 const char* msgCode) const; 1059 bool ValidateCommandBufferState(const CMD_BUFFER_STATE* cb_state, const char* call_source, int current_submit_count, 1060 const char* vu_id) const; 1061 bool ValidateCommandBufferSimultaneousUse(const CMD_BUFFER_STATE* pCB, int current_submit_count) const; 1062 bool ValidateGetDeviceQueue(uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue, const char* valid_qfi_vuid, 1063 const char* qfi_in_range_vuid) const; 1064 bool ValidateRenderpassAttachmentUsage(RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2KHR* pCreateInfo) const; 1065 bool AddAttachmentUse(RenderPassCreateVersion rp_version, uint32_t subpass, std::vector<uint8_t>& attachment_uses, 1066 std::vector<VkImageLayout>& attachment_layouts, uint32_t attachment, uint8_t new_use, 1067 VkImageLayout new_layout) const; 1068 bool ValidateAttachmentIndex(RenderPassCreateVersion rp_version, uint32_t attachment, uint32_t attachment_count, 1069 const char* type) const; 1070 bool ValidateCreateRenderPass(VkDevice device, RenderPassCreateVersion rp_version, 1071 const VkRenderPassCreateInfo2KHR* pCreateInfo) const; 1072 bool ValidateRenderPassPipelineBarriers(const char* funcName, CMD_BUFFER_STATE* cb_state, VkPipelineStageFlags src_stage_mask, 1073 VkPipelineStageFlags dst_stage_mask, VkDependencyFlags dependency_flags, 1074 uint32_t mem_barrier_count, const VkMemoryBarrier* mem_barriers, 1075 uint32_t buffer_mem_barrier_count, const VkBufferMemoryBarrier* buffer_mem_barriers, 1076 uint32_t image_mem_barrier_count, const VkImageMemoryBarrier* image_barriers); 1077 bool CheckStageMaskQueueCompatibility(VkCommandBuffer command_buffer, VkPipelineStageFlags stage_mask, VkQueueFlags queue_flags, 1078 const char* function, const char* src_or_dest, const char* error_code); 1079 bool ValidateUpdateDescriptorSetWithTemplate(VkDescriptorSet descriptorSet, 1080 VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData); 1081 bool ValidateMemoryIsBoundToBuffer(const BUFFER_STATE*, const char*, const char*) const; 1082 bool ValidateMemoryIsBoundToImage(const IMAGE_STATE*, const char*, const char*) const; 1083 bool ValidateMemoryIsBoundToAccelerationStructure(const ACCELERATION_STRUCTURE_STATE*, const char*, const char*) const; 1084 bool ValidateObjectNotInUse(const BASE_NODE* obj_node, const VulkanTypedHandle& obj_struct, const char* caller_name, 1085 const char* error_code) const; 1086 bool ValidateCmdQueueFlags(const CMD_BUFFER_STATE* cb_node, const char* caller_name, VkQueueFlags flags, 1087 const char* error_code) const; 1088 bool InsideRenderPass(const CMD_BUFFER_STATE* pCB, const char* apiName, const char* msgCode) const; 1089 bool OutsideRenderPass(const CMD_BUFFER_STATE* pCB, const char* apiName, const char* msgCode) const; 1090 1091 static void SetLayout(ImageSubresPairLayoutMap& imageLayoutMap, ImageSubresourcePair imgpair, VkImageLayout layout); 1092 1093 bool ValidateImageSampleCount(const IMAGE_STATE* image_state, VkSampleCountFlagBits sample_count, const char* location, 1094 const std::string& msgCode) const; 1095 bool ValidateCmdSubpassState(const CMD_BUFFER_STATE* pCB, const CMD_TYPE cmd_type) const; 1096 bool ValidateCmd(const CMD_BUFFER_STATE* cb_state, const CMD_TYPE cmd, const char* caller_name) const; 1097 1098 bool ValidateDeviceMaskToPhysicalDeviceCount(uint32_t deviceMask, VkDebugReportObjectTypeEXT VUID_handle_type, 1099 uint64_t VUID_handle, const char* VUID) const; 1100 bool ValidateDeviceMaskToZero(uint32_t deviceMask, VkDebugReportObjectTypeEXT VUID_handle_type, uint64_t VUID_handle, 1101 const char* VUID) const; 1102 bool ValidateDeviceMaskToCommandBuffer(const CMD_BUFFER_STATE* pCB, uint32_t deviceMask, 1103 VkDebugReportObjectTypeEXT VUID_handle_type, uint64_t VUID_handle, 1104 const char* VUID) const; 1105 bool ValidateDeviceMaskToRenderPass(const CMD_BUFFER_STATE* pCB, uint32_t deviceMask, 1106 VkDebugReportObjectTypeEXT VUID_handle_type, uint64_t VUID_handle, const char* VUID); 1107 1108 bool ValidateBindAccelerationStructureMemoryNV(VkDevice device, const VkBindAccelerationStructureMemoryInfoNV& info) const; 1109 // Prototypes for CoreChecks accessor functions 1110 VkFormatProperties GetPDFormatProperties(const VkFormat format) const; 1111 VkResult GetPDImageFormatProperties(const VkImageCreateInfo*, VkImageFormatProperties*); 1112 VkResult GetPDImageFormatProperties2(const VkPhysicalDeviceImageFormatInfo2*, VkImageFormatProperties2*) const; 1113 const VkPhysicalDeviceMemoryProperties* GetPhysicalDeviceMemoryProperties(); 1114 1115 const GlobalQFOTransferBarrierMap<VkImageMemoryBarrier>& GetGlobalQFOReleaseBarrierMap( 1116 const QFOTransferBarrier<VkImageMemoryBarrier>::Tag& type_tag) const; 1117 const GlobalQFOTransferBarrierMap<VkBufferMemoryBarrier>& GetGlobalQFOReleaseBarrierMap( 1118 const QFOTransferBarrier<VkBufferMemoryBarrier>::Tag& type_tag) const; 1119 GlobalQFOTransferBarrierMap<VkImageMemoryBarrier>& GetGlobalQFOReleaseBarrierMap( 1120 const QFOTransferBarrier<VkImageMemoryBarrier>::Tag& type_tag); 1121 GlobalQFOTransferBarrierMap<VkBufferMemoryBarrier>& GetGlobalQFOReleaseBarrierMap( 1122 const QFOTransferBarrier<VkBufferMemoryBarrier>::Tag& type_tag); 1123 template <typename Barrier> 1124 void RecordQueuedQFOTransferBarriers(CMD_BUFFER_STATE* cb_state); 1125 template <typename Barrier> 1126 bool ValidateQueuedQFOTransferBarriers(const CMD_BUFFER_STATE* cb_state, QFOTransferCBScoreboards<Barrier>* scoreboards) const; 1127 bool ValidateQueuedQFOTransfers(const CMD_BUFFER_STATE* cb_state, 1128 QFOTransferCBScoreboards<VkImageMemoryBarrier>* qfo_image_scoreboards, 1129 QFOTransferCBScoreboards<VkBufferMemoryBarrier>* qfo_buffer_scoreboards) const; 1130 template <typename BarrierRecord, typename Scoreboard> 1131 bool ValidateAndUpdateQFOScoreboard(const debug_report_data* report_data, const CMD_BUFFER_STATE* cb_state, 1132 const char* operation, const BarrierRecord& barrier, Scoreboard* scoreboard) const; 1133 template <typename Barrier> 1134 void RecordQFOTransferBarriers(CMD_BUFFER_STATE* cb_state, uint32_t barrier_count, const Barrier* barriers); 1135 void RecordBarriersQFOTransfers(CMD_BUFFER_STATE* cb_state, uint32_t bufferBarrierCount, 1136 const VkBufferMemoryBarrier* pBufferMemBarriers, uint32_t imageMemBarrierCount, 1137 const VkImageMemoryBarrier* pImageMemBarriers); 1138 template <typename Barrier> 1139 bool ValidateQFOTransferBarrierUniqueness(const char* func_name, CMD_BUFFER_STATE* cb_state, uint32_t barrier_count, 1140 const Barrier* barriers); 1141 bool IsReleaseOp(CMD_BUFFER_STATE* cb_state, const VkImageMemoryBarrier& barrier) const; 1142 bool ValidateBarriersQFOTransferUniqueness(const char* func_name, CMD_BUFFER_STATE* cb_state, uint32_t bufferBarrierCount, 1143 const VkBufferMemoryBarrier* pBufferMemBarriers, uint32_t imageMemBarrierCount, 1144 const VkImageMemoryBarrier* pImageMemBarriers); 1145 bool ValidatePrimaryCommandBufferState(const CMD_BUFFER_STATE* pCB, int current_submit_count, 1146 QFOTransferCBScoreboards<VkImageMemoryBarrier>* qfo_image_scoreboards, 1147 QFOTransferCBScoreboards<VkBufferMemoryBarrier>* qfo_buffer_scoreboards) const; 1148 bool ValidatePipelineDrawtimeState(const LAST_BOUND_STATE& state, const CMD_BUFFER_STATE* pCB, CMD_TYPE cmd_type, 1149 const PIPELINE_STATE* pPipeline, const char* caller) const; 1150 bool ValidateCmdBufDrawState(const CMD_BUFFER_STATE* cb_node, CMD_TYPE cmd_type, const bool indexed, 1151 const VkPipelineBindPoint bind_point, const char* function, const char* pipe_err_code, 1152 const char* state_err_code) const; 1153 bool ValidateEventStageMask(VkQueue queue, CMD_BUFFER_STATE* pCB, uint32_t eventCount, size_t firstEventIndex, 1154 VkPipelineStageFlags sourceStageMask); 1155 bool ValidateQueueFamilyIndices(const CMD_BUFFER_STATE* pCB, VkQueue queue) const; 1156 VkResult CoreLayerCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, 1157 const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache); 1158 void CoreLayerDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, 1159 const VkAllocationCallbacks* pAllocator); 1160 VkResult CoreLayerMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, 1161 const VkValidationCacheEXT* pSrcCaches); 1162 VkResult CoreLayerGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, 1163 void* pData); 1164 // For given bindings validate state at time of draw is correct, returning false on error and writing error details into string* 1165 bool ValidateDrawState(const cvdescriptorset::DescriptorSet* descriptor_set, const std::map<uint32_t, descriptor_req>& bindings, 1166 const std::vector<uint32_t>& dynamic_offsets, const CMD_BUFFER_STATE* cb_node, const char* caller, 1167 std::string* error) const; 1168 // Validate contents of a CopyUpdate 1169 using DescriptorSet = cvdescriptorset::DescriptorSet; 1170 bool ValidateCopyUpdate(const VkCopyDescriptorSet* update, const DescriptorSet* dst_set, const DescriptorSet* src_set, 1171 const char* func_name, std::string* error_code, std::string* error_msg); 1172 bool VerifyCopyUpdateContents(const VkCopyDescriptorSet* update, const DescriptorSet* src_set, VkDescriptorType type, 1173 uint32_t index, const char* func_name, std::string* error_code, std::string* error_msg); 1174 // Validate contents of a WriteUpdate 1175 bool ValidateWriteUpdate(const DescriptorSet* descriptor_set, const VkWriteDescriptorSet* update, const char* func_name, 1176 std::string* error_code, std::string* error_msg); 1177 bool VerifyWriteUpdateContents(const DescriptorSet* dest_set, const VkWriteDescriptorSet* update, const uint32_t index, 1178 const char* func_name, std::string* error_code, std::string* error_msg); 1179 // Shared helper functions - These are useful because the shared sampler image descriptor type 1180 // performs common functions with both sampler and image descriptors so they can share their common functions 1181 bool ValidateImageUpdate(VkImageView, VkImageLayout, VkDescriptorType, const char* func_name, std::string*, std::string*); 1182 // Validate contents of a push descriptor update 1183 bool ValidatePushDescriptorsUpdate(const DescriptorSet* push_set, uint32_t write_count, const VkWriteDescriptorSet* p_wds, 1184 const char* func_name); 1185 // Descriptor Set Validation Functions 1186 bool ValidateSampler(VkSampler) const; 1187 bool ValidateBufferUpdate(VkDescriptorBufferInfo const* buffer_info, VkDescriptorType type, const char* func_name, 1188 std::string* error_code, std::string* error_msg); 1189 bool ValidateUpdateDescriptorSetsWithTemplateKHR(VkDescriptorSet descriptorSet, const TEMPLATE_STATE* template_state, 1190 const void* pData); 1191 void UpdateAllocateDescriptorSetsData(const VkDescriptorSetAllocateInfo*, cvdescriptorset::AllocateDescriptorSetsData*); 1192 bool ValidateAllocateDescriptorSets(const VkDescriptorSetAllocateInfo*, const cvdescriptorset::AllocateDescriptorSetsData*); 1193 bool ValidateUpdateDescriptorSets(uint32_t write_count, const VkWriteDescriptorSet* p_wds, uint32_t copy_count, 1194 const VkCopyDescriptorSet* p_cds, const char* func_name); 1195 1196 // Stuff from shader_validation 1197 bool ValidateGraphicsPipelineShaderState(const PIPELINE_STATE* pPipeline) const; 1198 bool ValidateComputePipeline(PIPELINE_STATE* pPipeline) const; 1199 bool ValidateRayTracingPipelineNV(PIPELINE_STATE* pipeline) const; 1200 bool PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, 1201 const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); 1202 void PreCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, 1203 const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, void* csm_state); 1204 bool ValidatePipelineShaderStage(VkPipelineShaderStageCreateInfo const* pStage, const PIPELINE_STATE* pipeline, 1205 const PIPELINE_STATE::StageState& stage_state, const SHADER_MODULE_STATE* module, 1206 const spirv_inst_iter& entrypoint, bool check_point_size) const; 1207 bool ValidatePointListShaderState(const PIPELINE_STATE* pipeline, SHADER_MODULE_STATE const* src, spirv_inst_iter entrypoint, 1208 VkShaderStageFlagBits stage) const; 1209 bool ValidateShaderCapabilities(SHADER_MODULE_STATE const* src, VkShaderStageFlagBits stage) const; 1210 bool ValidateShaderStageWritableDescriptor(VkShaderStageFlagBits stage, bool has_writable_descriptor) const; 1211 bool ValidateShaderStageInputOutputLimits(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage, 1212 const PIPELINE_STATE* pipeline, spirv_inst_iter entrypoint) const; 1213 bool ValidateShaderStageGroupNonUniform(SHADER_MODULE_STATE const* src, VkShaderStageFlagBits stage, 1214 std::unordered_set<uint32_t> const& accessible_ids) const; 1215 bool ValidateCooperativeMatrix(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage, 1216 const PIPELINE_STATE* pipeline) const; 1217 bool ValidateExecutionModes(SHADER_MODULE_STATE const* src, spirv_inst_iter entrypoint) const; 1218 1219 // Gpu Validation Functions 1220 void GpuPreCallRecordCreateDevice(VkPhysicalDevice gpu, safe_VkDeviceCreateInfo* modified_create_info, 1221 VkPhysicalDeviceFeatures* supported_features); 1222 void GpuPostCallRecordCreateDevice(const CHECK_ENABLED* enables, const VkDeviceCreateInfo* pCreateInfo); 1223 void GpuPreCallRecordDestroyDevice(); 1224 void GpuResetCommandBuffer(const VkCommandBuffer commandBuffer); 1225 bool GpuPreCallCreateShaderModule(const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 1226 VkShaderModule* pShaderModule, uint32_t* unique_shader_id, 1227 VkShaderModuleCreateInfo* instrumented_create_info, 1228 std::vector<unsigned int>* instrumented_pgm); 1229 bool GpuPreCallCreatePipelineLayout(const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 1230 VkPipelineLayout* pPipelineLayout, std::vector<VkDescriptorSetLayout>* new_layouts, 1231 VkPipelineLayoutCreateInfo* modified_create_info); 1232 void GpuPostCallCreatePipelineLayout(VkResult result); 1233 void GpuPreCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); 1234 void GpuPostCallQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); 1235 void GpuPreCallValidateCmdWaitEvents(VkPipelineStageFlags sourceStageMask); 1236 std::vector<safe_VkGraphicsPipelineCreateInfo> GpuPreCallRecordCreateGraphicsPipelines( 1237 VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, 1238 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, std::vector<std::unique_ptr<PIPELINE_STATE>>& pipe_state); 1239 void GpuPostCallRecordCreateGraphicsPipelines(const uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, 1240 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); 1241 void GpuPreCallRecordDestroyPipeline(const VkPipeline pipeline); 1242 void GpuAllocateValidationResources(const VkCommandBuffer cmd_buffer, VkPipelineBindPoint bind_point); 1243 void AnalyzeAndReportError(CMD_BUFFER_STATE* cb_node, VkQueue queue, VkPipelineBindPoint bind_point, uint32_t operation_index, 1244 uint32_t* const debug_output_buffer); 1245 void ProcessInstrumentationBuffer(VkQueue queue, CMD_BUFFER_STATE* cb_node); 1246 void UpdateInstrumentationBuffer(CMD_BUFFER_STATE* cb_node); 1247 void SubmitBarrier(VkQueue queue); 1248 bool GpuInstrumentShader(const VkShaderModuleCreateInfo* pCreateInfo, std::vector<unsigned int>& new_pgm, 1249 uint32_t* unique_shader_id); 1250 template <typename CreateInfo, typename SafeCreateInfo> 1251 void GpuPreCallRecordPipelineCreations(uint32_t count, const CreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, 1252 VkPipeline* pPipelines, std::vector<std::unique_ptr<PIPELINE_STATE>>& pipe_state, 1253 std::vector<SafeCreateInfo>* new_pipeline_create_infos, 1254 const VkPipelineBindPoint bind_point); 1255 template <typename CreateInfo> 1256 void GpuPostCallRecordPipelineCreations(const uint32_t count, const CreateInfo* pCreateInfos, 1257 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 1258 const VkPipelineBindPoint bind_point); 1259 std::vector<safe_VkComputePipelineCreateInfo> GpuPreCallRecordCreateComputePipelines( 1260 VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, 1261 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, std::vector<std::unique_ptr<PIPELINE_STATE>>& pipe_state); 1262 void GpuPostCallRecordCreateComputePipelines(const uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, 1263 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); 1264 std::vector<safe_VkRayTracingPipelineCreateInfoNV> GpuPreCallRecordCreateRayTracingPipelinesNV( 1265 VkPipelineCache pipelineCache, uint32_t count, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 1266 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, std::vector<std::unique_ptr<PIPELINE_STATE>>& pipe_state); 1267 void GpuPostCallRecordCreateRayTracingPipelinesNV(const uint32_t count, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 1268 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); 1269 VkResult GpuInitializeVma(); 1270 void ReportSetupProblem(VkDebugReportObjectTypeEXT object_type, uint64_t object_handle, const char* const specific_message); 1271 1272 // Buffer Validation Functions 1273 template <class OBJECT, class LAYOUT> 1274 void SetLayout(OBJECT* pObject, VkImage image, VkImageSubresource range, const LAYOUT& layout); 1275 template <class OBJECT, class LAYOUT> 1276 void SetLayout(OBJECT* pObject, ImageSubresourcePair imgpair, const LAYOUT& layout, VkImageAspectFlags aspectMask); 1277 // Remove the pending QFO release records from the global set 1278 // Note that the type of the handle argument constrained to match Barrier type 1279 // The defaulted BarrierRecord argument allows use to declare the type once, but is not intended to be specified by the caller 1280 template <typename Barrier, typename BarrierRecord = QFOTransferBarrier<Barrier>> 1281 void EraseQFOReleaseBarriers(const typename BarrierRecord::HandleType& handle) { 1282 GlobalQFOTransferBarrierMap<Barrier>& global_release_barriers = 1283 GetGlobalQFOReleaseBarrierMap(typename BarrierRecord::Tag()); 1284 global_release_barriers.erase(handle); 1285 } 1286 bool ValidateCopyImageTransferGranularityRequirements(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* src_img, 1287 const IMAGE_STATE* dst_img, const VkImageCopy* region, const uint32_t i, 1288 const char* function) const; 1289 bool ValidateIdleBuffer(VkBuffer buffer); 1290 bool ValidateUsageFlags(VkFlags actual, VkFlags desired, VkBool32 strict, const VulkanTypedHandle& typed_handle, 1291 const char* msgCode, char const* func_name, char const* usage_str) const; 1292 bool ValidateImageSubresourceRange(const uint32_t image_mip_count, const uint32_t image_layer_count, 1293 const VkImageSubresourceRange& subresourceRange, const char* cmd_name, 1294 const char* param_name, const char* image_layer_count_var_name, const uint64_t image_handle, 1295 SubresourceRangeErrorCodes errorCodes) const; 1296 void SetImageLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state, 1297 const VkImageSubresourceRange& image_subresource_range, VkImageLayout layout, 1298 VkImageLayout expected_layout = kInvalidLayout); 1299 void SetImageLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state, 1300 const VkImageSubresourceLayers& image_subresource_layers, VkImageLayout layout); 1301 bool ValidateRenderPassLayoutAgainstFramebufferImageUsage(RenderPassCreateVersion rp_version, VkImageLayout layout, 1302 VkImage image, VkImageView image_view, VkFramebuffer framebuffer, 1303 VkRenderPass renderpass, uint32_t attachment_index, 1304 const char* variable_name) const; 1305 bool ValidateBufferImageCopyData(uint32_t regionCount, const VkBufferImageCopy* pRegions, IMAGE_STATE* image_state, 1306 const char* function); 1307 bool ValidateBufferViewRange(const BUFFER_STATE* buffer_state, const VkBufferViewCreateInfo* pCreateInfo, 1308 const VkPhysicalDeviceLimits* device_limits); 1309 bool ValidateBufferViewBuffer(const BUFFER_STATE* buffer_state, const VkBufferViewCreateInfo* pCreateInfo); 1310 1311 bool PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 1312 VkImage* pImage); 1313 1314 void PostCallRecordCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 1315 VkImage* pImage, VkResult result); 1316 1317 void PreCallRecordDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); 1318 1319 bool PreCallValidateDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); 1320 1321 bool ValidateImageAttributes(const IMAGE_STATE* image_state, const VkImageSubresourceRange& range) const; 1322 1323 bool ValidateClearAttachmentExtent(VkCommandBuffer command_buffer, uint32_t attachment_index, 1324 const FRAMEBUFFER_STATE* framebuffer, uint32_t fb_attachment, const VkRect2D& render_area, 1325 uint32_t rect_count, const VkClearRect* clear_rects) const; 1326 bool ValidateImageCopyData(const uint32_t regionCount, const VkImageCopy* ic_regions, const IMAGE_STATE* src_state, 1327 const IMAGE_STATE* dst_state) const; 1328 1329 bool VerifyClearImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, 1330 const VkImageSubresourceRange& range, VkImageLayout dest_image_layout, const char* func_name) const; 1331 1332 bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, const VkImageSubresourceRange& range, 1333 VkImageAspectFlags view_aspect, VkImageLayout explicit_layout, VkImageLayout optimal_layout, 1334 const char* caller, const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code, 1335 bool* error) const; 1336 1337 bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, const VkImageSubresourceRange& range, 1338 VkImageLayout explicit_layout, VkImageLayout optimal_layout, const char* caller, 1339 const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code, bool* error) const { 1340 return VerifyImageLayout(cb_node, image_state, range, 0, explicit_layout, optimal_layout, caller, layout_invalid_msg_code, 1341 layout_mismatch_msg_code, error); 1342 } 1343 1344 bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, 1345 const VkImageSubresourceLayers& subLayers, VkImageLayout explicit_layout, VkImageLayout optimal_layout, 1346 const char* caller, const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code, 1347 bool* error) const; 1348 1349 bool CheckItgExtent(const CMD_BUFFER_STATE* cb_node, const VkExtent3D* extent, const VkOffset3D* offset, 1350 const VkExtent3D* granularity, const VkExtent3D* subresource_extent, const VkImageType image_type, 1351 const uint32_t i, const char* function, const char* member, const char* vuid) const; 1352 1353 bool CheckItgOffset(const CMD_BUFFER_STATE* cb_node, const VkOffset3D* offset, const VkExtent3D* granularity, const uint32_t i, 1354 const char* function, const char* member, const char* vuid) const; 1355 VkExtent3D GetScaledItg(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img) const; 1356 bool CopyImageMultiplaneValidation(VkCommandBuffer command_buffer, const IMAGE_STATE* src_image_state, 1357 const IMAGE_STATE* dst_image_state, const VkImageCopy region) const; 1358 1359 bool PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 1360 const VkClearColorValue* pColor, uint32_t rangeCount, 1361 const VkImageSubresourceRange* pRanges); 1362 1363 void PreCallRecordCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 1364 const VkClearColorValue* pColor, uint32_t rangeCount, 1365 const VkImageSubresourceRange* pRanges); 1366 1367 bool PreCallValidateCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 1368 const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, 1369 const VkImageSubresourceRange* pRanges); 1370 1371 void PreCallRecordCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 1372 const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, 1373 const VkImageSubresourceRange* pRanges); 1374 1375 bool FindLayoutVerifyLayout(ImageSubresourcePair imgpair, VkImageLayout& layout, const VkImageAspectFlags aspectMask); 1376 1377 bool FindGlobalLayout(ImageSubresourcePair imgpair, VkImageLayout& layout); 1378 1379 bool FindLayouts(VkImage image, std::vector<VkImageLayout>& layouts); 1380 1381 bool FindLayout(const ImageSubresPairLayoutMap& imageLayoutMap, ImageSubresourcePair imgpair, VkImageLayout& layout) const; 1382 1383 static bool FindLayout(const ImageSubresPairLayoutMap& imageLayoutMap, ImageSubresourcePair imgpair, VkImageLayout& layout, 1384 const VkImageAspectFlags aspectMask); 1385 1386 void SetGlobalLayout(ImageSubresourcePair imgpair, const VkImageLayout& layout); 1387 1388 void SetImageViewLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_VIEW_STATE& view_state, VkImageLayout layout); 1389 void SetImageViewInitialLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_VIEW_STATE& view_state, VkImageLayout layout); 1390 1391 void SetImageInitialLayout(CMD_BUFFER_STATE* cb_node, VkImage image, const VkImageSubresourceRange& range, 1392 VkImageLayout layout); 1393 void SetImageInitialLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state, const VkImageSubresourceRange& range, 1394 VkImageLayout layout); 1395 void SetImageInitialLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state, const VkImageSubresourceLayers& layers, 1396 VkImageLayout layout); 1397 1398 bool VerifyFramebufferAndRenderPassLayouts(RenderPassCreateVersion rp_version, const CMD_BUFFER_STATE* pCB, 1399 const VkRenderPassBeginInfo* pRenderPassBegin, 1400 const FRAMEBUFFER_STATE* framebuffer_state) const; 1401 void RecordCmdBeginRenderPassLayouts(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1402 const VkSubpassContents contents); 1403 void TransitionAttachmentRefLayout(CMD_BUFFER_STATE* pCB, FRAMEBUFFER_STATE* pFramebuffer, 1404 const safe_VkAttachmentReference2KHR& ref); 1405 1406 void TransitionSubpassLayouts(CMD_BUFFER_STATE*, const RENDER_PASS_STATE*, const int, FRAMEBUFFER_STATE*); 1407 1408 void TransitionBeginRenderPassLayouts(CMD_BUFFER_STATE*, const RENDER_PASS_STATE*, FRAMEBUFFER_STATE*); 1409 1410 bool ValidateBarrierLayoutToImageUsage(const VkImageMemoryBarrier& img_barrier, bool new_not_old, VkImageUsageFlags usage, 1411 const char* func_name, const char* barrier_pname); 1412 1413 bool ValidateBarriersToImages(CMD_BUFFER_STATE const* cb_state, uint32_t imageMemoryBarrierCount, 1414 const VkImageMemoryBarrier* pImageMemoryBarriers, const char* func_name); 1415 1416 void RecordQueuedQFOTransfers(CMD_BUFFER_STATE* pCB); 1417 void EraseQFOImageRelaseBarriers(const VkImage& image); 1418 1419 void TransitionImageLayouts(CMD_BUFFER_STATE* cb_state, uint32_t memBarrierCount, const VkImageMemoryBarrier* pImgMemBarriers); 1420 1421 void TransitionFinalSubpassLayouts(CMD_BUFFER_STATE* pCB, const VkRenderPassBeginInfo* pRenderPassBegin, 1422 FRAMEBUFFER_STATE* framebuffer_state); 1423 1424 bool PreCallValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 1425 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, 1426 const VkImageCopy* pRegions); 1427 1428 bool PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, 1429 const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); 1430 void PreCallRecordCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, 1431 const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); 1432 1433 bool PreCallValidateCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 1434 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, 1435 const VkImageResolve* pRegions); 1436 1437 bool PreCallValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 1438 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, 1439 const VkImageBlit* pRegions, VkFilter filter); 1440 1441 void PreCallRecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 1442 VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, 1443 VkFilter filter); 1444 1445 bool ValidateCmdBufImageLayouts(const CMD_BUFFER_STATE* pCB, const ImageSubresPairLayoutMap& globalImageLayoutMap, 1446 ImageSubresPairLayoutMap* overlayLayoutMap_arg) const; 1447 1448 void UpdateCmdBufImageLayouts(CMD_BUFFER_STATE* pCB); 1449 1450 bool VerifyBoundMemoryIsValid(VkDeviceMemory mem, const VulkanTypedHandle& typed_handle, const char* api_name, 1451 const char* error_code) const; 1452 1453 bool ValidateLayoutVsAttachmentDescription(const debug_report_data* report_data, RenderPassCreateVersion rp_version, 1454 const VkImageLayout first_layout, const uint32_t attachment, 1455 const VkAttachmentDescription2KHR& attachment_description) const; 1456 1457 bool ValidateLayouts(RenderPassCreateVersion rp_version, VkDevice device, const VkRenderPassCreateInfo2KHR* pCreateInfo) const; 1458 1459 bool ValidateImageUsageFlags(IMAGE_STATE const* image_state, VkFlags desired, bool strict, const char* msgCode, 1460 char const* func_name, char const* usage_string) const; 1461 1462 bool ValidateImageFormatFeatureFlags(IMAGE_STATE const* image_state, VkFormatFeatureFlags desired, char const* func_name, 1463 const char* linear_vuid, const char* optimal_vuid) const; 1464 1465 bool ValidateImageSubresourceLayers(const CMD_BUFFER_STATE* cb_node, const VkImageSubresourceLayers* subresource_layers, 1466 char const* func_name, char const* member, uint32_t i) const; 1467 1468 bool ValidateBufferUsageFlags(BUFFER_STATE const* buffer_state, VkFlags desired, bool strict, const char* msgCode, 1469 char const* func_name, char const* usage_string) const; 1470 1471 bool PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, 1472 const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); 1473 1474 bool PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, 1475 const VkAllocationCallbacks* pAllocator, VkBufferView* pView); 1476 1477 bool ValidateImageAspectMask(VkImage image, VkFormat format, VkImageAspectFlags aspect_mask, const char* func_name, 1478 const char* vuid = "VUID-VkImageSubresource-aspectMask-parameter") const; 1479 1480 bool ValidateCreateImageViewSubresourceRange(const IMAGE_STATE* image_state, bool is_imageview_2d_type, 1481 const VkImageSubresourceRange& subresourceRange); 1482 1483 bool ValidateCmdClearColorSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange, 1484 const char* param_name) const; 1485 1486 bool ValidateCmdClearDepthSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange, 1487 const char* param_name) const; 1488 1489 bool ValidateImageBarrierSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange, 1490 const char* cmd_name, const char* param_name); 1491 1492 bool PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, 1493 const VkAllocationCallbacks* pAllocator, VkImageView* pView); 1494 1495 bool ValidateCopyBufferImageTransferGranularityRequirements(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, 1496 const VkBufferImageCopy* region, const uint32_t i, 1497 const char* function, const char* vuid) const; 1498 1499 bool ValidateImageMipLevel(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, uint32_t mip_level, const uint32_t i, 1500 const char* function, const char* member, const char* vuid) const; 1501 1502 bool ValidateImageArrayLayerRange(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, const uint32_t base_layer, 1503 const uint32_t layer_count, const uint32_t i, const char* function, const char* member, 1504 const char* vuid) const; 1505 1506 void PreCallRecordCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 1507 VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); 1508 1509 bool PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, 1510 const VkBufferCopy* pRegions); 1511 bool PreCallValidateDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); 1512 1513 bool PreCallValidateDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); 1514 1515 void PreCallRecordDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); 1516 1517 bool PreCallValidateDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); 1518 1519 bool PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, 1520 uint32_t data); 1521 1522 bool PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 1523 VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); 1524 1525 void PreCallRecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 1526 VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); 1527 1528 bool PreCallValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, 1529 VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); 1530 1531 void PreCallRecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, 1532 VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); 1533 1534 bool PreCallValidateGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, 1535 VkSubresourceLayout* pLayout); 1536 bool ValidateCreateImageANDROID(const debug_report_data* report_data, const VkImageCreateInfo* create_info); 1537 bool ValidateCreateImageViewANDROID(const VkImageViewCreateInfo* create_info); 1538 bool ValidateGetImageSubresourceLayoutANDROID(const VkImage image) const; 1539 bool ValidateQueueFamilies(uint32_t queue_family_count, const uint32_t* queue_families, const char* cmd_name, 1540 const char* array_parameter_name, const char* unique_error_code, const char* valid_error_code, 1541 bool optional) const; 1542 bool ValidateAllocateMemoryANDROID(const VkMemoryAllocateInfo* alloc_info) const; 1543 bool ValidateGetImageMemoryRequirements2ANDROID(const VkImage image) const; 1544 bool ValidateCreateSamplerYcbcrConversionANDROID(const VkSamplerYcbcrConversionCreateInfo* create_info) const; 1545 bool PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1546 const VkGraphicsPipelineCreateInfo* pCreateInfos, 1547 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* cgpl_state); 1548 void PreCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1549 const VkGraphicsPipelineCreateInfo* pCreateInfos, 1550 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* cgpl_state); 1551 void PostCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1552 const VkGraphicsPipelineCreateInfo* pCreateInfos, 1553 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, 1554 void* cgpl_state); 1555 bool PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1556 const VkComputePipelineCreateInfo* pCreateInfos, 1557 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* pipe_state); 1558 void PreCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1559 const VkComputePipelineCreateInfo* pCreateInfos, 1560 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 1561 void* ccpl_state_data); 1562 void PostCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1563 const VkComputePipelineCreateInfo* pCreateInfos, 1564 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, 1565 void* pipe_state); 1566 bool PreCallValidateGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, 1567 uint32_t* pExecutableCount, 1568 VkPipelineExecutablePropertiesKHR* pProperties); 1569 bool ValidatePipelineExecutableInfo(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo) const; 1570 bool PreCallValidateGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, 1571 uint32_t* pStatisticCount, 1572 VkPipelineExecutableStatisticKHR* pStatistics); 1573 bool PreCallValidateGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, 1574 const VkPipelineExecutableInfoKHR* pExecutableInfo, 1575 uint32_t* pInternalRepresentationCount, 1576 VkPipelineExecutableInternalRepresentationKHR* pStatistics); 1577 bool PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, 1578 const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); 1579 void PreCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, 1580 const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout, 1581 void* cpl_state); 1582 void PostCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, 1583 const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout, 1584 VkResult result); 1585 bool PreCallValidateAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, 1586 VkDescriptorSet* pDescriptorSets, void* ads_state); 1587 bool PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1588 const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 1589 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 1590 void* pipe_state); 1591 void PreCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1592 const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 1593 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 1594 void* crtpl_state_data); 1595 void PostCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 1596 const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 1597 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, 1598 void* crtpl_state_data); 1599 void PreCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, 1600 VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, 1601 VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, 1602 VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, 1603 VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, 1604 VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, 1605 uint32_t width, uint32_t height, uint32_t depth); 1606 void PostCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, 1607 VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, 1608 VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, 1609 VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, 1610 VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, 1611 VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, 1612 uint32_t width, uint32_t height, uint32_t depth); 1613 void PostCallRecordCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 1614 VkInstance* pInstance, VkResult result); 1615 bool PreCallValidateCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, 1616 const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); 1617 void PreCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, 1618 const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, 1619 safe_VkDeviceCreateInfo* modified_create_info); 1620 void PostCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, 1621 const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, VkResult result); 1622 bool PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, 1623 VkDeviceSize dataSize, const void* pData); 1624 bool PreCallValidateGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); 1625 bool PreCallValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, 1626 const VkAllocationCallbacks* pAllocator, 1627 VkSamplerYcbcrConversion* pYcbcrConversion); 1628 bool PreCallValidateCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, 1629 const VkAllocationCallbacks* pAllocator, 1630 VkSamplerYcbcrConversion* pYcbcrConversion); 1631 bool PreCallValidateCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); 1632 void PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator); 1633 bool PreCallValidateQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); 1634 void PreCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); 1635 void PostCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence, 1636 VkResult result); 1637 bool PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, 1638 const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); 1639 bool PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks* pAllocator); 1640 bool PreCallValidateWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, 1641 uint64_t timeout); 1642 void PostCallRecordWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, 1643 uint64_t timeout, VkResult result); 1644 void PostCallRecordGetFenceStatus(VkDevice device, VkFence fence, VkResult result); 1645 bool PreCallValidateQueueWaitIdle(VkQueue queue); 1646 void PostCallRecordQueueWaitIdle(VkQueue queue, VkResult result); 1647 bool PreCallValidateDeviceWaitIdle(VkDevice device); 1648 void PostCallRecordDeviceWaitIdle(VkDevice device, VkResult result); 1649 bool PreCallValidateDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); 1650 bool PreCallValidateDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); 1651 bool PreCallValidateDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator); 1652 bool PreCallValidateDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); 1653 bool ValidateGetQueryPoolResultsFlags(VkQueryPool queryPool, VkQueryResultFlags flags) const; 1654 bool ValidateGetQueryPoolResultsQueries(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const; 1655 bool PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, 1656 size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); 1657 bool PreCallValidateBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR* pBindInfos); 1658 bool PreCallValidateBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR* pBindInfos); 1659 bool PreCallValidateBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset); 1660 bool PreCallValidateGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, 1661 VkMemoryRequirements2* pMemoryRequirements); 1662 bool PreCallValidateGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, 1663 VkMemoryRequirements2* pMemoryRequirements); 1664 bool PreCallValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, 1665 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, 1666 VkImageFormatProperties2* pImageFormatProperties); 1667 bool PreCallValidateGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, 1668 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, 1669 VkImageFormatProperties2* pImageFormatProperties); 1670 bool PreCallValidateDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); 1671 void PreCallRecordDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); 1672 bool PreCallValidateDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); 1673 bool PreCallValidateDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, 1674 const VkAllocationCallbacks* pAllocator); 1675 bool PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, 1676 const VkCommandBuffer* pCommandBuffers); 1677 bool PreCallValidateCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, 1678 const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); 1679 bool PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, 1680 const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); 1681 bool PreCallValidateDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); 1682 bool PreCallValidateResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); 1683 bool PreCallValidateResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences); 1684 void PostCallRecordResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkResult result); 1685 bool PreCallValidateDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator); 1686 bool PreCallValidateDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); 1687 bool PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, 1688 const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); 1689 bool PreCallValidateResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); 1690 bool PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, 1691 const VkDescriptorSet* pDescriptorSets); 1692 bool PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, 1693 const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, 1694 const VkCopyDescriptorSet* pDescriptorCopies); 1695 bool PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); 1696 bool PreCallValidateEndCommandBuffer(VkCommandBuffer commandBuffer); 1697 bool PreCallValidateResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); 1698 bool PreCallValidateCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); 1699 bool PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, 1700 const VkViewport* pViewports); 1701 bool PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, 1702 const VkRect2D* pScissors); 1703 bool PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, 1704 uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors); 1705 bool PreCallValidateCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); 1706 bool PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, 1707 uint32_t viewportCount, 1708 const VkShadingRatePaletteNV* pShadingRatePalettes); 1709 bool ValidateGeometryTrianglesNV(const VkGeometryTrianglesNV& triangles, VkDebugReportObjectTypeEXT object_type, 1710 uint64_t object_handle, const char* func_name) const; 1711 bool ValidateGeometryAABBNV(const VkGeometryAABBNV& geometry, VkDebugReportObjectTypeEXT object_type, uint64_t object_handle, 1712 const char* func_name) const; 1713 bool ValidateGeometryNV(const VkGeometryNV& geometry, VkDebugReportObjectTypeEXT object_type, uint64_t object_handle, 1714 const char* func_name) const; 1715 bool PreCallValidateCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, 1716 const VkAllocationCallbacks* pAllocator, 1717 VkAccelerationStructureNV* pAccelerationStructure); 1718 bool PreCallValidateBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, 1719 const VkBindAccelerationStructureMemoryInfoNV* pBindInfos); 1720 bool PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, 1721 size_t dataSize, void* pData); 1722 bool PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, 1723 VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, 1724 VkAccelerationStructureNV dst, VkAccelerationStructureNV src, 1725 VkBuffer scratch, VkDeviceSize scratchOffset); 1726 bool PreCallValidateCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, 1727 VkAccelerationStructureNV src, VkCopyAccelerationStructureModeNV mode); 1728 bool PreCallValidateDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, 1729 const VkAllocationCallbacks* pAllocator); 1730 bool PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth); 1731 bool PreCallValidateCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, 1732 uint16_t lineStipplePattern); 1733 bool PreCallValidateCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, 1734 float depthBiasSlopeFactor); 1735 bool PreCallValidateCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]); 1736 bool PreCallValidateCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); 1737 bool PreCallValidateCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); 1738 bool PreCallValidateCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); 1739 bool PreCallValidateCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); 1740 bool PreCallValidateCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, 1741 VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, 1742 const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, 1743 const uint32_t* pDynamicOffsets); 1744 bool PreCallValidateCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, 1745 VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, 1746 const VkWriteDescriptorSet* pDescriptorWrites); 1747 void PreCallRecordCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, 1748 VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, 1749 const VkWriteDescriptorSet* pDescriptorWrites); 1750 bool PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1751 VkIndexType indexType); 1752 bool PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, 1753 const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); 1754 bool PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, 1755 uint32_t firstInstance); 1756 void PreCallRecordCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, 1757 uint32_t firstInstance); 1758 bool PreCallValidateCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, 1759 uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); 1760 void PreCallRecordCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, 1761 uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); 1762 bool PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, 1763 uint32_t stride); 1764 void PreCallRecordCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, 1765 uint32_t stride); 1766 bool PreCallValidateCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1767 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1768 uint32_t stride); 1769 bool PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z); 1770 void PreCallRecordCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z); 1771 bool PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); 1772 void PreCallRecordCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); 1773 bool PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, 1774 uint32_t stride); 1775 void PreCallRecordCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, 1776 uint32_t stride); 1777 bool PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); 1778 void PreCallRecordCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); 1779 bool PreCallValidateCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); 1780 void PreCallRecordCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); 1781 bool PreCallValidateCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1782 VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, 1783 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1784 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1785 uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); 1786 void PreCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1787 VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, 1788 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1789 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1790 uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); 1791 void PostCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1792 VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, 1793 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1794 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1795 uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); 1796 bool PreCallValidateCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, 1797 VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, 1798 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1799 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1800 uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); 1801 void PreCallRecordCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, 1802 VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, 1803 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1804 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1805 uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); 1806 1807 void EnqueueVerifyBeginQuery(VkCommandBuffer, const QueryObject& query_obj); 1808 bool PreCallValidateCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags); 1809 void PreCallRecordCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags); 1810 bool PreCallValidateCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot); 1811 bool PreCallValidateCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 1812 uint32_t queryCount); 1813 bool PreCallValidateCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 1814 uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, 1815 VkDeviceSize stride, VkQueryResultFlags flags); 1816 void PreCallRecordCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 1817 uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, 1818 VkQueryResultFlags flags); 1819 bool PreCallValidateCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, 1820 uint32_t offset, uint32_t size, const void* pValues); 1821 bool PreCallValidateCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, 1822 VkQueryPool queryPool, uint32_t slot); 1823 void PostCallRecordCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, 1824 VkQueryPool queryPool, uint32_t slot); 1825 bool PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, 1826 const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer); 1827 bool PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, 1828 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); 1829 bool PreCallValidateGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory mem, VkDeviceSize* pCommittedMem); 1830 bool PreCallValidateCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR* pCreateInfo, 1831 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); 1832 bool PreCallValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1833 VkSubpassContents contents); 1834 void PreCallRecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1835 VkSubpassContents contents); 1836 bool PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1837 const VkSubpassBeginInfoKHR* pSubpassBeginInfo); 1838 void PreCallRecordCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1839 const VkSubpassBeginInfoKHR* pSubpassBeginInfo); 1840 bool PreCallValidateCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); 1841 void PostCallRecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); 1842 bool PreCallValidateCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo, 1843 const VkSubpassEndInfoKHR* pSubpassEndInfo); 1844 void PostCallRecordCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo, 1845 const VkSubpassEndInfoKHR* pSubpassEndInfo); 1846 bool PreCallValidateCmdEndRenderPass(VkCommandBuffer commandBuffer); 1847 void PostCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer); 1848 bool PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo); 1849 void PostCallRecordCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo); 1850 bool PreCallValidateCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, 1851 const VkCommandBuffer* pCommandBuffers); 1852 bool PreCallValidateMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, 1853 void** ppData); 1854 void PostCallRecordMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, 1855 void** ppData, VkResult result); 1856 bool PreCallValidateUnmapMemory(VkDevice device, VkDeviceMemory mem); 1857 void PreCallRecordUnmapMemory(VkDevice device, VkDeviceMemory mem); 1858 bool PreCallValidateFlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges); 1859 bool PreCallValidateInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, 1860 const VkMappedMemoryRange* pMemRanges); 1861 void PostCallRecordInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges, 1862 VkResult result); 1863 bool PreCallValidateBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memoryOffset); 1864 bool PreCallValidateBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos); 1865 bool PreCallValidateBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos); 1866 bool PreCallValidateSetEvent(VkDevice device, VkEvent event); 1867 void PreCallRecordSetEvent(VkDevice device, VkEvent event); 1868 bool PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence); 1869 void PostCallRecordQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence, 1870 VkResult result); 1871 bool PreCallValidateImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); 1872 void PostCallRecordImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo, 1873 VkResult result); 1874 #ifdef VK_USE_PLATFORM_WIN32_KHR 1875 void PostCallRecordImportSemaphoreWin32HandleKHR(VkDevice device, 1876 const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo, 1877 VkResult result); 1878 bool PreCallValidateImportSemaphoreWin32HandleKHR(VkDevice device, 1879 const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); 1880 bool PreCallValidateImportFenceWin32HandleKHR(VkDevice device, 1881 const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); 1882 void PostCallRecordImportFenceWin32HandleKHR(VkDevice device, 1883 const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo, 1884 VkResult result); 1885 void PostCallRecordGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, 1886 HANDLE* pHandle, VkResult result); 1887 void PostCallRecordGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, 1888 HANDLE* pHandle, VkResult result); 1889 #endif // VK_USE_PLATFORM_WIN32_KHR 1890 bool PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo); 1891 void PostCallRecordImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo, VkResult result); 1892 1893 void PostCallRecordGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd, VkResult result); 1894 void PostCallRecordGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd, VkResult result); 1895 bool PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, 1896 const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); 1897 void PreCallRecordDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); 1898 bool PreCallValidateGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, 1899 VkImage* pSwapchainImages); 1900 void PostCallRecordGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, 1901 VkImage* pSwapchainImages, VkResult result); 1902 bool PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo); 1903 void PostCallRecordQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo, VkResult result); 1904 bool PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, 1905 const VkSwapchainCreateInfoKHR* pCreateInfos, 1906 const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains); 1907 bool PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, 1908 VkFence fence, uint32_t* pImageIndex); 1909 bool PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex); 1910 bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, 1911 VkQueueFamilyProperties* pQueueFamilyProperties); 1912 bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, 1913 uint32_t* pQueueFamilyPropertyCount, 1914 VkQueueFamilyProperties2KHR* pQueueFamilyProperties); 1915 bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, 1916 uint32_t* pQueueFamilyPropertyCount, 1917 VkQueueFamilyProperties2KHR* pQueueFamilyProperties); 1918 bool PreCallValidateDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); 1919 bool PreCallValidateGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 1920 VkSurfaceKHR surface, VkBool32* pSupported); 1921 bool PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 1922 uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); 1923 bool PreCallValidateCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, 1924 const VkAllocationCallbacks* pAllocator, 1925 VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); 1926 bool PreCallValidateCreateDescriptorUpdateTemplateKHR(VkDevice device, 1927 const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, 1928 const VkAllocationCallbacks* pAllocator, 1929 VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); 1930 bool PreCallValidateUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, 1931 VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); 1932 bool PreCallValidateUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, 1933 VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, 1934 const void* pData); 1935 1936 bool PreCallValidateCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, 1937 VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, 1938 VkPipelineLayout layout, uint32_t set, const void* pData); 1939 void PreCallRecordCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, 1940 VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, 1941 VkPipelineLayout layout, uint32_t set, const void* pData); 1942 bool PreCallValidateGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, 1943 uint32_t* pDisplayCount, VkDisplayKHR* pDisplays); 1944 bool PreCallValidateGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, 1945 VkDisplayPlaneCapabilitiesKHR* pCapabilities); 1946 bool PreCallValidateGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice, 1947 const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, 1948 VkDisplayPlaneCapabilities2KHR* pCapabilities); 1949 bool PreCallValidateCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer); 1950 1951 bool PreCallValidateCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, 1952 VkQueryControlFlags flags, uint32_t index); 1953 void PreCallRecordCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, 1954 VkQueryControlFlags flags, uint32_t index); 1955 bool PreCallValidateCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index); 1956 1957 bool PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, 1958 uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); 1959 bool PreCallValidateCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, 1960 const VkSampleLocationsInfoEXT* pSampleLocationsInfo); 1961 bool PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1962 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1963 uint32_t stride); 1964 bool PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); 1965 bool PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1966 uint32_t drawCount, uint32_t stride); 1967 bool PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1968 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1969 uint32_t stride); 1970 void PreCallRecordGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, 1971 VkPhysicalDeviceProperties* pPhysicalDeviceProperties); 1972 bool PreCallValidateGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfoEXT* pInfo); 1973 bool PreCallValidateCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask); 1974 bool ValidateComputeWorkGroupSizes(const SHADER_MODULE_STATE* shader) const; 1975 1976 bool ValidateQueryRange(VkDevice device, VkQueryPool queryPool, uint32_t totalCount, uint32_t firstQuery, uint32_t queryCount, 1977 const char* vuid_badfirst, const char* vuid_badrange) const; 1978 bool PreCallValidateResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); 1979 1980 bool ValidateComputeWorkGroupInvocations(CMD_BUFFER_STATE* cb_state, uint32_t groupCountX, uint32_t groupCountY, 1981 uint32_t groupCountZ); 1982 bool ValidateQueryPoolStride(const std::string& vuid_not_64, const std::string& vuid_64, const VkDeviceSize stride, 1983 const char* parameter_name, const uint64_t parameter_value, const VkQueryResultFlags flags) const; 1984 bool ValidateCmdDrawStrideWithStruct(VkCommandBuffer commandBuffer, const std::string& vuid, const uint32_t stride, 1985 const char* struct_name, const uint32_t struct_size) const; 1986 bool ValidateCmdDrawStrideWithBuffer(VkCommandBuffer commandBuffer, const std::string& vuid, const uint32_t stride, 1987 const char* struct_name, const uint32_t struct_size, const uint32_t drawCount, 1988 const VkDeviceSize offset, const BUFFER_STATE* buffer_state) const; 1989 1990 #ifdef VK_USE_PLATFORM_ANDROID_KHR 1991 bool PreCallValidateGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, const struct AHardwareBuffer* buffer, 1992 VkAndroidHardwareBufferPropertiesANDROID* pProperties); 1993 void PostCallRecordGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, const struct AHardwareBuffer* buffer, 1994 VkAndroidHardwareBufferPropertiesANDROID* pProperties, 1995 VkResult result); 1996 bool PreCallValidateGetMemoryAndroidHardwareBufferANDROID(VkDevice device, 1997 const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, 1998 struct AHardwareBuffer** pBuffer); 1999 #endif // VK_USE_PLATFORM_ANDROID_KHR 2000 #ifdef VK_USE_PLATFORM_WAYLAND_KHR 2001 bool PreCallValidateGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 2002 struct wl_display* display); 2003 #endif // VK_USE_PLATFORM_WAYLAND_KHR 2004 #ifdef VK_USE_PLATFORM_WIN32_KHR 2005 bool PreCallValidateGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); 2006 #endif // VK_USE_PLATFORM_WIN32_KHR 2007 #ifdef VK_USE_PLATFORM_XCB_KHR 2008 bool PreCallValidateGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 2009 xcb_connection_t* connection, xcb_visualid_t visual_id); 2010 #endif // VK_USE_PLATFORM_XCB_KHR 2011 #ifdef VK_USE_PLATFORM_XLIB_KHR 2012 bool PreCallValidateGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 2013 Display* dpy, VisualID visualID); 2014 #endif // VK_USE_PLATFORM_XLIB_KHR 2015 2016 }; // Class CoreChecks 2017