1 /* Copyright (c) 2015-2020 The Khronos Group Inc.
2  * Copyright (c) 2015-2020 Valve Corporation
3  * Copyright (c) 2015-2020 LunarG, Inc.
4  * Copyright (C) 2015-2020 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  * Author: Jeremy Kniager <jeremyk@lunarg.com>
24  */
25 
26 #pragma once
27 
28 #include "state_tracker.h"
29 #include "image_layout_map.h"
30 #include "gpu_validation.h"
31 #include "shader_validation.h"
32 
33 // Set of VUID that need to go between core_validation.cpp and drawdispatch.cpp
34 struct DrawDispatchVuid {
35     const char* queue_flag;
36     const char* inside_renderpass;
37     const char* pipeline_bound;
38     const char* dynamic_state;
39     const char* vertex_binding;
40     const char* vertex_binding_null;
41     const char* compatible_pipeline;
42     const char* render_pass_compatible;
43     const char* subpass_index;
44     const char* sample_location;
45     const char* linear_sampler;
46     const char* cubic_sampler;
47     const char* indirect_protected_cb;
48     const char* indirect_contiguous_memory;
49     const char* indirect_buffer_bit;
50     const char* viewport_count;
51     const char* scissor_count;
52     const char* viewport_scissor_count;
53     const char* primitive_topology;
54     const char* corner_sampled_address_mode;
55     const char* subpass_input;  // It doesn't validate anything because those stuff have done in ValidateCreateGraphicsPipelines.
56     const char* imageview_atomic;
57     const char* push_constants_set;
58     const char* image_subresources;
59     const char* descriptor_valid;
60     const char* sampler_imageview_type;
61     const char* sampler_implicitLod_dref_proj;
62     const char* sampler_bias_offset;
63     const char* vertex_binding_attribute;
64     const char* dynamic_state_setting_commands;
65 };
66 
67 typedef struct {
68     const char* vuid_queue_flags;
69     const char* vuid_queue_feedback;
70     const char* vuid_queue_occlusion;
71     const char* vuid_precise;
72     const char* vuid_query_count;
73     const char* vuid_profile_lock;
74     const char* vuid_scope_not_first;
75     const char* vuid_scope_in_rp;
76     const char* vuid_dup_query_type;
77     const char* vuid_protected_cb;
78 } ValidateBeginQueryVuids;
79 
80 typedef struct {
81     const char* vuid_queue_flags;
82     const char* vuid_active_queries;
83     const char* vuid_protected_cb;
84 } ValidateEndQueryVuids;
85 
86 class CoreChecks : public ValidationStateTracker {
87   public:
88     using StateTracker = ValidationStateTracker;
89     GlobalQFOTransferBarrierMap<VkImageMemoryBarrier> qfo_release_image_barrier_map;
90     GlobalQFOTransferBarrierMap<VkBufferMemoryBarrier> qfo_release_buffer_barrier_map;
91     GlobalImageLayoutMap imageLayoutMap;
92 
CoreChecks()93     CoreChecks() { container_type = LayerObjectTypeCoreValidation; }
94 
95     // Override base class, we have some extra work to do here
96     void InitDeviceValidationObject(bool add_obj, ValidationObject* inst_obj, ValidationObject* dev_obj);
97 
98     void IncrementCommandCount(VkCommandBuffer commandBuffer);
99 
100     bool VerifyQueueStateToSeq(const QUEUE_STATE* initial_queue, uint64_t initial_seq) const;
101     bool ValidateSetMemBinding(VkDeviceMemory mem, const VulkanTypedHandle& typed_handle, const char* apiName) const;
102     bool ValidateDeviceQueueFamily(uint32_t queue_family, const char* cmd_name, const char* parameter_name, const char* error_code,
103                                    bool optional) const;
104     bool ValidateBindBufferMemory(VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset, const char* api_name) const;
105     bool ValidateGetImageMemoryRequirements2(const VkImageMemoryRequirementsInfo2* pInfo, const char* func_name) const;
106     bool CheckCommandBuffersInFlight(const COMMAND_POOL_STATE* pPool, const char* action, const char* error_code) const;
107     bool CheckCommandBufferInFlight(const CMD_BUFFER_STATE* cb_node, const char* action, const char* error_code) const;
108     bool VerifyQueueStateToFence(VkFence fence) const;
109     void StoreMemRanges(VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size);
110     bool ValidateIdleDescriptorSet(VkDescriptorSet set, const char* func_str) const;
111     bool SemaphoreWasSignaled(VkSemaphore semaphore) const;
112     bool ValidatePipelineLocked(std::vector<std::shared_ptr<PIPELINE_STATE>> const& pPipelines, int pipelineIndex) const;
113     bool ValidatePipelineUnlocked(const PIPELINE_STATE* pPipeline, uint32_t pipelineIndex) const;
114     bool ValidImageBufferQueue(const CMD_BUFFER_STATE* cb_node, const VulkanTypedHandle& object, uint32_t queueFamilyIndex,
115                                uint32_t count, const uint32_t* indices) const;
116     bool ValidateFenceForSubmit(const FENCE_STATE* pFence, const char* inflight_vuid, const char* retired_vuid,
117                                 const char* func_name) const;
118     bool ValidateSemaphoresForSubmit(VkQueue queue, const VkSubmitInfo* submit, uint32_t submit_index,
119                                      std::unordered_set<VkSemaphore>* unsignaled_sema_arg,
120                                      std::unordered_set<VkSemaphore>* signaled_sema_arg,
121                                      std::unordered_set<VkSemaphore>* internal_sema_arg) const;
122     bool ValidateMaxTimelineSemaphoreValueDifference(VkSemaphore semaphore, uint64_t value, const char* func_name,
123                                                      const char* vuid) const;
124     bool ValidateCommandBuffersForSubmit(VkQueue queue, const VkSubmitInfo* submit, GlobalImageLayoutMap* localImageLayoutMap_arg,
125                                          QueryMap* local_query_to_state_map, std::vector<VkCommandBuffer>* current_cmds_arg) const;
126     bool ValidateStatus(const CMD_BUFFER_STATE* pNode, CBStatusFlags status_mask, const char* fail_msg, const char* msg_code) const;
127     bool ValidateDrawStateFlags(const CMD_BUFFER_STATE* pCB, const PIPELINE_STATE* pPipe, bool indexed, const char* msg_code) const;
128     bool LogInvalidAttachmentMessage(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string,
129                                      const RENDER_PASS_STATE* rp2_state, uint32_t primary_attach, uint32_t secondary_attach,
130                                      const char* msg, const char* caller, const char* error_code) const;
131     bool LogInvalidPnextMessage(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string,
132                                 const RENDER_PASS_STATE* rp2_state, const char* msg, const char* caller,
133                                 const char* error_code) const;
134     bool ValidateStageMaskGsTsEnables(VkPipelineStageFlags stageMask, const char* caller, const char* geo_error_id,
135                                       const char* tess_error_id, const char* mesh_error_id, const char* task_error_id) const;
136     bool ValidateStageMaskHost(VkPipelineStageFlags stageMask, const char* caller, const char* vuid) const;
137     bool ValidateMapMemRange(const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize offset, VkDeviceSize size) const;
138     bool ValidatePushConstantRange(const uint32_t offset, const uint32_t size, const char* caller_name, uint32_t index) const;
139     bool ValidateRenderPassDAG(RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2KHR* pCreateInfo) const;
140     bool ValidateAttachmentCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string,
141                                          const RENDER_PASS_STATE* rp2_state, uint32_t primary_attach, uint32_t secondary_attach,
142                                          const char* caller, const char* error_code) const;
143     bool ValidateSubpassCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string,
144                                       const RENDER_PASS_STATE* rp2_state, const int subpass, const char* caller,
145                                       const char* error_code) const;
146     bool ValidateRenderPassCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string,
147                                          const RENDER_PASS_STATE* rp2_state, const char* caller, const char* error_code) const;
148     bool ReportInvalidCommandBuffer(const CMD_BUFFER_STATE* cb_state, const char* call_source) const;
149     bool ValidateQueueFamilyIndex(const PHYSICAL_DEVICE_STATE* pd_state, uint32_t requested_queue_family, const char* err_code,
150                                   const char* cmd_name, const char* queue_family_var_name) const;
151     bool ValidateDeviceQueueCreateInfos(const PHYSICAL_DEVICE_STATE* pd_state, uint32_t info_count,
152                                         const VkDeviceQueueCreateInfo* infos) const;
153 
154     bool ValidateProtectedImage(const CMD_BUFFER_STATE* cb_state, const IMAGE_STATE* image_state, const char* cmd_name,
155                                 const char* vuid) const;
156     bool ValidateUnprotectedImage(const CMD_BUFFER_STATE* cb_state, const IMAGE_STATE* image_state, const char* cmd_name,
157                                   const char* vuid) const;
158     bool ValidateProtectedBuffer(const CMD_BUFFER_STATE* cb_state, const BUFFER_STATE* buffer_state, const char* cmd_name,
159                                  const char* vuid) const;
160     bool ValidateUnprotectedBuffer(const CMD_BUFFER_STATE* cb_state, const BUFFER_STATE* buffer_state, const char* cmd_name,
161                                    const char* vuid) const;
162 
163     bool ValidatePipelineVertexDivisors(std::vector<std::shared_ptr<PIPELINE_STATE>> const& pipe_state_vec, const uint32_t count,
164                                         const VkGraphicsPipelineCreateInfo* pipe_cis) const;
165     bool ValidatePipelineCacheControlFlags(VkPipelineCreateFlags flags, uint32_t index, const char* caller_name,
166                                            const char* vuid) const;
167     void EnqueueSubmitTimeValidateImageBarrierAttachment(const char* func_name, CMD_BUFFER_STATE* cb_state,
168                                                          uint32_t imageMemBarrierCount,
169                                                          const VkImageMemoryBarrier* pImageMemBarriers);
170     bool ValidateImageBarrierAttachment(const char* funcName, CMD_BUFFER_STATE const* cb_state,
171                                         const FRAMEBUFFER_STATE* framebuffer, uint32_t active_subpass,
172                                         const safe_VkSubpassDescription2& sub_desc, const VkRenderPass rp_handle,
173                                         uint32_t img_index, const VkImageMemoryBarrier& img_barrier) const;
174     static bool ValidateConcurrentBarrierAtSubmit(const ValidationStateTracker* state_data, const QUEUE_STATE* queue_data,
175                                                   const char* func_name, const CMD_BUFFER_STATE* cb_state,
176                                                   const VulkanTypedHandle& typed_handle, uint32_t src_queue_family,
177                                                   uint32_t dst_queue_family);
178     bool ValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, RenderPassCreateVersion rp_version,
179                                     const VkRenderPassBeginInfo* pRenderPassBegin) const;
180     bool ValidateDependencies(FRAMEBUFFER_STATE const* framebuffer, RENDER_PASS_STATE const* renderPass) const;
181     bool ValidateBarriers(const char* funcName, const CMD_BUFFER_STATE* cb_state, VkPipelineStageFlags src_stage_mask,
182                           VkPipelineStageFlags dst_stage_mask, uint32_t memBarrierCount, const VkMemoryBarrier* pMemBarriers,
183                           uint32_t bufferBarrierCount, const VkBufferMemoryBarrier* pBufferMemBarriers,
184                           uint32_t imageMemBarrierCount, const VkImageMemoryBarrier* pImageMemBarriers) const;
185     bool ValidateBarrierQueueFamilies(const char* func_name, const CMD_BUFFER_STATE* cb_state, const VkImageMemoryBarrier& barrier,
186                                       const IMAGE_STATE* state_data) const;
187     bool ValidateBarrierQueueFamilies(const char* func_name, const CMD_BUFFER_STATE* cb_state, const VkBufferMemoryBarrier& barrier,
188                                       const BUFFER_STATE* state_data) const;
189     bool ValidateCreateSwapchain(const char* func_name, VkSwapchainCreateInfoKHR const* pCreateInfo,
190                                  const SURFACE_STATE* surface_state, const SWAPCHAIN_NODE* old_swapchain_state) const;
191     bool ValidateGraphicsPipelineBindPoint(const CMD_BUFFER_STATE* cb_state, const PIPELINE_STATE* pipeline_state) const;
192     bool ValidatePipelineBindPoint(const CMD_BUFFER_STATE* cb_state, VkPipelineBindPoint bind_point, const char* func_name,
193                                    const std::map<VkPipelineBindPoint, std::string>& bind_errors) const;
194     bool ValidateMemoryIsMapped(const char* funcName, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) const;
195     bool ValidateMappedMemoryRangeDeviceLimits(const char* func_name, uint32_t mem_range_count,
196                                                const VkMappedMemoryRange* mem_ranges) const;
197     BarrierOperationsType ComputeBarrierOperationsType(const CMD_BUFFER_STATE* cb_state, uint32_t buffer_barrier_count,
198                                                        const VkBufferMemoryBarrier* buffer_barriers, uint32_t image_barrier_count,
199                                                        const VkImageMemoryBarrier* image_barriers) const;
200     bool ValidateStageMasksAgainstQueueCapabilities(const CMD_BUFFER_STATE* cb_state, VkPipelineStageFlags source_stage_mask,
201                                                     VkPipelineStageFlags dest_stage_mask, BarrierOperationsType barrier_op_type,
202                                                     const char* function, const char* error_code) const;
203     bool ValidateRenderPassImageBarriers(const char* funcName, const CMD_BUFFER_STATE* cb_state, uint32_t active_subpass,
204                                          const safe_VkSubpassDescription2& sub_desc, const VkRenderPass rp_handle,
205                                          const safe_VkSubpassDependency2* dependencies,
206                                          const std::vector<uint32_t>& self_dependencies, uint32_t image_mem_barrier_count,
207                                          const VkImageMemoryBarrier* image_barriers) const;
208     bool ValidateSecondaryCommandBufferState(const CMD_BUFFER_STATE* pCB, const CMD_BUFFER_STATE* pSubCB) const;
209     bool ValidateFramebuffer(VkCommandBuffer primaryBuffer, const CMD_BUFFER_STATE* pCB, VkCommandBuffer secondaryBuffer,
210                              const CMD_BUFFER_STATE* pSubCB, const char* caller) const;
211     bool ValidateDescriptorUpdateTemplate(const char* func_name, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo) const;
212     bool ValidateCreateSamplerYcbcrConversion(const char* func_name, const VkSamplerYcbcrConversionCreateInfo* create_info) const;
213     bool ValidateImportFence(VkFence fence, const char* vuid, const char* caller_name) const;
214     bool ValidateAcquireNextImage(VkDevice device, CommandVersion cmd_version, VkSwapchainKHR swapchain, uint64_t timeout,
215                                   VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex, const char* func_name,
216                                   const char* semaphore_type_vuid) const;
217     bool VerifyRenderAreaBounds(const VkRenderPassBeginInfo* pRenderPassBegin) const;
218     bool VerifyFramebufferAndRenderPassImageViews(const VkRenderPassBeginInfo* pRenderPassBeginInfo) const;
219     bool ValidatePrimaryCommandBuffer(const CMD_BUFFER_STATE* pCB, char const* cmd_name, const char* error_code) const;
220     void RecordCmdNextSubpassLayouts(VkCommandBuffer commandBuffer, VkSubpassContents contents);
221     bool ValidateCmdEndRenderPass(RenderPassCreateVersion rp_version, VkCommandBuffer commandBuffer) const;
222     void RecordCmdEndRenderPassLayouts(VkCommandBuffer commandBuffer);
223     bool ValidateFramebufferCreateInfo(const VkFramebufferCreateInfo* pCreateInfo) const;
224     bool MatchUsage(uint32_t count, const VkAttachmentReference2KHR* attachments, const VkFramebufferCreateInfo* fbci,
225                     VkImageUsageFlagBits usage_flag, const char* error_code) const;
226     bool IsImageLayoutReadOnly(VkImageLayout layout) const;
227     bool CheckDependencyExists(const VkRenderPass renderpass, const uint32_t subpass, const VkImageLayout layout,
228                                const std::vector<SubpassLayout>& dependent_subpasses, const std::vector<DAGNode>& subpass_to_node,
229                                bool& skip) const;
230     bool CheckPreserved(const VkRenderPass renderpass, const VkRenderPassCreateInfo2KHR* pCreateInfo, const int index,
231                         const uint32_t attachment, const std::vector<DAGNode>& subpass_to_node, int depth, bool& skip) const;
232     bool ValidateBindImageMemory(uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos, const char* api_name) const;
233     bool ValidateGetPhysicalDeviceDisplayPlanePropertiesKHRQuery(VkPhysicalDevice physicalDevice, uint32_t planeIndex,
234                                                                  const char* api_name) const;
235     static bool ValidateCopyQueryPoolResults(const ValidationStateTracker* state_data, VkCommandBuffer commandBuffer,
236                                              VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, uint32_t perfPass,
237                                              VkQueryResultFlags flags, QueryMap* localQueryToStateMap);
238     static bool VerifyQueryIsReset(const ValidationStateTracker* state_data, VkCommandBuffer commandBuffer, QueryObject query_obj,
239                                    const char* func_name, VkQueryPool& firstPerfQueryPool, uint32_t perfPass,
240                                    QueryMap* localQueryToStateMap);
241     static bool ValidatePerformanceQuery(const ValidationStateTracker* state_data, VkCommandBuffer commandBuffer,
242                                          QueryObject query_obj, const char* func_name, VkQueryPool& firstPerfQueryPool,
243                                          uint32_t perfPass, QueryMap* localQueryToStateMap);
244     bool ValidateImportSemaphore(VkSemaphore semaphore, const char* caller_name) const;
245     bool ValidateBeginQuery(const CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj, VkFlags flags, CMD_TYPE cmd,
246                             const char* cmd_name, const ValidateBeginQueryVuids* vuids) const;
247     bool ValidateCmdEndQuery(const CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj, CMD_TYPE cmd, const char* cmd_name,
248                              const ValidateEndQueryVuids* vuids) const;
249     bool ValidateCmdResetQuery(const CMD_BUFFER_STATE* cb_state, VkQueryPool queryPool, uint32_t firstQuery,
250                                uint32_t queryCount) const;
251 
252     const DrawDispatchVuid& GetDrawDispatchVuid(CMD_TYPE cmd_type) const;
253     bool ValidateCmdDrawType(VkCommandBuffer cmd_buffer, bool indexed, VkPipelineBindPoint bind_point, CMD_TYPE cmd_type,
254                              const char* caller, VkQueueFlags queue_flags) const;
255     bool ValidateCmdNextSubpass(RenderPassCreateVersion rp_version, VkCommandBuffer commandBuffer) const;
256     bool ValidateInsertMemoryRange(const VulkanTypedHandle& typed_handle, const DEVICE_MEMORY_STATE* mem_info,
257                                    VkDeviceSize memoryOffset, const char* api_name) const;
258     bool ValidateInsertImageMemoryRange(VkImage image, const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset,
259                                         const char* api_name) const;
260     bool ValidateInsertBufferMemoryRange(VkBuffer buffer, const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset,
261                                          const char* api_name) const;
262     bool ValidateInsertAccelerationStructureMemoryRange(VkAccelerationStructureNV as, const DEVICE_MEMORY_STATE* mem_info,
263                                                         VkDeviceSize mem_offset, const char* api_name) const;
264 
265     bool ValidateMemoryTypes(const DEVICE_MEMORY_STATE* mem_info, const uint32_t memory_type_bits, const char* funcName,
266                              const char* msgCode) const;
267     bool ValidateCommandBufferState(const CMD_BUFFER_STATE* cb_state, const char* call_source, int current_submit_count,
268                                     const char* vu_id) const;
269     bool ValidateCommandBufferSimultaneousUse(const CMD_BUFFER_STATE* pCB, int current_submit_count) const;
270     bool ValidateAttachmentReference(RenderPassCreateVersion rp_version, VkAttachmentReference2 reference, bool input,
271                                      const char* error_type, const char* function_name) const;
272     bool ValidateRenderpassAttachmentUsage(RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2KHR* pCreateInfo,
273                                            const char* function_name) const;
274     bool AddAttachmentUse(RenderPassCreateVersion rp_version, uint32_t subpass, std::vector<uint8_t>& attachment_uses,
275                           std::vector<VkImageLayout>& attachment_layouts, uint32_t attachment, uint8_t new_use,
276                           VkImageLayout new_layout) const;
277     bool ValidateAttachmentIndex(RenderPassCreateVersion rp_version, uint32_t attachment, uint32_t attachment_count,
278                                  const char* error_type, const char* function_name) const;
279     bool ValidateCreateRenderPass(VkDevice device, RenderPassCreateVersion rp_version,
280                                   const VkRenderPassCreateInfo2KHR* pCreateInfo, const char* function_name) const;
281     bool ValidateRenderPassPipelineBarriers(const char* funcName, const CMD_BUFFER_STATE* cb_state,
282                                             VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask,
283                                             VkDependencyFlags dependency_flags, uint32_t mem_barrier_count,
284                                             const VkMemoryBarrier* mem_barriers, uint32_t buffer_mem_barrier_count,
285                                             const VkBufferMemoryBarrier* buffer_mem_barriers, uint32_t image_mem_barrier_count,
286                                             const VkImageMemoryBarrier* image_barriers) const;
287     bool CheckStageMaskQueueCompatibility(VkCommandBuffer command_buffer, VkPipelineStageFlags stage_mask, VkQueueFlags queue_flags,
288                                           const char* function, const char* src_or_dest, const char* error_code) const;
289     bool ValidateUpdateDescriptorSetWithTemplate(VkDescriptorSet descriptorSet,
290                                                  VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData) const;
291     bool ValidateMemoryIsBoundToBuffer(const BUFFER_STATE*, const char*, const char*) const;
292     bool ValidateMemoryIsBoundToImage(const IMAGE_STATE*, const char*, const char*) const;
293     bool ValidateMemoryIsBoundToAccelerationStructure(const ACCELERATION_STRUCTURE_STATE*, const char*, const char*) const;
294     bool ValidateObjectNotInUse(const BASE_NODE* obj_node, const VulkanTypedHandle& obj_struct, const char* caller_name,
295                                 const char* error_code) const;
296     bool ValidateCmdQueueFlags(const CMD_BUFFER_STATE* cb_node, const char* caller_name, VkQueueFlags flags,
297                                const char* error_code) const;
298     bool ValidateSampleLocationsInfo(const VkSampleLocationsInfoEXT* pSampleLocationsInfo, const char* apiName) const;
299     bool InsideRenderPass(const CMD_BUFFER_STATE* pCB, const char* apiName, const char* msgCode) const;
300     bool OutsideRenderPass(const CMD_BUFFER_STATE* pCB, const char* apiName, const char* msgCode) const;
301     bool ValidateDynamicOffsetAlignment(const VkCommandBuffer command_buffer, const VkDescriptorSetLayoutBinding* binding,
302                                         VkDescriptorType test_type, VkDeviceSize alignment, const uint32_t* pDynamicOffsets,
303                                         const char* err_msg, const char* limit_name, uint32_t* offset_idx) const;
304 
305     bool ValidateImageSampleCount(const IMAGE_STATE* image_state, VkSampleCountFlagBits sample_count, const char* location,
306                                   const std::string& msgCode) const;
307     bool ValidateCmdSubpassState(const CMD_BUFFER_STATE* pCB, const CMD_TYPE cmd_type) const;
308     bool ValidateCmd(const CMD_BUFFER_STATE* cb_state, const CMD_TYPE cmd, const char* caller_name) const;
309     bool ValidateIndirectCmd(VkCommandBuffer command_buffer, VkBuffer buffer, CMD_TYPE cmd_type, const char* caller_name) const;
310 
311     template <typename T1>
312     bool ValidateDeviceMaskToPhysicalDeviceCount(uint32_t deviceMask, const T1 object, const char* VUID) const;
313     template <typename T1>
314     bool ValidateDeviceMaskToZero(uint32_t deviceMask, const T1 object, const char* VUID) const;
315     template <typename T1>
316     bool ValidateDeviceMaskToCommandBuffer(const CMD_BUFFER_STATE* pCB, uint32_t deviceMask, const T1 object,
317                                            const char* VUID) const;
318     bool ValidateDeviceMaskToRenderPass(const CMD_BUFFER_STATE* pCB, uint32_t deviceMask, const char* VUID) const;
319 
320     bool ValidateDepthStencilResolve(const VkPhysicalDeviceVulkan12Properties& core12_props,
321                                      const VkRenderPassCreateInfo2* pCreateInfo, const char* function_name) const;
322 
323     bool ValidateBindAccelerationStructureMemory(VkDevice device, const VkBindAccelerationStructureMemoryInfoKHR& info) const;
324     // Prototypes for CoreChecks accessor functions
325     VkFormatProperties GetPDFormatProperties(const VkFormat format) const;
326     const VkPhysicalDeviceMemoryProperties* GetPhysicalDeviceMemoryProperties();
327 
328     const GlobalQFOTransferBarrierMap<VkImageMemoryBarrier>& GetGlobalQFOReleaseBarrierMap(
329         const QFOTransferBarrier<VkImageMemoryBarrier>::Tag& type_tag) const;
330     const GlobalQFOTransferBarrierMap<VkBufferMemoryBarrier>& GetGlobalQFOReleaseBarrierMap(
331         const QFOTransferBarrier<VkBufferMemoryBarrier>::Tag& type_tag) const;
332     GlobalQFOTransferBarrierMap<VkImageMemoryBarrier>& GetGlobalQFOReleaseBarrierMap(
333         const QFOTransferBarrier<VkImageMemoryBarrier>::Tag& type_tag);
334     GlobalQFOTransferBarrierMap<VkBufferMemoryBarrier>& GetGlobalQFOReleaseBarrierMap(
335         const QFOTransferBarrier<VkBufferMemoryBarrier>::Tag& type_tag);
336     template <typename Barrier>
337     void RecordQueuedQFOTransferBarriers(CMD_BUFFER_STATE* cb_state);
338     template <typename Barrier>
339     bool ValidateQueuedQFOTransferBarriers(const CMD_BUFFER_STATE* cb_state, QFOTransferCBScoreboards<Barrier>* scoreboards) const;
340     bool ValidateQueuedQFOTransfers(const CMD_BUFFER_STATE* cb_state,
341                                     QFOTransferCBScoreboards<VkImageMemoryBarrier>* qfo_image_scoreboards,
342                                     QFOTransferCBScoreboards<VkBufferMemoryBarrier>* qfo_buffer_scoreboards) const;
343     template <typename BarrierRecord, typename Scoreboard>
344     bool ValidateAndUpdateQFOScoreboard(const debug_report_data* report_data, const CMD_BUFFER_STATE* cb_state,
345                                         const char* operation, const BarrierRecord& barrier, Scoreboard* scoreboard) const;
346     template <typename Barrier>
347     void RecordBarrierArrayValidationInfo(const char* func_name, CMD_BUFFER_STATE* cb_state, uint32_t barrier_count,
348                                           const Barrier* barriers);
349     void RecordBarrierValidationInfo(const char* func_name, CMD_BUFFER_STATE* cb_state, uint32_t bufferBarrierCount,
350                                      const VkBufferMemoryBarrier* pBufferMemBarriers, uint32_t imageMemBarrierCount,
351                                      const VkImageMemoryBarrier* pImageMemBarriers);
352     template <typename Barrier>
353     bool ValidateQFOTransferBarrierUniqueness(const char* func_name, const CMD_BUFFER_STATE* cb_state, uint32_t barrier_count,
354                                               const Barrier* barriers) const;
355     bool IsReleaseOp(CMD_BUFFER_STATE* cb_state, const VkImageMemoryBarrier& barrier) const;
356     bool ValidateBarriersQFOTransferUniqueness(const char* func_name, const CMD_BUFFER_STATE* cb_state, uint32_t bufferBarrierCount,
357                                                const VkBufferMemoryBarrier* pBufferMemBarriers, uint32_t imageMemBarrierCount,
358                                                const VkImageMemoryBarrier* pImageMemBarriers) const;
359     bool ValidatePrimaryCommandBufferState(const CMD_BUFFER_STATE* pCB, int current_submit_count,
360                                            QFOTransferCBScoreboards<VkImageMemoryBarrier>* qfo_image_scoreboards,
361                                            QFOTransferCBScoreboards<VkBufferMemoryBarrier>* qfo_buffer_scoreboards) const;
362     bool ValidatePipelineDrawtimeState(const LAST_BOUND_STATE& state, const CMD_BUFFER_STATE* pCB, CMD_TYPE cmd_type,
363                                        const PIPELINE_STATE* pPipeline, const char* caller) const;
364     bool ValidateCmdBufDrawState(const CMD_BUFFER_STATE* cb_node, CMD_TYPE cmd_type, const bool indexed,
365                                  const VkPipelineBindPoint bind_point, const char* function) const;
366     static bool ValidateEventStageMask(const ValidationStateTracker* state_data, const CMD_BUFFER_STATE* pCB, size_t eventCount,
367                                        size_t firstEventIndex, VkPipelineStageFlags sourceStageMask,
368                                        EventToStageMap* localEventToStageMap);
369     bool ValidateQueueFamilyIndices(const CMD_BUFFER_STATE* pCB, VkQueue queue) const;
370     bool ValidatePerformanceQueries(const CMD_BUFFER_STATE* pCB, VkQueue queue, VkQueryPool& first_query_pool,
371                                     uint32_t counterPassIndex) const;
372     VkResult CoreLayerCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo,
373                                                const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache);
374     void CoreLayerDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache,
375                                             const VkAllocationCallbacks* pAllocator);
376     VkResult CoreLayerMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount,
377                                                const VkValidationCacheEXT* pSrcCaches);
378     VkResult CoreLayerGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize,
379                                                 void* pData);
380     // For given bindings validate state at time of draw is correct, returning false on error and writing error details into string*
381     bool ValidateDrawState(VkPipelineBindPoint bind_point, const cvdescriptorset::DescriptorSet* descriptor_set,
382                            const std::map<uint32_t, DescriptorReqirement>& bindings, const std::vector<uint32_t>& dynamic_offsets,
383                            const CMD_BUFFER_STATE* cb_node, const std::vector<VkImageView>& attachment_views, const char* caller,
384                            const DrawDispatchVuid& vuids) const;
385     bool ValidateDescriptorSetBindingData(VkPipelineBindPoint bind_point, const CMD_BUFFER_STATE* cb_node,
386                                           const cvdescriptorset::DescriptorSet* descriptor_set,
387                                           const std::vector<uint32_t>& dynamic_offsets,
388                                           std::pair<const uint32_t, DescriptorReqirement>& binding_info, VkFramebuffer framebuffer,
389                                           const std::vector<VkImageView>& attachment_views, const char* caller,
390                                           const DrawDispatchVuid& vuids) const;
391 
392     // Validate contents of a CopyUpdate
393     using DescriptorSet = cvdescriptorset::DescriptorSet;
394     bool ValidateCopyUpdate(const VkCopyDescriptorSet* update, const DescriptorSet* dst_set, const DescriptorSet* src_set,
395                             const char* func_name, std::string* error_code, std::string* error_msg) const;
396     bool VerifyCopyUpdateContents(const VkCopyDescriptorSet* update, const DescriptorSet* src_set, VkDescriptorType src_type,
397                                   uint32_t src_index, const DescriptorSet* dst_set, VkDescriptorType dst_type, uint32_t dst_index,
398                                   const char* func_name, std::string* error_code, std::string* error_msg) const;
399     // Validate contents of a WriteUpdate
400     bool ValidateWriteUpdate(const DescriptorSet* descriptor_set, const VkWriteDescriptorSet* update, const char* func_name,
401                              std::string* error_code, std::string* error_msg) const;
402     bool VerifyWriteUpdateContents(const DescriptorSet* dest_set, const VkWriteDescriptorSet* update, const uint32_t index,
403                                    const char* func_name, std::string* error_code, std::string* error_msg) const;
404     // Shared helper functions - These are useful because the shared sampler image descriptor type
405     //  performs common functions with both sampler and image descriptors so they can share their common functions
406     bool ValidateImageUpdate(VkImageView, VkImageLayout, VkDescriptorType, const char* func_name, std::string*, std::string*) const;
407     // Validate contents of a push descriptor update
408     bool ValidatePushDescriptorsUpdate(const DescriptorSet* push_set, uint32_t write_count, const VkWriteDescriptorSet* p_wds,
409                                        const char* func_name) const;
410     // Descriptor Set Validation Functions
411     bool ValidateSampler(VkSampler) const;
412     bool ValidateBufferUpdate(VkDescriptorBufferInfo const* buffer_info, VkDescriptorType type, const char* func_name,
413                               std::string* error_code, std::string* error_msg) const;
414     bool ValidateAccelerationStructureUpdate(VkAccelerationStructureKHR acc, const char* func_name, std::string* error_code,
415                                              std::string* error_msg) const;
416     bool ValidateUpdateDescriptorSetsWithTemplateKHR(VkDescriptorSet descriptorSet, const TEMPLATE_STATE* template_state,
417                                                      const void* pData) const;
418     bool ValidateAllocateDescriptorSets(const VkDescriptorSetAllocateInfo*,
419                                         const cvdescriptorset::AllocateDescriptorSetsData*) const;
420     bool ValidateUpdateDescriptorSets(uint32_t write_count, const VkWriteDescriptorSet* p_wds, uint32_t copy_count,
421                                       const VkCopyDescriptorSet* p_cds, const char* func_name) const;
422 
423     // Stuff from shader_validation
424     bool ValidateGraphicsPipelineShaderState(const PIPELINE_STATE* pPipeline) const;
425     bool ValidateComputePipelineShaderState(PIPELINE_STATE* pPipeline) const;
426     bool ValidateRayTracingPipeline(PIPELINE_STATE* pipeline, bool isKHR) const;
427     bool PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo,
428                                            const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) const;
429     bool ValidatePipelineShaderStage(VkPipelineShaderStageCreateInfo const* pStage, const PIPELINE_STATE* pipeline,
430                                      const PIPELINE_STATE::StageState& stage_state, const SHADER_MODULE_STATE* module,
431                                      const spirv_inst_iter& entrypoint, bool check_point_size) const;
432     bool ValidatePointListShaderState(const PIPELINE_STATE* pipeline, SHADER_MODULE_STATE const* src, spirv_inst_iter entrypoint,
433                                       VkShaderStageFlagBits stage) const;
434     bool ValidateShaderCapabilities(SHADER_MODULE_STATE const* src, VkShaderStageFlagBits stage) const;
435     bool ValidateShaderStageWritableOrAtomicDescriptor(VkShaderStageFlagBits stage, bool has_writable_descriptor,
436                                                        bool has_atomic_descriptor) const;
437     bool ValidateShaderStageInputOutputLimits(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage,
438                                               const PIPELINE_STATE* pipeline, spirv_inst_iter entrypoint) const;
439     bool ValidateShaderStageMaxResources(VkShaderStageFlagBits stage, const PIPELINE_STATE* pipeline) const;
440     bool ValidateShaderStageGroupNonUniform(SHADER_MODULE_STATE const* src, VkShaderStageFlagBits stage) const;
441     bool ValidateCooperativeMatrix(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage,
442                                    const PIPELINE_STATE* pipeline) const;
443     bool ValidateExecutionModes(SHADER_MODULE_STATE const* src, spirv_inst_iter entrypoint) const;
444     bool ValidateViConsistency(VkPipelineVertexInputStateCreateInfo const* vi) const;
445     bool ValidateViAgainstVsInputs(VkPipelineVertexInputStateCreateInfo const* vi, SHADER_MODULE_STATE const* vs,
446                                    spirv_inst_iter entrypoint) const;
447     bool ValidateFsOutputsAgainstRenderPass(SHADER_MODULE_STATE const* fs, spirv_inst_iter entrypoint,
448                                             PIPELINE_STATE const* pipeline, uint32_t subpass_index) const;
449     bool ValidatePushConstantUsage(const PIPELINE_STATE& pipeline, SHADER_MODULE_STATE const* src,
450                                    VkPipelineShaderStageCreateInfo const* pStage) const;
451     int ValidatePushConstantSetUpdate(const std::vector<int8_t>& push_constant_data_update,
452                                       const shader_struct_member& push_constant_used_in_shader, uint32_t& out_issue_index) const;
453     bool ValidateBuiltinLimits(SHADER_MODULE_STATE const* src, const std::unordered_set<uint32_t>& accessible_ids,
454                                VkShaderStageFlagBits stage) const;
455     bool ValidateSpecializationOffsets(VkPipelineShaderStageCreateInfo const* info) const;
456     bool RequirePropertyFlag(VkBool32 check, char const* flag, char const* structure) const;
457     bool RequireFeature(VkBool32 feature, char const* feature_name) const;
458     bool RequireExtension(bool extension, char const* extension_name) const;
459     bool ValidateInterfaceBetweenStages(SHADER_MODULE_STATE const* producer, spirv_inst_iter producer_entrypoint,
460                                         shader_stage_attributes const* producer_stage, SHADER_MODULE_STATE const* consumer,
461                                         spirv_inst_iter consumer_entrypoint, shader_stage_attributes const* consumer_stage) const;
462 
463     // Buffer Validation Functions
464     // Remove the pending QFO release records from the global set
465     // Note that the type of the handle argument constrained to match Barrier type
466     // The defaulted BarrierRecord argument allows use to declare the type once, but is not intended to be specified by the caller
467     template <typename Barrier, typename BarrierRecord = QFOTransferBarrier<Barrier>>
EraseQFOReleaseBarriers(const typename BarrierRecord::HandleType & handle)468     void EraseQFOReleaseBarriers(const typename BarrierRecord::HandleType& handle) {
469         GlobalQFOTransferBarrierMap<Barrier>& global_release_barriers =
470             GetGlobalQFOReleaseBarrierMap(typename BarrierRecord::Tag());
471         global_release_barriers.erase(handle);
472     }
473 
474     template <typename RegionType>
475     bool ValidateCopyImageTransferGranularityRequirements(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* src_img,
476                                                           const IMAGE_STATE* dst_img, const RegionType* region, const uint32_t i,
477                                                           const char* function, CopyCommandVersion version) const;
478     bool ValidateIdleBuffer(VkBuffer buffer) const;
479     template <typename T1>
480     bool ValidateUsageFlags(VkFlags actual, VkFlags desired, VkBool32 strict, const T1 object,
481                             const VulkanTypedHandle& typed_handle, const char* msgCode, char const* func_name,
482                             char const* usage_str) const;
483     bool ValidateImageSubresourceRange(const uint32_t image_mip_count, const uint32_t image_layer_count,
484                                        const VkImageSubresourceRange& subresourceRange, const char* cmd_name,
485                                        const char* param_name, const char* image_layer_count_var_name, const VkImage image,
486                                        SubresourceRangeErrorCodes errorCodes) const;
487     void SetImageLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state,
488                         const VkImageSubresourceRange& image_subresource_range, VkImageLayout layout,
489                         VkImageLayout expected_layout = kInvalidLayout);
490     void SetImageLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state,
491                         const VkImageSubresourceLayers& image_subresource_layers, VkImageLayout layout);
492     bool ValidateRenderPassLayoutAgainstFramebufferImageUsage(RenderPassCreateVersion rp_version, VkImageLayout layout,
493                                                               VkImage image, VkImageView image_view, VkFramebuffer framebuffer,
494                                                               VkRenderPass renderpass, uint32_t attachment_index,
495                                                               const char* variable_name) const;
496     template <typename RegionType>
497     bool ValidateBufferImageCopyData(const CMD_BUFFER_STATE* cb_node, uint32_t regionCount, const RegionType* pRegions,
498                                      const IMAGE_STATE* image_state, const char* function, CopyCommandVersion version, bool image_to_buffer) const;
499     bool ValidateBufferViewRange(const BUFFER_STATE* buffer_state, const VkBufferViewCreateInfo* pCreateInfo,
500                                  const VkPhysicalDeviceLimits* device_limits) const;
501     bool ValidateBufferViewBuffer(const BUFFER_STATE* buffer_state, const VkBufferViewCreateInfo* pCreateInfo) const;
502 
503     bool ValidateImageFormatFeatures(const VkImageCreateInfo* pCreateInfo) const;
504 
505     bool PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
506                                     VkImage* pImage) const;
507 
508     void PostCallRecordCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
509                                    VkImage* pImage, VkResult result);
510 
511     void PreCallRecordDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator);
512 
513     bool PreCallValidateDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) const;
514 
515     bool ValidateImageAttributes(const IMAGE_STATE* image_state, const VkImageSubresourceRange& range,
516                                  const char* param_name) const;
517 
518     bool ValidateClearAttachmentExtent(VkCommandBuffer command_buffer, uint32_t attachment_index,
519                                        const FRAMEBUFFER_STATE* framebuffer, uint32_t fb_attachment, const VkRect2D& render_area,
520                                        uint32_t rect_count, const VkClearRect* clear_rects) const;
521 
522     template <typename ImageCopyRegionType>
523     bool ValidateImageCopyData(const uint32_t regionCount, const ImageCopyRegionType* ic_regions, const IMAGE_STATE* src_state,
524                                const IMAGE_STATE* dst_state, CopyCommandVersion version) const;
525 
526     bool VerifyClearImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state,
527                                 const VkImageSubresourceRange& range, VkImageLayout dest_image_layout, const char* func_name) const;
528 
529     bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, const VkImageSubresourceRange& range,
530                            VkImageAspectFlags view_aspect, VkImageLayout explicit_layout, VkImageLayout optimal_layout,
531                            const char* caller, const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code,
532                            bool* error) const;
533 
VerifyImageLayout(const CMD_BUFFER_STATE * cb_node,const IMAGE_STATE * image_state,const VkImageSubresourceRange & range,VkImageLayout explicit_layout,VkImageLayout optimal_layout,const char * caller,const char * layout_invalid_msg_code,const char * layout_mismatch_msg_code,bool * error)534     bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, const VkImageSubresourceRange& range,
535                            VkImageLayout explicit_layout, VkImageLayout optimal_layout, const char* caller,
536                            const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code, bool* error) const {
537         return VerifyImageLayout(cb_node, image_state, range, 0, explicit_layout, optimal_layout, caller, layout_invalid_msg_code,
538                                  layout_mismatch_msg_code, error);
539     }
540 
541     bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state,
542                            const VkImageSubresourceLayers& subLayers, VkImageLayout explicit_layout, VkImageLayout optimal_layout,
543                            const char* caller, const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code,
544                            bool* error) const;
545 
546     bool CheckItgExtent(const CMD_BUFFER_STATE* cb_node, const VkExtent3D* extent, const VkOffset3D* offset,
547                         const VkExtent3D* granularity, const VkExtent3D* subresource_extent, const VkImageType image_type,
548                         const uint32_t i, const char* function, const char* member, const char* vuid) const;
549 
550     bool CheckItgOffset(const CMD_BUFFER_STATE* cb_node, const VkOffset3D* offset, const VkExtent3D* granularity, const uint32_t i,
551                         const char* function, const char* member, const char* vuid) const;
552     VkExtent3D GetScaledItg(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img) const;
553 
554     template <typename RegionType>
555     bool CopyImageMultiplaneValidation(VkCommandBuffer command_buffer, const IMAGE_STATE* src_image_state,
556                                        const IMAGE_STATE* dst_image_state, const RegionType region,
557                                        CopyCommandVersion version) const;
558 
559     bool PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout,
560                                            const VkClearColorValue* pColor, uint32_t rangeCount,
561                                            const VkImageSubresourceRange* pRanges) const;
562 
563     void PreCallRecordCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout,
564                                          const VkClearColorValue* pColor, uint32_t rangeCount,
565                                          const VkImageSubresourceRange* pRanges);
566 
567     bool PreCallValidateCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout,
568                                                   const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount,
569                                                   const VkImageSubresourceRange* pRanges) const;
570 
571     void PreCallRecordCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout,
572                                                 const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount,
573                                                 const VkImageSubresourceRange* pRanges);
574 
575     bool FindLayouts(VkImage image, std::vector<VkImageLayout>& layouts) const;
576 
577     void SetImageViewLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_VIEW_STATE& view_state, VkImageLayout layout,
578                             VkImageLayout layoutStencil);
579     void SetImageViewInitialLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_VIEW_STATE& view_state, VkImageLayout layout);
580 
581     void SetImageInitialLayout(CMD_BUFFER_STATE* cb_node, VkImage image, const VkImageSubresourceRange& range,
582                                VkImageLayout layout);
583     void SetImageInitialLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state, const VkImageSubresourceRange& range,
584                                VkImageLayout layout);
585     void SetImageInitialLayout(CMD_BUFFER_STATE* cb_node, const IMAGE_STATE& image_state, const VkImageSubresourceLayers& layers,
586                                VkImageLayout layout);
587 
588     bool VerifyFramebufferAndRenderPassLayouts(RenderPassCreateVersion rp_version, const CMD_BUFFER_STATE* pCB,
589                                                const VkRenderPassBeginInfo* pRenderPassBegin,
590                                                const FRAMEBUFFER_STATE* framebuffer_state) const;
591     void RecordCmdBeginRenderPassLayouts(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin,
592                                          const VkSubpassContents contents);
593     void TransitionAttachmentRefLayout(CMD_BUFFER_STATE* pCB, FRAMEBUFFER_STATE* pFramebuffer,
594                                        const safe_VkAttachmentReference2& ref);
595 
596     void TransitionSubpassLayouts(CMD_BUFFER_STATE*, const RENDER_PASS_STATE*, const int, FRAMEBUFFER_STATE*);
597 
598     void TransitionBeginRenderPassLayouts(CMD_BUFFER_STATE*, const RENDER_PASS_STATE*, FRAMEBUFFER_STATE*);
599 
600     bool ValidateBarrierLayoutToImageUsage(const VkImageMemoryBarrier& img_barrier, bool new_not_old, VkImageUsageFlags usage,
601                                            const char* func_name, const char* barrier_pname) const;
602 
603     bool ValidateBarriersToImages(const CMD_BUFFER_STATE* cb_state, uint32_t imageMemoryBarrierCount,
604                                   const VkImageMemoryBarrier* pImageMemoryBarriers, const char* func_name) const;
605 
606     void RecordQueuedQFOTransfers(CMD_BUFFER_STATE* pCB);
607     void EraseQFOImageRelaseBarriers(const VkImage& image);
608 
609     void TransitionImageLayouts(CMD_BUFFER_STATE* cb_state, uint32_t memBarrierCount, const VkImageMemoryBarrier* pImgMemBarriers);
610 
611     void RecordTransitionImageLayout(CMD_BUFFER_STATE* cb_state, const IMAGE_STATE* image_state,
612                                      const VkImageMemoryBarrier& mem_barrier, bool is_release_op);
613 
614     void TransitionFinalSubpassLayouts(CMD_BUFFER_STATE* pCB, const VkRenderPassBeginInfo* pRenderPassBegin,
615                                        FRAMEBUFFER_STATE* framebuffer_state);
616 
617     template <typename RegionType>
618     bool ValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
619                               VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions,
620                               CopyCommandVersion version) const;
621 
622     bool PreCallValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
623                                      VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
624                                      const VkImageCopy* pRegions) const;
625 
626     bool PreCallValidateCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo) const;
627 
628     bool PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
629                                             const VkClearAttachment* pAttachments, uint32_t rectCount,
630                                             const VkClearRect* pRects) const;
631     void PreCallRecordCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
632                                           const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects);
633 
634     template <typename RegionType>
635     bool ValidateCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
636                                  VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions,
637                                  CopyCommandVersion version) const;
638 
639     bool PreCallValidateCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
640                                         VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
641                                         const VkImageResolve* pRegions) const;
642 
643     bool PreCallValidateCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR* pResolveImageInfo) const;
644 
645     template <typename RegionType>
646     bool ValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
647                               VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions, VkFilter filter,
648                               CopyCommandVersion version) const;
649 
650     bool PreCallValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
651                                      VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
652                                      const VkImageBlit* pRegions, VkFilter filter) const;
653 
654     bool PreCallValidateCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo) const;
655 
656     template <typename RegionType>
657     void RecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
658                             VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions, VkFilter filter);
659 
660     void PreCallRecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
661                                    VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions,
662                                    VkFilter filter);
663 
664     void PreCallRecordCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo);
665 
666     bool ValidateCmdBufImageLayouts(const CMD_BUFFER_STATE* pCB, const GlobalImageLayoutMap& globalImageLayoutMap,
667                                     GlobalImageLayoutMap* overlayLayoutMap_arg) const;
668 
669     void UpdateCmdBufImageLayouts(CMD_BUFFER_STATE* pCB);
670 
671     template <typename T1>
672     bool VerifyBoundMemoryIsValid(const DEVICE_MEMORY_STATE* mem_state, const T1 object, const VulkanTypedHandle& typed_handle,
673                                   const char* api_name, const char* error_code) const;
674 
675     bool ValidateLayoutVsAttachmentDescription(const debug_report_data* report_data, RenderPassCreateVersion rp_version,
676                                                const VkImageLayout first_layout, const uint32_t attachment,
677                                                const VkAttachmentDescription2KHR& attachment_description) const;
678 
679     bool ValidateImageUsageFlags(IMAGE_STATE const* image_state, VkFlags desired, bool strict, const char* msgCode,
680                                  char const* func_name, char const* usage_string) const;
681 
682     bool ValidateImageFormatFeatureFlags(IMAGE_STATE const* image_state, VkFormatFeatureFlags desired, char const* func_name,
683                                          const char* vuid) const;
684 
685     bool ValidateImageSubresourceLayers(const CMD_BUFFER_STATE* cb_node, const VkImageSubresourceLayers* subresource_layers,
686                                         char const* func_name, char const* member, uint32_t i) const;
687 
688     bool ValidateBufferUsageFlags(BUFFER_STATE const* buffer_state, VkFlags desired, bool strict, const char* msgCode,
689                                   char const* func_name, char const* usage_string) const;
690 
691     bool PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo,
692                                      const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) const;
693 
694     bool PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo,
695                                          const VkAllocationCallbacks* pAllocator, VkBufferView* pView) const;
696 
697     bool ValidateImageAspectMask(VkImage image, VkFormat format, VkImageAspectFlags aspect_mask, const char* func_name,
698                                  const char* vuid = kVUID_Core_DrawState_InvalidImageAspect) const;
699 
700     bool ValidateCreateImageViewSubresourceRange(const IMAGE_STATE* image_state, bool is_imageview_2d_type,
701                                                  const VkImageSubresourceRange& subresourceRange) const;
702 
703     bool ValidateCmdClearColorSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange,
704                                                const char* param_name) const;
705 
706     bool ValidateCmdClearDepthSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange,
707                                                const char* param_name) const;
708 
709     bool ValidateImageBarrierSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange,
710                                               const char* cmd_name, const char* param_name) const;
711 
712     bool ValidateImageViewFormatFeatures(const IMAGE_STATE* image_state, const VkFormat view_format,
713                                          const VkImageUsageFlags image_usage) const;
714 
715     bool PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo,
716                                         const VkAllocationCallbacks* pAllocator, VkImageView* pView) const;
717     template <typename BufferImageCopyRegionType>
718     bool ValidateCmdCopyBufferBounds(const BUFFER_STATE* src_buffer_state, const BUFFER_STATE* dst_buffer_state,
719                                      uint32_t regionCount, const BufferImageCopyRegionType* pRegions,
720                                      CopyCommandVersion version) const;
721 
722     template <typename BufferImageCopyRegionType>
723     bool ValidateImageBounds(const IMAGE_STATE* image_state, const uint32_t regionCount, const BufferImageCopyRegionType* pRegions,
724                              const char* func_name, const char* msg_code) const;
725 
726     template <typename BufferImageCopyRegionType>
727     bool ValidateBufferBounds(const IMAGE_STATE* image_state, const BUFFER_STATE* buff_state, uint32_t regionCount,
728                               const BufferImageCopyRegionType* pRegions, const char* func_name, const char* msg_code) const;
729 
730     template <typename BufferImageCopyRegionType>
731     bool ValidateCopyBufferImageTransferGranularityRequirements(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img,
732                                                                 const BufferImageCopyRegionType* region, const uint32_t i,
733                                                                 const char* function, const char* vuid) const;
734 
735     bool ValidateImageMipLevel(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, uint32_t mip_level, const uint32_t i,
736                                const char* function, const char* member, const char* vuid) const;
737 
738     bool ValidateImageArrayLayerRange(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, const uint32_t base_layer,
739                                       const uint32_t layer_count, const uint32_t i, const char* function, const char* member,
740                                       const char* vuid) const;
741     bool ValidateWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfoKHR* pWaitInfo, uint64_t timeout,
742                                 const char* apiName) const;
743 
744     void PreCallRecordCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
745                                    VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions);
746 
747     void PreCallRecordCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo);
748 
749     bool PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount,
750                                       const VkBufferCopy* pRegions) const;
751 
752     bool PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR* pCopyBufferInfos) const;
753 
754     bool PreCallValidateDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator) const;
755 
756     bool PreCallValidateDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) const;
757 
758     bool PreCallValidateDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) const;
759 
760     bool PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size,
761                                       uint32_t data) const;
762 
763     template <typename RegionType>
764     bool ValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
765                                       VkBuffer dstBuffer, uint32_t regionCount, const RegionType* pRegions,
766                                       CopyCommandVersion version) const;
767 
768     bool PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
769                                              VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) const;
770 
771     void PreCallRecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
772                                            VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions);
773 
774     bool PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer,
775                                                  const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) const;
776 
777     void PreCallRecordCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer,
778                                                const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo);
779 
780     template <typename RegionType>
781     bool ValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
782                                       VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions,
783                                       CopyCommandVersion version) const;
784 
785     bool PreCallValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
786                                              VkImageLayout dstImageLayout, uint32_t regionCount,
787                                              const VkBufferImageCopy* pRegions) const;
788 
789     void PreCallRecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
790                                            VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions);
791 
792     bool PreCallValidateCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer,
793                                                  const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) const;
794 
795     void PreCallRecordCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer,
796                                                const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo);
797 
798     bool PreCallValidateGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource,
799                                                   VkSubresourceLayout* pLayout) const;
800     bool ValidateCreateImageANDROID(const debug_report_data* report_data, const VkImageCreateInfo* create_info) const;
801     bool ValidateCreateImageViewANDROID(const VkImageViewCreateInfo* create_info) const;
802     bool ValidateGetImageSubresourceLayoutANDROID(const VkImage image) const;
803     bool ValidatePhysicalDeviceQueueFamilies(uint32_t queue_family_count, const uint32_t* queue_families, const char* cmd_name,
804                                              const char* array_parameter_name, const char* vuid) const;
805     bool ValidateAllocateMemoryANDROID(const VkMemoryAllocateInfo* alloc_info) const;
806     bool ValidateGetImageMemoryRequirementsANDROID(const VkImage image, const char* func_name) const;
807     bool ValidateGetPhysicalDeviceImageFormatProperties2ANDROID(const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
808                                                                 const VkImageFormatProperties2* pImageFormatProperties) const;
809     bool ValidateBufferImportedHandleANDROID(const char* func_name, VkExternalMemoryHandleTypeFlags handleType,
810                                              VkDeviceMemory memory, VkBuffer buffer) const;
811     bool ValidateImageImportedHandleANDROID(const char* func_name, VkExternalMemoryHandleTypeFlags handleType,
812                                             VkDeviceMemory memory, VkImage image) const;
813     bool PreCallValidateCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo,
814                                             const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache) const;
815     bool PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count,
816                                                 const VkGraphicsPipelineCreateInfo* pCreateInfos,
817                                                 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines,
818                                                 void* cgpl_state) const;
819     bool PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count,
820                                                const VkComputePipelineCreateInfo* pCreateInfos,
821                                                const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines,
822                                                void* pipe_state) const;
823     bool PreCallValidateGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo,
824                                                            uint32_t* pExecutableCount,
825                                                            VkPipelineExecutablePropertiesKHR* pProperties) const;
826     bool ValidatePipelineExecutableInfo(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo) const;
827     bool PreCallValidateGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo,
828                                                            uint32_t* pStatisticCount,
829                                                            VkPipelineExecutableStatisticKHR* pStatistics) const;
830     bool PreCallValidateGetPipelineExecutableInternalRepresentationsKHR(
831         VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount,
832         VkPipelineExecutableInternalRepresentationKHR* pStatistics) const;
833     bool PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo,
834                                              const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout) const;
835     bool PreCallValidateAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo,
836                                                VkDescriptorSet* pDescriptorSets, void* ads_state) const;
837     bool PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count,
838                                                     const VkRayTracingPipelineCreateInfoNV* pCreateInfos,
839                                                     const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines,
840                                                     void* pipe_state) const;
841     bool PreCallValidateCreateRayTracingPipelinesKHR(VkDevice device, VkPipelineCache pipelineCache, uint32_t count,
842                                                      const VkRayTracingPipelineCreateInfoKHR* pCreateInfos,
843                                                      const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines,
844                                                      void* pipe_state) const;
845     bool PreCallValidateCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer,
846                                        VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer,
847                                        VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride,
848                                        VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset,
849                                        VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer,
850                                        VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride,
851                                        uint32_t width, uint32_t height, uint32_t depth) const;
852     void PostCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer,
853                                       VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer,
854                                       VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride,
855                                       VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset,
856                                       VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer,
857                                       VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride,
858                                       uint32_t width, uint32_t height, uint32_t depth);
859     bool PreCallValidateCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedBufferRegionKHR* pRaygenShaderBindingTable,
860                                         const VkStridedBufferRegionKHR* pMissShaderBindingTable,
861                                         const VkStridedBufferRegionKHR* pHitShaderBindingTable,
862                                         const VkStridedBufferRegionKHR* pCallableShaderBindingTable, uint32_t width,
863                                         uint32_t height, uint32_t depth) const;
864     void PostCallRecordCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedBufferRegionKHR* pRaygenShaderBindingTable,
865                                        const VkStridedBufferRegionKHR* pMissShaderBindingTable,
866                                        const VkStridedBufferRegionKHR* pHitShaderBindingTable,
867                                        const VkStridedBufferRegionKHR* pCallableShaderBindingTable, uint32_t width, uint32_t height,
868                                        uint32_t depth);
869     bool PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer,
870                                                 const VkStridedBufferRegionKHR* pRaygenShaderBindingTable,
871                                                 const VkStridedBufferRegionKHR* pMissShaderBindingTable,
872                                                 const VkStridedBufferRegionKHR* pHitShaderBindingTable,
873                                                 const VkStridedBufferRegionKHR* pCallableShaderBindingTable, VkBuffer buffer,
874                                                 VkDeviceSize offset) const;
875     void PostCallRecordCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer,
876                                                const VkStridedBufferRegionKHR* pRaygenShaderBindingTable,
877                                                const VkStridedBufferRegionKHR* pMissShaderBindingTable,
878                                                const VkStridedBufferRegionKHR* pHitShaderBindingTable,
879                                                const VkStridedBufferRegionKHR* pCallableShaderBindingTable, VkBuffer buffer,
880                                                VkDeviceSize offset);
881     bool PreCallValidateCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo,
882                                      const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const;
883     void PostCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo,
884                                     const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, VkResult result);
885     bool PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
886                                         VkDeviceSize dataSize, const void* pData) const;
887     bool PreCallValidateGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) const;
888     bool PreCallValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
889                                                      const VkAllocationCallbacks* pAllocator,
890                                                      VkSamplerYcbcrConversion* pYcbcrConversion) const;
891     bool PreCallValidateCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
892                                                         const VkAllocationCallbacks* pAllocator,
893                                                         VkSamplerYcbcrConversion* pYcbcrConversion) const;
894     bool PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo,
895                                       const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) const;
896     bool PreCallValidateCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) const;
897     void PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator);
898     bool PreCallValidateQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) const;
899     void PostCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence,
900                                    VkResult result);
901     bool PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
902                                        const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) const;
903     bool PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks* pAllocator) const;
904     bool PreCallValidateWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll,
905                                       uint64_t timeout) const;
906     bool PreCallValidateQueueWaitIdle(VkQueue queue) const;
907     bool PreCallValidateDeviceWaitIdle(VkDevice device) const;
908     bool PreCallValidateCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo,
909                                         const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore) const;
910     bool PreCallValidateWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfoKHR* pWaitInfo, uint64_t timeout) const;
911     bool PreCallValidateWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfoKHR* pWaitInfo, uint64_t timeout) const;
912     bool PreCallValidateDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator) const;
913     bool PreCallValidateDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) const;
914     bool PreCallValidateDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator) const;
915     bool PreCallValidateDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) const;
916     bool ValidateGetQueryPoolResultsQueries(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const;
917     bool ValidatePerformanceQueryResults(const char* cmd_name, const QUERY_POOL_STATE* query_pool_state, uint32_t firstQuery,
918                                          uint32_t queryCount, VkQueryResultFlags flags) const;
919     bool ValidateGetQueryPoolPerformanceResults(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, void* pData,
920                                                 VkDeviceSize stride, VkQueryResultFlags flags, const char* apiName) const;
921     bool PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount,
922                                             size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) const;
923     bool PreCallValidateBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount,
924                                              const VkBindBufferMemoryInfoKHR* pBindInfos) const;
925     bool PreCallValidateBindBufferMemory2(VkDevice device, uint32_t bindInfoCount,
926                                           const VkBindBufferMemoryInfoKHR* pBindInfos) const;
927     bool PreCallValidateBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset) const;
928     bool PreCallValidateGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) const;
929     bool PreCallValidateGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo,
930                                                     VkMemoryRequirements2* pMemoryRequirements) const;
931     bool PreCallValidateGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo,
932                                                        VkMemoryRequirements2* pMemoryRequirements) const;
933     bool PreCallValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice,
934                                                                 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
935                                                                 VkImageFormatProperties2* pImageFormatProperties) const;
936     bool PreCallValidateGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,
937                                                                    const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
938                                                                    VkImageFormatProperties2* pImageFormatProperties) const;
939     bool PreCallValidateDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) const;
940     bool PreCallValidateDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator) const;
941     bool PreCallValidateDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
942                                               const VkAllocationCallbacks* pAllocator) const;
943     bool PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount,
944                                            const VkCommandBuffer* pCommandBuffers) const;
945     bool PreCallValidateCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo,
946                                           const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) const;
947     bool PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo,
948                                         const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) const;
949     bool PreCallValidateDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
950                                            const VkAllocationCallbacks* pAllocator) const;
951     bool PreCallValidateResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) const;
952     bool PreCallValidateResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) const;
953     bool PreCallValidateDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
954                                            const VkAllocationCallbacks* pAllocator) const;
955     bool PreCallValidateDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) const;
956     bool PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
957                                                   const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout) const;
958     bool PreCallValidateResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
959                                             VkDescriptorPoolResetFlags flags) const;
960     bool PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count,
961                                            const VkDescriptorSet* pDescriptorSets) const;
962     bool PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
963                                              const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount,
964                                              const VkCopyDescriptorSet* pDescriptorCopies) const;
965     bool PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo) const;
966     bool PreCallValidateEndCommandBuffer(VkCommandBuffer commandBuffer) const;
967     bool PreCallValidateResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) const;
968     bool PreCallValidateCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
969                                         VkPipeline pipeline) const;
970     bool PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
971                                        const VkViewport* pViewports) const;
972     bool PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount,
973                                       const VkRect2D* pScissors) const;
974     bool PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor,
975                                                  uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors) const;
976 
977     bool PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
978                                                  const VkViewportWScalingNV* pViewportWScalings) const;
979 
980     bool PreCallValidateCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView,
981                                                   VkImageLayout imageLayout) const;
982     bool PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport,
983                                                            uint32_t viewportCount,
984                                                            const VkShadingRatePaletteNV* pShadingRatePalettes) const;
985     bool ValidateGeometryTrianglesNV(const VkGeometryTrianglesNV& triangles, const char* func_name) const;
986     bool ValidateGeometryAABBNV(const VkGeometryAABBNV& geometry, const char* func_name) const;
987     bool ValidateGeometryNV(const VkGeometryNV& geometry, const char* func_name) const;
988     bool PreCallValidateCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo,
989                                                       const VkAllocationCallbacks* pAllocator,
990                                                       VkAccelerationStructureNV* pAccelerationStructure) const;
991     bool PreCallValidateCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo,
992                                                        const VkAllocationCallbacks* pAllocator,
993                                                        VkAccelerationStructureKHR* pAccelerationStructure) const;
994     bool PreCallValidateBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount,
995                                                           const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) const;
996     bool PreCallValidateBindAccelerationStructureMemoryKHR(VkDevice device, uint32_t bindInfoCount,
997                                                            const VkBindAccelerationStructureMemoryInfoKHR* pBindInfos) const;
998     bool PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure,
999                                                          size_t dataSize, void* pData) const;
1000     bool PreCallValidateCmdBuildAccelerationStructureKHR(
1001         VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
1002         const VkAccelerationStructureBuildOffsetInfoKHR* const* ppOffsetInfos) const;
1003     bool PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo,
1004                                                         VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update,
1005                                                         VkAccelerationStructureNV dst, VkAccelerationStructureNV src,
1006                                                         VkBuffer scratch, VkDeviceSize scratchOffset) const;
1007     bool PreCallValidateCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst,
1008                                                        VkAccelerationStructureNV src, VkCopyAccelerationStructureModeNV mode) const;
1009     bool PreCallValidateDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure,
1010                                                        const VkAllocationCallbacks* pAllocator) const;
1011     bool PreCallValidateDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure,
1012                                                         const VkAllocationCallbacks* pAllocator) const;
1013     bool PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) const;
1014     bool PreCallValidateCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor,
1015                                              uint16_t lineStipplePattern) const;
1016     bool PreCallValidateCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp,
1017                                         float depthBiasSlopeFactor) const;
1018     bool PreCallValidateCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) const;
1019     bool PreCallValidateCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) const;
1020     bool PreCallValidateCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
1021                                                  uint32_t compareMask) const;
1022     bool PreCallValidateCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
1023                                                uint32_t writeMask) const;
1024     bool PreCallValidateCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
1025                                                uint32_t reference) const;
1026     bool PreCallValidateCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
1027                                               VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount,
1028                                               const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount,
1029                                               const uint32_t* pDynamicOffsets) const;
1030     bool PreCallValidateCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
1031                                                 VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount,
1032                                                 const VkWriteDescriptorSet* pDescriptorWrites) const;
1033     bool PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1034                                            VkIndexType indexType) const;
1035     bool PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount,
1036                                              const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) const;
1037     bool PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex,
1038                                 uint32_t firstInstance) const;
1039     bool PreCallValidateCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount,
1040                                        uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) const;
1041     bool PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count,
1042                                                uint32_t stride) const;
1043     bool ValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1044                                              VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
1045                                              uint32_t stride, const char* apiName) const;
1046     bool PreCallValidateCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1047                                                        VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
1048                                                        uint32_t stride) const;
1049     bool PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1050                                                     VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
1051                                                     uint32_t stride) const;
1052     bool PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) const;
1053     bool PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) const;
1054     bool PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count,
1055                                         uint32_t stride) const;
1056     bool PreCallValidateCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY,
1057                                         uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY,
1058                                         uint32_t groupCountZ) const;
1059     bool PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY,
1060                                            uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY,
1061                                            uint32_t groupCountZ) const;
1062     bool PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const;
1063     bool PreCallValidateCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const;
1064     bool PreCallValidateCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents,
1065                                       VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask,
1066                                       uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
1067                                       uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1068                                       uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) const;
1069     void PreCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents,
1070                                     VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask,
1071                                     uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
1072                                     uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1073                                     uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
1074     void PostCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents,
1075                                      VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask,
1076                                      uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
1077                                      uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1078                                      uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
1079     bool PreCallValidateCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
1080                                            VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
1081                                            uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
1082                                            uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1083                                            uint32_t imageMemoryBarrierCount,
1084                                            const VkImageMemoryBarrier* pImageMemoryBarriers) const;
1085     void PreCallRecordCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
1086                                          VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
1087                                          uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
1088                                          uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1089                                          uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
1090 
1091     void EnqueueVerifyBeginQuery(VkCommandBuffer, const QueryObject& query_obj, const char* func);
1092     bool PreCallValidateCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags) const;
1093     void PreCallRecordCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags);
1094     void EnqueueVerifyEndQuery(VkCommandBuffer, const QueryObject& query_obj);
1095     bool PreCallValidateCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) const;
1096     void PreCallRecordCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot);
1097     bool ValidateQueryPoolIndex(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, const char* func_name,
1098                                 const char* first_vuid, const char* sum_vuid) const;
1099     bool PreCallValidateCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery,
1100                                           uint32_t queryCount) const;
1101     bool PreCallValidateCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery,
1102                                                 uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset,
1103                                                 VkDeviceSize stride, VkQueryResultFlags flags) const;
1104     void PreCallRecordCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery,
1105                                               uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride,
1106                                               VkQueryResultFlags flags);
1107     bool PreCallValidateCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags,
1108                                          uint32_t offset, uint32_t size, const void* pValues) const;
1109     bool PreCallValidateCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage,
1110                                           VkQueryPool queryPool, uint32_t slot) const;
1111     void PreCallRecordCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool,
1112                                         uint32_t slot);
1113     bool PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo,
1114                                           const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) const;
1115     bool PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo,
1116                                          const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const;
1117     bool PreCallValidateGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory mem, VkDeviceSize* pCommittedMem) const;
1118     bool ValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo,
1119                                    const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass,
1120                                    const char* function_name) const;
1121     bool PreCallValidateCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR* pCreateInfo,
1122                                              const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const;
1123     bool PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo,
1124                                           const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const;
1125     bool PreCallValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin,
1126                                            VkSubpassContents contents) const;
1127     void PreCallRecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin,
1128                                          VkSubpassContents contents);
1129     bool PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin,
1130                                                const VkSubpassBeginInfoKHR* pSubpassBeginInfo) const;
1131     bool PreCallValidateCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin,
1132                                             const VkSubpassBeginInfoKHR* pSubpassBeginInfo) const;
1133     void PreCallRecordCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin,
1134                                              const VkSubpassBeginInfoKHR* pSubpassBeginInfo);
1135     void PreCallRecordCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin,
1136                                           const VkSubpassBeginInfoKHR* pSubpassBeginInfo);
1137     bool PreCallValidateCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) const;
1138     void PostCallRecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents);
1139     bool PreCallValidateCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo,
1140                                            const VkSubpassEndInfoKHR* pSubpassEndInfo) const;
1141     void PostCallRecordCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo,
1142                                           const VkSubpassEndInfoKHR* pSubpassEndInfo);
1143     bool PreCallValidateCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo,
1144                                         const VkSubpassEndInfoKHR* pSubpassEndInfo) const;
1145     void PostCallRecordCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo,
1146                                        const VkSubpassEndInfoKHR* pSubpassEndInfo);
1147     bool PreCallValidateCmdEndRenderPass(VkCommandBuffer commandBuffer) const;
1148     void PostCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer);
1149     bool PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo) const;
1150     void PostCallRecordCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo);
1151     bool PreCallValidateCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo) const;
1152     void PostCallRecordCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo);
1153     bool PreCallValidateCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount,
1154                                            const VkCommandBuffer* pCommandBuffers) const;
1155     bool PreCallValidateMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags,
1156                                   void** ppData) const;
1157     bool PreCallValidateUnmapMemory(VkDevice device, VkDeviceMemory mem) const;
1158     bool PreCallValidateFlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount,
1159                                                 const VkMappedMemoryRange* pMemRanges) const;
1160     bool PreCallValidateInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount,
1161                                                      const VkMappedMemoryRange* pMemRanges) const;
1162     bool PreCallValidateBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memoryOffset) const;
1163     bool PreCallValidateBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos) const;
1164     bool PreCallValidateBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount,
1165                                             const VkBindImageMemoryInfoKHR* pBindInfos) const;
1166     bool PreCallValidateSetEvent(VkDevice device, VkEvent event) const;
1167     bool PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo,
1168                                         VkFence fence) const;
1169     bool ValidateSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfoKHR* pSignalInfo, const char* api_name) const;
1170     bool PreCallValidateSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) const;
1171     bool PreCallValidateSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfoKHR* pSignalInfo) const;
1172     bool PreCallValidateImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) const;
1173 #ifdef VK_USE_PLATFORM_WIN32_KHR
1174     bool PreCallValidateImportSemaphoreWin32HandleKHR(
1175         VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) const;
1176     bool PreCallValidateImportFenceWin32HandleKHR(VkDevice device,
1177                                                   const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) const;
1178 #endif  // VK_USE_PLATFORM_WIN32_KHR
1179     bool PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) const;
1180 
1181     bool PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo,
1182                                            const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) const;
1183     void PreCallRecordDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator);
1184     bool PreCallValidateGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount,
1185                                               VkImage* pSwapchainImages) const;
1186     void PostCallRecordGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount,
1187                                              VkImage* pSwapchainImages, VkResult result);
1188     bool PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) const;
1189     bool PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount,
1190                                                   const VkSwapchainCreateInfoKHR* pCreateInfos,
1191                                                   const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) const;
1192     bool PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore,
1193                                             VkFence fence, uint32_t* pImageIndex) const;
1194     bool PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo,
1195                                              uint32_t* pImageIndex) const;
1196     bool PreCallValidateDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) const;
1197     bool PreCallValidateGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex,
1198                                                            VkSurfaceKHR surface, VkBool32* pSupported) const;
1199     bool PreCallValidateCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo,
1200                                                        const VkAllocationCallbacks* pAllocator,
1201                                                        VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate) const;
1202     bool PreCallValidateCreateDescriptorUpdateTemplateKHR(VkDevice device,
1203                                                           const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo,
1204                                                           const VkAllocationCallbacks* pAllocator,
1205                                                           VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate) const;
1206     bool PreCallValidateUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet,
1207                                                         VkDescriptorUpdateTemplate descriptorUpdateTemplate,
1208                                                         const void* pData) const;
1209     bool PreCallValidateUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet,
1210                                                            VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate,
1211                                                            const void* pData) const;
1212 
1213     bool PreCallValidateCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer,
1214                                                             VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate,
1215                                                             VkPipelineLayout layout, uint32_t set, const void* pData) const;
1216     bool PreCallValidateGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex,
1217                                                             uint32_t* pDisplayCount, VkDisplayKHR* pDisplays) const;
1218     bool PreCallValidateGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex,
1219                                                        VkDisplayPlaneCapabilitiesKHR* pCapabilities) const;
1220     bool PreCallValidateGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice,
1221                                                         const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo,
1222                                                         VkDisplayPlaneCapabilities2KHR* pCapabilities) const;
1223     bool PreCallValidateCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) const;
1224 
1225     bool PreCallValidateCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query,
1226                                                 VkQueryControlFlags flags, uint32_t index) const;
1227     void PreCallRecordCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query,
1228                                               VkQueryControlFlags flags, uint32_t index);
1229     bool PreCallValidateCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query,
1230                                               uint32_t index) const;
1231     void PreCallRecordCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index);
1232 
1233     bool PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle,
1234                                                   uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles) const;
1235     bool PreCallValidateCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer,
1236                                                  const VkSampleLocationsInfoEXT* pSampleLocationsInfo) const;
1237     bool ValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer,
1238                                       VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride,
1239                                       const char* apiName) const;
1240     bool PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1241                                                 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
1242                                                 uint32_t stride) const;
1243     bool PreCallValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1244                                              VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
1245                                              uint32_t stride) const;
1246     bool PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance,
1247                                                     VkBuffer counterBuffer, VkDeviceSize counterBufferOffset,
1248                                                     uint32_t counterOffset, uint32_t vertexStride) const;
1249     bool PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) const;
1250     bool PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1251                                                    uint32_t drawCount, uint32_t stride) const;
1252     bool PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1253                                                         VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
1254                                                         uint32_t stride) const;
1255     bool ValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const char* apiName) const;
1256     bool PreCallValidateGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfoEXT* pInfo) const;
1257     bool PreCallValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const;
1258     bool PreCallValidateGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfoKHR* pInfo) const;
1259     bool ValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfoKHR* pInfo,
1260                                                const char* apiName) const;
1261     bool ValidateGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfoKHR* pInfo,
1262                                                      const char* apiName) const;
1263     bool PreCallValidateGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfoKHR* pInfo) const;
1264     bool PreCallValidateGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device,
1265                                                                const VkDeviceMemoryOpaqueCaptureAddressInfoKHR* pInfo) const;
1266     bool PreCallValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const;
1267     bool PreCallValidateGetDeviceMemoryOpaqueCaptureAddress(VkDevice device,
1268                                                             const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) const;
1269     bool ValidateCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask, const char* func_name) const;
1270     bool PreCallValidateCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) const;
1271     bool PreCallValidateCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) const;
1272     bool ValidateGetSemaphoreCounterValue(VkDevice device, VkSemaphore sempahore, uint64_t* pValue, const char* apiName) const;
1273     bool PreCallValidateGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore sempahore, uint64_t* pValue) const;
1274     bool PreCallValidateGetSemaphoreCounterValue(VkDevice device, VkSemaphore sempahore, uint64_t* pValue) const;
1275     bool ValidateComputeWorkGroupSizes(const SHADER_MODULE_STATE* shader) const;
1276 
1277     bool ValidateQueryRange(VkDevice device, VkQueryPool queryPool, uint32_t totalCount, uint32_t firstQuery, uint32_t queryCount,
1278                             const char* vuid_badfirst, const char* vuid_badrange, const char* apiName) const;
1279     bool ValidateResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount,
1280                                 const char* apiName) const;
1281     bool PreCallValidateResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const;
1282     bool PreCallValidateResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const;
1283     bool ValidateComputeWorkGroupInvocations(CMD_BUFFER_STATE* cb_state, uint32_t groupCountX, uint32_t groupCountY,
1284                                              uint32_t groupCountZ);
1285     bool ValidateQueryPoolStride(const std::string& vuid_not_64, const std::string& vuid_64, const VkDeviceSize stride,
1286                                  const char* parameter_name, const uint64_t parameter_value, const VkQueryResultFlags flags) const;
1287     bool ValidateCmdDrawStrideWithStruct(VkCommandBuffer commandBuffer, const std::string& vuid, const uint32_t stride,
1288                                          const char* struct_name, const uint32_t struct_size) const;
1289     bool ValidateCmdDrawStrideWithBuffer(VkCommandBuffer commandBuffer, const std::string& vuid, const uint32_t stride,
1290                                          const char* struct_name, const uint32_t struct_size, const uint32_t drawCount,
1291                                          const VkDeviceSize offset, const BUFFER_STATE* buffer_state) const;
1292     bool PreCallValidateReleaseProfilingLockKHR(VkDevice device) const;
1293     bool PreCallValidateCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker) const;
1294     bool PreCallValidateCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding,
1295                                                            uint32_t bindingCount, const VkBuffer* pBuffers,
1296                                                            const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) const;
1297     bool PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer,
1298                                                      uint32_t counterBufferCount, const VkBuffer* pCounterBuffers,
1299                                                      const VkDeviceSize* pCounterBufferOffsets) const;
1300     bool PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer,
1301                                                    uint32_t counterBufferCount, const VkBuffer* pCounterBuffers,
1302                                                    const VkDeviceSize* pCounterBufferOffsets) const;
1303 
1304     bool PreCallValidateWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount,
1305                                                                  const VkAccelerationStructureKHR* pAccelerationStructures,
1306                                                                  VkQueryType queryType, size_t dataSize, void* pData,
1307                                                                  size_t stride) const;
1308 
1309     bool PreCallValidateCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer,
1310                                                                     uint32_t accelerationStructureCount,
1311                                                                     const VkAccelerationStructureKHR* pAccelerationStructures,
1312                                                                     VkQueryType queryType, VkQueryPool queryPool,
1313                                                                     uint32_t firstQuery) const;
1314 
1315     bool PreCallValidateGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup,
1316                                                            uint32_t groupCount, size_t dataSize, void* pData) const;
1317 
1318     bool PreCallValidateGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup,
1319                                                                         uint32_t groupCount, size_t dataSize, void* pData) const;
1320 
1321     bool PreCallValidateCmdBuildAccelerationStructureIndirectKHR(VkCommandBuffer commandBuffer,
1322                                                                  const VkAccelerationStructureBuildGeometryInfoKHR* pInfo,
1323                                                                  VkBuffer indirectBuffer, VkDeviceSize indirectOffset,
1324                                                                  uint32_t indirectStride) const;
1325     bool ValidateCopyAccelerationStructureInfoKHR(const VkCopyAccelerationStructureInfoKHR* pInfo, const char* api_name) const;
1326     bool PreCallValidateCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer,
1327                                                         const VkCopyAccelerationStructureInfoKHR* pInfo) const;
1328     bool PreCallValidateCopyAccelerationStructureKHR(VkDevice device, const VkCopyAccelerationStructureInfoKHR* pInfo) const;
1329     bool PreCallValidateCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer,
1330                                                                 const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) const;
1331     bool PreCallValidateCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer,
1332                                                                 const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) const;
1333 
1334     bool PreCallValidateCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) const;
1335     bool PreCallValidateCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) const;
1336     bool PreCallValidateCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) const;
1337     bool PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount,
1338                                                    const VkViewport* pViewports) const;
1339     bool PreCallValidateCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount,
1340                                                   const VkRect2D* pScissors) const;
1341     bool PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount,
1342                                                  const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes,
1343                                                  const VkDeviceSize* pStrides) const;
1344     bool PreCallValidateCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) const;
1345     bool PreCallValidateCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) const;
1346     bool PreCallValidateCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) const;
1347     bool PreCallValidateCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) const;
1348     bool PreCallValidateCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) const;
1349     bool PreCallValidateCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp,
1350                                            VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) const;
1351 
1352 #ifdef VK_USE_PLATFORM_ANDROID_KHR
1353     bool PreCallValidateGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, const struct AHardwareBuffer* buffer,
1354                                                                   VkAndroidHardwareBufferPropertiesANDROID* pProperties) const;
1355     bool PreCallValidateGetMemoryAndroidHardwareBufferANDROID(VkDevice device,
1356                                                               const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
1357                                                               struct AHardwareBuffer** pBuffer) const;
1358 #endif  // VK_USE_PLATFORM_ANDROID_KHR
1359 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
1360     bool PreCallValidateGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex,
1361                                                                        struct wl_display* display) const;
1362 #endif  // VK_USE_PLATFORM_WAYLAND_KHR
1363 #ifdef VK_USE_PLATFORM_WIN32_KHR
1364     bool PreCallValidateGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice,
1365                                                                      uint32_t queueFamilyIndex) const;
1366 #endif  // VK_USE_PLATFORM_WIN32_KHR
1367 #ifdef VK_USE_PLATFORM_XCB_KHR
1368     bool PreCallValidateGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex,
1369                                                                    xcb_connection_t* connection, xcb_visualid_t visual_id) const;
1370 #endif  // VK_USE_PLATFORM_XCB_KHR
1371 #ifdef VK_USE_PLATFORM_XLIB_KHR
1372     bool PreCallValidateGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex,
1373                                                                     Display* dpy, VisualID visualID) const;
1374 #endif  // VK_USE_PLATFORM_XLIB_KHR
1375 
1376 };  // Class CoreChecks
1377 
1378 // Utility type for ForRange callbacks
1379 struct LayoutUseCheckAndMessage {
1380     const static VkImageAspectFlags kDepthOrStencil = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
1381     const ImageSubresourceLayoutMap* layout_map;
1382     const VkImageAspectFlags aspect_mask;
1383     const char* message;
1384     VkImageLayout layout;
1385 
1386     LayoutUseCheckAndMessage() = delete;
1387     LayoutUseCheckAndMessage(const ImageSubresourceLayoutMap* layout_map_, const VkImageAspectFlags aspect_mask_ = 0)
layout_mapLayoutUseCheckAndMessage1388         : layout_map(layout_map_), aspect_mask{aspect_mask_}, message(nullptr), layout(kInvalidLayout) {}
CheckLayoutUseCheckAndMessage1389     bool Check(const VkImageSubresource& subres, VkImageLayout check, VkImageLayout current_layout, VkImageLayout initial_layout) {
1390         message = nullptr;
1391         layout = kInvalidLayout;  // Success status
1392         if (current_layout != kInvalidLayout && !ImageLayoutMatches(aspect_mask, check, current_layout)) {
1393             message = "previous known";
1394             layout = current_layout;
1395         } else if ((initial_layout != kInvalidLayout) && !ImageLayoutMatches(aspect_mask, check, initial_layout)) {
1396             // To check the relaxed rule matching we need to see how the initial use was used
1397             const auto initial_layout_state = layout_map->GetSubresourceInitialLayoutState(subres);
1398             assert(initial_layout_state);  // If we have an initial layout, we better have a state for it
1399             if (!((initial_layout_state->aspect_mask & kDepthOrStencil) &&
1400                   ImageLayoutMatches(initial_layout_state->aspect_mask, check, initial_layout))) {
1401                 message = "previously used";
1402                 layout = initial_layout;
1403             }
1404         }
1405         return layout == kInvalidLayout;
1406     }
1407 };
1408