1 /* Copyright (c) 2015-2021 The Khronos Group Inc. 2 * Copyright (c) 2015-2021 Valve Corporation 3 * Copyright (c) 2015-2021 LunarG, Inc. 4 * Copyright (C) 2015-2021 Google Inc. 5 * Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 * Author: Courtney Goeltzenleuchter <courtneygo@google.com> 20 * Author: Tobin Ehlis <tobine@google.com> 21 * Author: Chris Forbes <chrisf@ijw.co.nz> 22 * Author: Mark Lobodzinski <mark@lunarg.com> 23 * Author: Dave Houlton <daveh@lunarg.com> 24 * Author: Jeremy Kniager <jeremyk@lunarg.com> 25 * Author: Tobias Hector <tobias.hector@amd.com> 26 */ 27 28 #pragma once 29 30 #include "state_tracker.h" 31 #include "image_layout_map.h" 32 #include "gpu_validation.h" 33 #include "shader_validation.h" 34 #include "core_error_location.h" 35 #include "qfo_transfer.h" 36 #include "cmd_buffer_state.h" 37 #include "render_pass_state.h" 38 39 // Set of VUID that need to go between core_validation.cpp and drawdispatch.cpp 40 struct DrawDispatchVuid { 41 const char* pipeline_bound = kVUIDUndefined; 42 const char* dynamic_state = kVUIDUndefined; 43 const char* vertex_binding = kVUIDUndefined; 44 const char* vertex_binding_null = kVUIDUndefined; 45 const char* compatible_pipeline = kVUIDUndefined; 46 const char* render_pass_compatible = kVUIDUndefined; 47 const char* subpass_index = kVUIDUndefined; 48 const char* sample_location = kVUIDUndefined; 49 const char* linear_sampler = kVUIDUndefined; 50 const char* cubic_sampler = kVUIDUndefined; 51 const char* indirect_protected_cb = kVUIDUndefined; 52 const char* indirect_contiguous_memory = kVUIDUndefined; 53 const char* indirect_buffer_bit = kVUIDUndefined; 54 const char* viewport_count = kVUIDUndefined; 55 const char* scissor_count = kVUIDUndefined; 56 const char* viewport_scissor_count = kVUIDUndefined; 57 const char* primitive_topology = kVUIDUndefined; 58 const char* corner_sampled_address_mode = kVUIDUndefined; 59 // subpass input doesn't validate anything because those checks were done in ValidateCreateGraphicsPipelines 60 const char* subpass_input = kVUIDUndefined; 61 const char* imageview_atomic = kVUIDUndefined; 62 const char* push_constants_set = kVUIDUndefined; 63 const char* image_subresources = kVUIDUndefined; 64 const char* descriptor_valid = kVUIDUndefined; 65 const char* sampler_imageview_type = kVUIDUndefined; 66 const char* sampler_implicitLod_dref_proj = kVUIDUndefined; 67 const char* sampler_bias_offset = kVUIDUndefined; 68 const char* vertex_binding_attribute = kVUIDUndefined; 69 const char* dynamic_state_setting_commands = kVUIDUndefined; 70 const char* rasterization_samples = kVUIDUndefined; 71 const char* unprotected_command_buffer = kVUIDUndefined; 72 const char* protected_command_buffer = kVUIDUndefined; 73 const char* ray_query_protected_cb = kVUIDUndefined; 74 // TODO: Some instance values are in VkBuffer. The validation in those Cmds is skipped. 75 const char* max_multiview_instance_index = kVUIDUndefined; 76 const char* img_filter_cubic = kVUIDUndefined; 77 const char* filter_cubic = kVUIDUndefined; 78 const char* filter_cubic_min_max = kVUIDUndefined; 79 const char* viewport_count_primitive_shading_rate = kVUIDUndefined; 80 const char* patch_control_points = kVUIDUndefined; 81 const char* rasterizer_discard_enable = kVUIDUndefined; 82 const char* depth_bias_enable = kVUIDUndefined; 83 const char* logic_op = kVUIDUndefined; 84 const char* primitive_restart_enable = kVUIDUndefined; 85 const char* vertex_input_binding_stride = kVUIDUndefined; 86 const char* vertex_input = kVUIDUndefined; 87 const char* blend_enable = kVUIDUndefined; 88 const char* dynamic_rendering_view_mask = kVUIDUndefined; 89 const char* dynamic_rendering_color_count = kVUIDUndefined; 90 const char* dynamic_rendering_color_formats = kVUIDUndefined; 91 const char* dynamic_rendering_depth_format = kVUIDUndefined; 92 const char* dynamic_rendering_stencil_format = kVUIDUndefined; 93 const char* dynamic_rendering_fsr = kVUIDUndefined; 94 const char* dynamic_rendering_fdm = kVUIDUndefined; 95 const char* dynamic_rendering_color_sample = kVUIDUndefined; 96 const char* dynamic_rendering_depth_sample = kVUIDUndefined; 97 const char* dynamic_rendering_stencil_sample = kVUIDUndefined; 98 const char* dynamic_rendering_multi_sample = kVUIDUndefined; 99 }; 100 101 struct ValidateBeginQueryVuids { 102 const char* vuid_queue_flags = kVUIDUndefined; 103 const char* vuid_queue_feedback = kVUIDUndefined; 104 const char* vuid_queue_occlusion = kVUIDUndefined; 105 const char* vuid_precise = kVUIDUndefined; 106 const char* vuid_query_count = kVUIDUndefined; 107 const char* vuid_profile_lock = kVUIDUndefined; 108 const char* vuid_scope_not_first = kVUIDUndefined; 109 const char* vuid_scope_in_rp = kVUIDUndefined; 110 const char* vuid_dup_query_type = kVUIDUndefined; 111 const char* vuid_protected_cb = kVUIDUndefined; 112 }; 113 114 struct ValidateEndQueryVuids { 115 const char* vuid_queue_flags = kVUIDUndefined; 116 const char* vuid_active_queries = kVUIDUndefined; 117 const char* vuid_protected_cb = kVUIDUndefined; 118 }; 119 120 struct SubresourceRangeErrorCodes { 121 const char *base_mip_err, *mip_count_err, *base_layer_err, *layer_count_err; 122 }; 123 124 typedef subresource_adapter::BothRangeMap<VkImageLayout, 16> GlobalImageLayoutRangeMap; 125 typedef layer_data::unordered_map<const IMAGE_STATE*, layer_data::optional<GlobalImageLayoutRangeMap>> GlobalImageLayoutMap; 126 127 class CoreChecks : public ValidationStateTracker { 128 public: 129 using StateTracker = ValidationStateTracker; 130 using Location = core_error::Location; 131 using Func = core_error::Func; 132 using Struct = core_error::Struct; 133 using Field = core_error::Field; 134 135 GlobalQFOTransferBarrierMap<QFOImageTransferBarrier> qfo_release_image_barrier_map; 136 GlobalQFOTransferBarrierMap<QFOBufferTransferBarrier> qfo_release_buffer_barrier_map; 137 GlobalImageLayoutMap imageLayoutMap; 138 VkValidationCacheEXT core_validation_cache = VK_NULL_HANDLE; 139 std::string validation_cache_path; 140 CoreChecks()141 CoreChecks() { container_type = LayerObjectTypeCoreValidation; } 142 143 // Override base class, we have some extra work to do here 144 void InitDeviceValidationObject(bool add_obj, ValidationObject* inst_obj, ValidationObject* dev_obj) override; 145 146 struct SimpleErrorLocation { 147 const char* func_name; 148 const char* vuid; FuncNameSimpleErrorLocation149 const char* FuncName() const { return func_name; } VuidSimpleErrorLocation150 const std::string Vuid() const { return vuid; } SimpleErrorLocationSimpleErrorLocation151 SimpleErrorLocation(const char* func_name_, const char* vuid_) : func_name(func_name_), vuid(vuid_) {} 152 }; 153 154 bool VerifyQueueStateToSeq(const QUEUE_STATE* initial_queue, uint64_t initial_seq) const; 155 bool ValidateSetMemBinding(VkDeviceMemory mem, const BINDABLE& mem_binding, const char* apiName) const; 156 bool ValidateDeviceQueueFamily(uint32_t queue_family, const char* cmd_name, const char* parameter_name, const char* error_code, 157 bool optional) const; 158 bool ValidateBindBufferMemory(VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset, const char* api_name) const; 159 bool ValidateGetImageMemoryRequirements2(const VkImageMemoryRequirementsInfo2* pInfo, const char* func_name) const; 160 bool CheckCommandBuffersInFlight(const COMMAND_POOL_STATE* pPool, const char* action, const char* error_code) const; 161 bool CheckCommandBufferInFlight(const CMD_BUFFER_STATE* cb_node, const char* action, const char* error_code) const; 162 bool VerifyQueueStateToFence(VkFence fence) const; 163 void StoreMemRanges(VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size); 164 bool ValidateIdleDescriptorSet(VkDescriptorSet set, const char* func_str) const; 165 bool SemaphoreWasSignaled(VkSemaphore semaphore) const; 166 bool ValidatePipelineLocked(std::vector<std::shared_ptr<PIPELINE_STATE>> const& pPipelines, int pipelineIndex) const; 167 bool ValidatePipelineUnlocked(const PIPELINE_STATE* pPipeline, uint32_t pipelineIndex) const; 168 bool ValidImageBufferQueue(const CMD_BUFFER_STATE* cb_node, const VulkanTypedHandle& object, uint32_t queueFamilyIndex, 169 uint32_t count, const uint32_t* indices) const; 170 bool ValidateFenceForSubmit(const FENCE_STATE* pFence, const char* inflight_vuid, const char* retired_vuid, 171 const char* func_name) const; 172 bool ValidateSemaphoresForSubmit(struct SemaphoreSubmitState& state, VkQueue queue, const VkSubmitInfo* submit, 173 const Location& loc) const; 174 bool ValidateSemaphoresForSubmit(struct SemaphoreSubmitState& state, VkQueue queue, const VkSubmitInfo2KHR* submit, 175 const Location& loc) const; 176 bool ValidateMaxTimelineSemaphoreValueDifference(const Location& loc, VkSemaphore semaphore, uint64_t value) const; 177 bool ValidateStatus(const CMD_BUFFER_STATE* pNode, CBStatusFlags status_mask, const char* fail_msg, const char* msg_code) const; 178 bool ValidateDrawStateFlags(const CMD_BUFFER_STATE* pCB, const PIPELINE_STATE* pPipe, bool indexed, const char* msg_code) const; 179 bool LogInvalidAttachmentMessage(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 180 const RENDER_PASS_STATE* rp2_state, uint32_t primary_attach, uint32_t secondary_attach, 181 const char* msg, const char* caller, const char* error_code) const; 182 bool LogInvalidPnextMessage(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 183 const RENDER_PASS_STATE* rp2_state, const char* msg, const char* caller, 184 const char* error_code) const; 185 bool ValidateStageMaskHost(const Location& loc, VkPipelineStageFlags2KHR stageMask) const; 186 bool ValidateMapMemRange(const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize offset, VkDeviceSize size) const; 187 bool ValidateRenderPassDAG(RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2* pCreateInfo) const; 188 bool ValidateAttachmentCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 189 const RENDER_PASS_STATE* rp2_state, uint32_t primary_attach, uint32_t secondary_attach, 190 const char* caller, const char* error_code) const; 191 bool ValidateSubpassCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 192 const RENDER_PASS_STATE* rp2_state, const int subpass, const char* caller, 193 const char* error_code) const; 194 bool ValidateRenderPassCompatibility(const char* type1_string, const RENDER_PASS_STATE* rp1_state, const char* type2_string, 195 const RENDER_PASS_STATE* rp2_state, const char* caller, const char* error_code) const; 196 bool ReportInvalidCommandBuffer(const CMD_BUFFER_STATE* cb_state, const char* call_source) const; 197 bool ValidateQueueFamilyIndex(const PHYSICAL_DEVICE_STATE* pd_state, uint32_t requested_queue_family, const char* err_code, 198 const char* cmd_name, const char* queue_family_var_name) const; 199 bool ValidateDeviceQueueCreateInfos(const PHYSICAL_DEVICE_STATE* pd_state, uint32_t info_count, 200 const VkDeviceQueueCreateInfo* infos) const; 201 202 bool ValidateProtectedImage(const CMD_BUFFER_STATE* cb_state, const IMAGE_STATE* image_state, const char* cmd_name, 203 const char* vuid, const char* more_message = "") const; 204 bool ValidateUnprotectedImage(const CMD_BUFFER_STATE* cb_state, const IMAGE_STATE* image_state, const char* cmd_name, 205 const char* vuid, const char* more_message = "") const; 206 bool ValidateProtectedBuffer(const CMD_BUFFER_STATE* cb_state, const BUFFER_STATE* buffer_state, const char* cmd_name, 207 const char* vuid, const char* more_message = "") const; 208 bool ValidateUnprotectedBuffer(const CMD_BUFFER_STATE* cb_state, const BUFFER_STATE* buffer_state, const char* cmd_name, 209 const char* vuid, const char* more_message = "") const; 210 211 bool ValidatePipelineVertexDivisors(std::vector<std::shared_ptr<PIPELINE_STATE>> const& pipe_state_vec, const uint32_t count, 212 const VkGraphicsPipelineCreateInfo* pipe_cis) const; 213 bool ValidatePipelineCacheControlFlags(VkPipelineCreateFlags flags, uint32_t index, const char* caller_name, 214 const char* vuid) const; 215 template <typename ImgBarrier> 216 void EnqueueSubmitTimeValidateImageBarrierAttachment(const Location& loc, CMD_BUFFER_STATE* cb_state, 217 const ImgBarrier& barrier); 218 template <typename ImgBarrier> 219 bool ValidateImageBarrierAttachment(const Location& loc, CMD_BUFFER_STATE const* cb_state, const FRAMEBUFFER_STATE* framebuffer, 220 uint32_t active_subpass, const safe_VkSubpassDescription2& sub_desc, 221 const VkRenderPass rp_handle, const ImgBarrier& img_barrier, 222 const CMD_BUFFER_STATE* primary_cb_state = nullptr) const; 223 224 static bool ValidateConcurrentBarrierAtSubmit(const Location& loc, const ValidationStateTracker& state_data, 225 const QUEUE_STATE& queue_data, const CMD_BUFFER_STATE& cb_state, 226 const VulkanTypedHandle& typed_handle, uint32_t src_queue_family, 227 uint32_t dst_queue_family); 228 bool ValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, RenderPassCreateVersion rp_version, 229 const VkRenderPassBeginInfo* pRenderPassBegin, CMD_TYPE cmd_type) const; 230 bool ValidateDependencies(FRAMEBUFFER_STATE const* framebuffer, RENDER_PASS_STATE const* renderPass) const; 231 template <typename Barrier> 232 bool ValidateBufferBarrier(const LogObjectList& objects, const Location& loc, const CMD_BUFFER_STATE* cb_state, 233 const Barrier& barrier) const; 234 235 template <typename Barrier> 236 bool ValidateImageBarrier(const LogObjectList& objects, const Location& loc, const CMD_BUFFER_STATE* cb_state, 237 const Barrier& barrier) const; 238 239 bool ValidateBarriers(const Location& loc, const CMD_BUFFER_STATE* cb_state, VkPipelineStageFlags src_stage_mask, 240 VkPipelineStageFlags dst_stage_mask, uint32_t memBarrierCount, const VkMemoryBarrier* pMemBarriers, 241 uint32_t bufferBarrierCount, const VkBufferMemoryBarrier* pBufferMemBarriers, 242 uint32_t imageMemBarrierCount, const VkImageMemoryBarrier* pImageMemBarriers) const; 243 244 bool ValidatePipelineStageFeatureEnables(const LogObjectList& objects, const Location& loc, 245 VkPipelineStageFlags2KHR stage_mask) const; 246 bool ValidatePipelineStage(const LogObjectList& objects, const Location& loc, VkQueueFlags queue_flags, 247 VkPipelineStageFlags2KHR stage_mask) const; 248 bool ValidateAccessMask(const LogObjectList& objects, const Location& loc, VkQueueFlags queue_flags, 249 VkAccessFlags2KHR access_mask, VkPipelineStageFlags2KHR stage_mask) const; 250 template <typename Barrier> 251 bool ValidateMemoryBarrier(const LogObjectList& objects, const Location& loc, const CMD_BUFFER_STATE* cb_state, 252 const Barrier& barrier, VkPipelineStageFlags src_stage_mask, 253 VkPipelineStageFlags dst_stage_mask) const; 254 template <typename Barrier> 255 bool ValidateMemoryBarrier(const LogObjectList& objects, const Location& loc, const CMD_BUFFER_STATE* cb_state, 256 const Barrier& barrier) const; 257 258 bool ValidateSubpassDependency(const LogObjectList& objects, const Location& loc, const VkSubpassDependency2& barrier) const; 259 260 bool ValidateDependencyInfo(const LogObjectList& objects, const Location& loc, const CMD_BUFFER_STATE* cb_state, 261 const VkDependencyInfoKHR* dep_info) const; 262 template <typename ImgBarrier> 263 bool ValidateBarrierQueueFamilies(const Location& loc, const CMD_BUFFER_STATE* cb_state, const ImgBarrier& barrier, 264 const IMAGE_STATE* state_data) const; 265 template <typename BufBarrier> 266 bool ValidateBarrierQueueFamilies(const Location& loc, const CMD_BUFFER_STATE* cb_state, const BufBarrier& barrier, 267 const BUFFER_STATE* state_data) const; 268 bool ValidateCreateSwapchain(const char* func_name, VkSwapchainCreateInfoKHR const* pCreateInfo, 269 const SURFACE_STATE* surface_state, const SWAPCHAIN_NODE* old_swapchain_state) const; 270 bool ValidateGraphicsPipelineBindPoint(const CMD_BUFFER_STATE* cb_state, const PIPELINE_STATE* pipeline_state) const; 271 bool ValidatePipelineBindPoint(const CMD_BUFFER_STATE* cb_state, VkPipelineBindPoint bind_point, const char* func_name, 272 const std::map<VkPipelineBindPoint, std::string>& bind_errors) const; 273 bool ValidateMemoryIsMapped(const char* funcName, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) const; 274 bool ValidateMappedMemoryRangeDeviceLimits(const char* func_name, uint32_t mem_range_count, 275 const VkMappedMemoryRange* mem_ranges) const; 276 bool ValidateSecondaryCommandBufferState(const CMD_BUFFER_STATE* pCB, const CMD_BUFFER_STATE* pSubCB) const; 277 bool ValidateFramebuffer(VkCommandBuffer primaryBuffer, const CMD_BUFFER_STATE* pCB, VkCommandBuffer secondaryBuffer, 278 const CMD_BUFFER_STATE* pSubCB, const char* caller) const; 279 bool ValidateDescriptorUpdateTemplate(const char* func_name, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo) const; 280 bool ValidateCreateSamplerYcbcrConversion(const char* func_name, const VkSamplerYcbcrConversionCreateInfo* create_info) const; 281 bool ValidateImportFence(VkFence fence, const char* vuid, const char* caller_name) const; 282 bool ValidateAcquireNextImage(VkDevice device, AcquireVersion version, VkSwapchainKHR swapchain, uint64_t timeout, 283 VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex, const char* func_name, 284 const char* semaphore_type_vuid) const; 285 bool VerifyRenderAreaBounds(const VkRenderPassBeginInfo* pRenderPassBegin, const char* func_name) const; 286 bool VerifyFramebufferAndRenderPassImageViews(const VkRenderPassBeginInfo* pRenderPassBeginInfo, const char* func_name) const; 287 bool ValidatePrimaryCommandBuffer(const CMD_BUFFER_STATE* pCB, char const* cmd_name, const char* error_code) const; 288 289 void AddInitialLayoutintoImageLayoutMap(const IMAGE_STATE &image_state, GlobalImageLayoutMap &image_layout_map); 290 291 void RecordCmdNextSubpassLayouts(VkCommandBuffer commandBuffer, VkSubpassContents contents); 292 bool ValidateCmdEndRenderPass(RenderPassCreateVersion rp_version, VkCommandBuffer commandBuffer, CMD_TYPE cmd_type) const; 293 void RecordCmdEndRenderPassLayouts(VkCommandBuffer commandBuffer); 294 bool ValidateFramebufferCreateInfo(const VkFramebufferCreateInfo* pCreateInfo) const; 295 bool MatchUsage(uint32_t count, const VkAttachmentReference2* attachments, const VkFramebufferCreateInfo* fbci, 296 VkImageUsageFlagBits usage_flag, const char* error_code) const; 297 bool IsImageLayoutReadOnly(VkImageLayout layout) const; 298 bool IsDynamic(const PIPELINE_STATE* pPipeline, const VkDynamicState state) const; 299 bool CheckDependencyExists(const VkRenderPass renderpass, const uint32_t subpass, const VkImageLayout layout, 300 const std::vector<SubpassLayout>& dependent_subpasses, const std::vector<DAGNode>& subpass_to_node, 301 bool& skip) const; 302 bool CheckPreserved(const VkRenderPass renderpass, const VkRenderPassCreateInfo2* pCreateInfo, const int index, 303 const uint32_t attachment, const std::vector<DAGNode>& subpass_to_node, int depth, bool& skip) const; 304 bool ValidateBindImageMemory(uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos, const char* api_name) const; 305 bool ValidateGetPhysicalDeviceDisplayPlanePropertiesKHRQuery(VkPhysicalDevice physicalDevice, uint32_t planeIndex, 306 const char* api_name) const; 307 static bool ValidateCopyQueryPoolResults(const ValidationStateTracker* state_data, VkCommandBuffer commandBuffer, 308 VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, uint32_t perfPass, 309 VkQueryResultFlags flags, QueryMap* localQueryToStateMap); 310 static bool VerifyQueryIsReset(const ValidationStateTracker* state_data, VkCommandBuffer commandBuffer, QueryObject query_obj, 311 const char* func_name, VkQueryPool& firstPerfQueryPool, uint32_t perfPass, 312 QueryMap* localQueryToStateMap); 313 static bool ValidatePerformanceQuery(const ValidationStateTracker* state_data, VkCommandBuffer commandBuffer, 314 QueryObject query_obj, const char* func_name, VkQueryPool& firstPerfQueryPool, 315 uint32_t perfPass, QueryMap* localQueryToStateMap); 316 bool ValidateImportSemaphore(VkSemaphore semaphore, const char* caller_name) const; 317 bool ValidateBeginQuery(const CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj, VkFlags flags, uint32_t index, 318 CMD_TYPE cmd, const ValidateBeginQueryVuids* vuids) const; 319 bool ValidateCmdEndQuery(const CMD_BUFFER_STATE* cb_state, const QueryObject& query_obj, uint32_t index, CMD_TYPE cmd, 320 const ValidateEndQueryVuids* vuids) const; 321 bool ValidateCmdResetQuery(const CMD_BUFFER_STATE* cb_state, VkQueryPool queryPool, uint32_t firstQuery, 322 uint32_t queryCount) const; 323 324 const DrawDispatchVuid& GetDrawDispatchVuid(CMD_TYPE cmd_type) const; 325 bool ValidateCmdDrawInstance(const CMD_BUFFER_STATE& cb_state, uint32_t instanceCount, uint32_t firstInstance, 326 CMD_TYPE cmd_type) const; 327 bool ValidateCmdDrawType(const CMD_BUFFER_STATE& cb_state, bool indexed, VkPipelineBindPoint bind_point, 328 CMD_TYPE cmd_type) const; 329 bool ValidateCmdNextSubpass(RenderPassCreateVersion rp_version, VkCommandBuffer commandBuffer, CMD_TYPE cmd_type) const; 330 bool ValidateInsertMemoryRange(const VulkanTypedHandle& typed_handle, const DEVICE_MEMORY_STATE* mem_info, 331 VkDeviceSize memoryOffset, const char* api_name) const; 332 bool ValidateInsertImageMemoryRange(VkImage image, const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset, 333 const char* api_name) const; 334 bool ValidateInsertBufferMemoryRange(VkBuffer buffer, const DEVICE_MEMORY_STATE* mem_info, VkDeviceSize mem_offset, 335 const char* api_name) const; 336 bool ValidateInsertAccelerationStructureMemoryRange(VkAccelerationStructureNV as, const DEVICE_MEMORY_STATE* mem_info, 337 VkDeviceSize mem_offset, const char* api_name) const; 338 339 bool ValidateMemoryTypes(const DEVICE_MEMORY_STATE* mem_info, const uint32_t memory_type_bits, const char* funcName, 340 const char* msgCode) const; 341 bool ValidateCommandBufferState(const CMD_BUFFER_STATE* cb_state, const char* call_source, int current_submit_count, 342 const char* vu_id) const; 343 bool ValidateCommandBufferSimultaneousUse(const Location& loc, const CMD_BUFFER_STATE* pCB, int current_submit_count) const; 344 bool ValidateAttachmentReference(RenderPassCreateVersion rp_version, VkAttachmentReference2 reference, 345 const VkFormat attachment_format, bool input, const char* error_type, 346 const char* function_name) const; 347 bool ValidateRenderpassAttachmentUsage(RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2* pCreateInfo, 348 const char* function_name) const; 349 bool AddAttachmentUse(RenderPassCreateVersion rp_version, uint32_t subpass, std::vector<uint8_t>& attachment_uses, 350 std::vector<VkImageLayout>& attachment_layouts, uint32_t attachment, uint8_t new_use, 351 VkImageLayout new_layout) const; 352 bool ValidateAttachmentIndex(RenderPassCreateVersion rp_version, uint32_t attachment, uint32_t attachment_count, 353 const char* error_type, const char* function_name) const; 354 bool ValidateCreateRenderPass(VkDevice device, RenderPassCreateVersion rp_version, const VkRenderPassCreateInfo2* pCreateInfo, 355 const char* function_name) const; 356 357 bool ValidateRenderPassPipelineBarriers(const Location& loc, const CMD_BUFFER_STATE* cb_state, 358 VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, 359 VkDependencyFlags dependency_flags, uint32_t mem_barrier_count, 360 const VkMemoryBarrier* mem_barriers, uint32_t buffer_mem_barrier_count, 361 const VkBufferMemoryBarrier* buffer_mem_barriers, uint32_t image_mem_barrier_count, 362 const VkImageMemoryBarrier* image_barriers) const; 363 bool ValidateRenderPassPipelineBarriers(const Location& loc, const CMD_BUFFER_STATE* cb_state, 364 const VkDependencyInfoKHR* dep_info) const; 365 366 bool ValidateStageMasksAgainstQueueCapabilities(const LogObjectList& objects, const Location& loc, VkQueueFlags queue_flags, 367 VkPipelineStageFlags2KHR stage_mask) const; 368 bool ValidateUpdateDescriptorSetWithTemplate(VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, 369 const void* pData) const; 370 bool ValidateMemoryIsBoundToBuffer(const BUFFER_STATE*, const char*, const char*) const; 371 bool ValidateMemoryIsBoundToImage(const IMAGE_STATE*, const char*, const char*) const; 372 bool ValidateMemoryIsBoundToImage(const IMAGE_STATE*, const Location&) const; 373 template <typename Location> 374 bool ValidateMemoryIsBoundToImage(const IMAGE_STATE*, const Location&) const; 375 376 bool ValidateMemoryIsBoundToAccelerationStructure(const ACCELERATION_STRUCTURE_STATE*, const char*, const char*) const; 377 bool ValidateMemoryIsBoundToAccelerationStructure(const ACCELERATION_STRUCTURE_STATE_KHR*, const char*, const char*) const; 378 bool ValidateObjectNotInUse(const BASE_NODE* obj_node, const char* caller_name, const char* error_code) const; 379 bool ValidateCmdQueueFlags(const CMD_BUFFER_STATE* cb_node, const char* caller_name, VkQueueFlags flags, 380 const char* error_code) const; 381 bool ValidateSampleLocationsInfo(const VkSampleLocationsInfoEXT* pSampleLocationsInfo, const char* apiName) const; 382 bool MatchSampleLocationsInfo(const VkSampleLocationsInfoEXT* pSampleLocationsInfo1, 383 const VkSampleLocationsInfoEXT* pSampleLocationsInfo2) const; 384 bool InsideRenderPass(const CMD_BUFFER_STATE* pCB, const char* apiName, const char* msgCode) const; 385 bool OutsideRenderPass(const CMD_BUFFER_STATE* pCB, const char* apiName, const char* msgCode) const; 386 387 bool ValidateImageSampleCount(const IMAGE_STATE* image_state, VkSampleCountFlagBits sample_count, const char* location, 388 const std::string& msgCode) const; 389 bool ValidateCmdSubpassState(const CMD_BUFFER_STATE* pCB, const CMD_TYPE cmd_type) const; 390 bool ValidateCmd(const CMD_BUFFER_STATE* cb_state, const CMD_TYPE cmd) const; 391 bool ValidateIndirectCmd(const CMD_BUFFER_STATE& cb_state, const BUFFER_STATE& buffer_state, CMD_TYPE cmd_type) const; 392 393 template <typename T1> 394 bool ValidateDeviceMaskToPhysicalDeviceCount(uint32_t deviceMask, const T1 object, const char* VUID) const; 395 template <typename T1> 396 bool ValidateDeviceMaskToZero(uint32_t deviceMask, const T1 object, const char* VUID) const; 397 template <typename T1> 398 bool ValidateDeviceMaskToCommandBuffer(const CMD_BUFFER_STATE* pCB, uint32_t deviceMask, const T1 object, 399 const char* VUID) const; 400 bool ValidateDeviceMaskToRenderPass(const CMD_BUFFER_STATE* pCB, uint32_t deviceMask, const char* VUID) const; 401 402 bool ValidateDepthStencilResolve(const VkRenderPassCreateInfo2* pCreateInfo, const char* function_name) const; 403 404 bool ValidateBindAccelerationStructureMemory(VkDevice device, const VkBindAccelerationStructureMemoryInfoNV& info) const; 405 // Prototypes for CoreChecks accessor functions 406 VkFormatProperties GetPDFormatProperties(const VkFormat format) const; 407 const VkPhysicalDeviceMemoryProperties* GetPhysicalDeviceMemoryProperties(); 408 409 bool FormatRequiresYcbcrConversionExplicitly(const VkFormat format) const; 410 411 template <typename TransferBarrier> 412 bool ValidateQueuedQFOTransferBarriers(const CMD_BUFFER_STATE* cb_state, QFOTransferCBScoreboards<TransferBarrier>* scoreboards, 413 const GlobalQFOTransferBarrierMap<TransferBarrier>& global_release_barriers) const; 414 bool ValidateQueuedQFOTransfers(const CMD_BUFFER_STATE* cb_state, 415 QFOTransferCBScoreboards<QFOImageTransferBarrier>* qfo_image_scoreboards, 416 QFOTransferCBScoreboards<QFOBufferTransferBarrier>* qfo_buffer_scoreboards) const; 417 418 template <typename Barrier, typename Scoreboard> 419 bool ValidateAndUpdateQFOScoreboard(const debug_report_data* report_data, const CMD_BUFFER_STATE* cb_state, 420 const char* operation, const Barrier& barrier, Scoreboard* scoreboard) const; 421 template <typename Barrier, typename TransferBarrier> 422 void RecordBarrierValidationInfo(const Location& loc, CMD_BUFFER_STATE* cb_state, const Barrier& barrier, 423 QFOTransferBarrierSets<TransferBarrier>& barrier_sets); 424 425 template <typename Barrier, typename TransferBarrier> 426 bool ValidateQFOTransferBarrierUniqueness(const Location& loc, const CMD_BUFFER_STATE* cb_state, const Barrier& barrier, 427 const QFOTransferBarrierSets<TransferBarrier>& barrier_sets) const; 428 429 bool ValidatePrimaryCommandBufferState(const Location& loc, const CMD_BUFFER_STATE* pCB, int current_submit_count, 430 QFOTransferCBScoreboards<QFOImageTransferBarrier>* qfo_image_scoreboards, 431 QFOTransferCBScoreboards<QFOBufferTransferBarrier>* qfo_buffer_scoreboards) const; 432 bool ValidatePipelineDrawtimeState(const LAST_BOUND_STATE& state, const CMD_BUFFER_STATE* pCB, CMD_TYPE cmd_type, 433 const PIPELINE_STATE* pPipeline) const; 434 bool ValidateCmdBufDrawState(const CMD_BUFFER_STATE* cb_node, CMD_TYPE cmd_type, const bool indexed, 435 const VkPipelineBindPoint bind_point) const; 436 bool ValidateCmdRayQueryState(const CMD_BUFFER_STATE* cb_state, CMD_TYPE cmd_type, const VkPipelineBindPoint bind_point) const; 437 static bool ValidateEventStageMask(const ValidationStateTracker* state_data, const CMD_BUFFER_STATE* pCB, size_t eventCount, 438 size_t firstEventIndex, VkPipelineStageFlags2KHR sourceStageMask, 439 EventToStageMap* localEventToStageMap); 440 bool ValidateQueueFamilyIndices(const Location& loc, const CMD_BUFFER_STATE* pCB, VkQueue queue) const; 441 bool ValidatePerformanceQueries(const CMD_BUFFER_STATE* pCB, VkQueue queue, VkQueryPool& first_query_pool, 442 uint32_t counterPassIndex) const; 443 VkResult CoreLayerCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, 444 const VkAllocationCallbacks* pAllocator, 445 VkValidationCacheEXT* pValidationCache) override; 446 void CoreLayerDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, 447 const VkAllocationCallbacks* pAllocator) override; 448 VkResult CoreLayerMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, 449 const VkValidationCacheEXT* pSrcCaches) override; 450 VkResult CoreLayerGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, 451 void* pData) override; 452 // For given bindings validate state at time of draw is correct, returning false on error and writing error details into string* 453 bool ValidateDrawState(const cvdescriptorset::DescriptorSet* descriptor_set, const BindingReqMap& bindings, 454 const std::vector<uint32_t>& dynamic_offsets, const CMD_BUFFER_STATE* cb_node, 455 const std::vector<IMAGE_VIEW_STATE*>* attachments, const std::vector<SUBPASS_INFO>* subpasses, 456 const char* caller, const DrawDispatchVuid& vuids) const; 457 bool ValidateDescriptorSetBindingData(const CMD_BUFFER_STATE* cb_node, const cvdescriptorset::DescriptorSet* descriptor_set, 458 const std::vector<uint32_t>& dynamic_offsets, 459 const std::pair<const uint32_t, DescriptorRequirement>& binding_info, 460 VkFramebuffer framebuffer, const std::vector<IMAGE_VIEW_STATE*>* attachments, 461 const std::vector<SUBPASS_INFO>* subpasses, bool record_time_validate, const char* caller, 462 const DrawDispatchVuid& vuids, 463 layer_data::optional<layer_data::unordered_map<VkImageView, VkImageLayout>>& checked_layouts) const; 464 465 bool ValidateGeneralBufferDescriptor(const char* caller, const DrawDispatchVuid& vuids, const CMD_BUFFER_STATE* cb_node, 466 const cvdescriptorset::DescriptorSet* descriptor_set, 467 const cvdescriptorset::BufferDescriptor& descriptor, 468 const std::pair<const uint32_t, DescriptorRequirement>& binding_info, 469 uint32_t index) const; 470 471 bool ValidateImageDescriptor(const char* caller, const DrawDispatchVuid& vuids, const CMD_BUFFER_STATE* cb_node, 472 const cvdescriptorset::DescriptorSet* descriptor_set, 473 const cvdescriptorset::ImageDescriptor& image_descriptor, 474 const std::pair<const uint32_t, DescriptorRequirement>& binding_info, uint32_t index, 475 bool record_time_validate, const std::vector<IMAGE_VIEW_STATE*>* attachments, 476 const std::vector<SUBPASS_INFO>* subpasses, VkFramebuffer framebuffer, 477 VkDescriptorType descriptor_type, 478 layer_data::optional<layer_data::unordered_map<VkImageView, VkImageLayout>>& checked_layouts) const; 479 480 bool ValidateTexelDescriptor(const char* caller, const DrawDispatchVuid& vuids, const CMD_BUFFER_STATE* cb_node, 481 const cvdescriptorset::DescriptorSet* descriptor_set, 482 const cvdescriptorset::TexelDescriptor& texel_descriptor, 483 const std::pair<const uint32_t, DescriptorRequirement>& binding_info, uint32_t index) const; 484 485 bool ValidateAccelerationDescriptor(const char* caller, const DrawDispatchVuid& vuids, const CMD_BUFFER_STATE* cb_node, 486 const cvdescriptorset::DescriptorSet* descriptor_set, 487 const cvdescriptorset::AccelerationStructureDescriptor& descriptor, 488 const std::pair<const uint32_t, DescriptorRequirement>& binding_info, uint32_t index) const; 489 490 bool ValidateSamplerDescriptor(const char* caller, const DrawDispatchVuid& vuids, const CMD_BUFFER_STATE* cb_node, 491 const cvdescriptorset::DescriptorSet* descriptor_set, 492 const std::pair<const uint32_t, DescriptorRequirement>& binding_info, uint32_t index, 493 VkSampler sampler, bool is_immutable, const SAMPLER_STATE* sampler_state) const; 494 495 // Validate contents of a CopyUpdate 496 using DescriptorSet = cvdescriptorset::DescriptorSet; 497 bool ValidateCopyUpdate(const VkCopyDescriptorSet* update, const DescriptorSet* dst_set, const DescriptorSet* src_set, 498 const char* func_name, std::string* error_code, std::string* error_msg) const; 499 bool VerifyCopyUpdateContents(const VkCopyDescriptorSet* update, const DescriptorSet* src_set, VkDescriptorType src_type, 500 uint32_t src_index, const DescriptorSet* dst_set, VkDescriptorType dst_type, uint32_t dst_index, 501 const char* func_name, std::string* error_code, std::string* error_msg) const; 502 // Validate contents of a WriteUpdate 503 bool ValidateWriteUpdate(const DescriptorSet* descriptor_set, const VkWriteDescriptorSet* update, const char* func_name, 504 std::string* error_code, std::string* error_msg, bool push) const; 505 bool VerifyWriteUpdateContents(const DescriptorSet* dest_set, const VkWriteDescriptorSet* update, const uint32_t index, 506 const char* func_name, std::string* error_code, std::string* error_msg, bool push) const; 507 // Shared helper functions - These are useful because the shared sampler image descriptor type 508 // performs common functions with both sampler and image descriptors so they can share their common functions 509 bool ValidateImageUpdate(VkImageView, VkImageLayout, VkDescriptorType, const char* func_name, std::string*, std::string*) const; 510 // Validate contents of a push descriptor update 511 bool ValidatePushDescriptorsUpdate(const DescriptorSet* push_set, uint32_t write_count, const VkWriteDescriptorSet* p_wds, 512 const char* func_name) const; 513 // Descriptor Set Validation Functions 514 bool ValidateSampler(VkSampler) const; 515 bool ValidateBufferUpdate(VkDescriptorBufferInfo const* buffer_info, VkDescriptorType type, const char* func_name, 516 std::string* error_code, std::string* error_msg) const; 517 template <typename T> 518 bool ValidateAccelerationStructureUpdate(T acc, const char* func_name, std::string* error_code, std::string* error_msg) const; 519 bool ValidateUpdateDescriptorSetsWithTemplateKHR(VkDescriptorSet descriptorSet, const UPDATE_TEMPLATE_STATE* template_state, 520 const void* pData) const; 521 bool ValidateAllocateDescriptorSets(const VkDescriptorSetAllocateInfo*, 522 const cvdescriptorset::AllocateDescriptorSetsData*) const; 523 bool ValidateUpdateDescriptorSets(uint32_t write_count, const VkWriteDescriptorSet* p_wds, uint32_t copy_count, 524 const VkCopyDescriptorSet* p_cds, const char* func_name) const; 525 526 // Stuff from shader_validation 527 bool ValidateGraphicsPipelineShaderState(const PIPELINE_STATE* pPipeline) const; 528 bool ValidateGraphicsPipelineShaderDynamicState(const PIPELINE_STATE* pPipeline, const CMD_BUFFER_STATE* pCB, 529 const char* caller, const DrawDispatchVuid& vuid) const; 530 bool ValidateGraphicsPipelineBlendEnable(const PIPELINE_STATE* pPipeline) const; 531 bool ValidateComputePipelineShaderState(PIPELINE_STATE* pPipeline) const; 532 uint32_t CalcShaderStageCount(const PIPELINE_STATE* pipeline, VkShaderStageFlagBits stageBit) const; 533 bool GroupHasValidIndex(const PIPELINE_STATE* pipeline, uint32_t group, uint32_t stage) const; 534 bool ValidateRayTracingPipeline(PIPELINE_STATE* pipeline, VkPipelineCreateFlags flags, bool isKHR) const; 535 bool PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, 536 const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) const override; 537 bool ValidatePipelineShaderStage(const PIPELINE_STATE* pipeline, const PipelineStageState& stage_state, 538 bool check_point_size) const; 539 bool ValidatePointListShaderState(const PIPELINE_STATE* pipeline, SHADER_MODULE_STATE const* src, spirv_inst_iter entrypoint, 540 VkShaderStageFlagBits stage) const; 541 bool ValidatePrimitiveRateShaderState(const PIPELINE_STATE* pipeline, SHADER_MODULE_STATE const* src, 542 spirv_inst_iter entrypoint, VkShaderStageFlagBits stage) const; 543 bool ValidateTexelOffsetLimits(SHADER_MODULE_STATE const* src, spirv_inst_iter& insn) const; 544 bool ValidateShaderCapabilitiesAndExtensions(SHADER_MODULE_STATE const* src, spirv_inst_iter& insn) const; 545 bool ValidateShaderStageWritableOrAtomicDescriptor(VkShaderStageFlagBits stage, bool has_writable_descriptor, 546 bool has_atomic_descriptor) const; 547 bool ValidateShaderStageInputOutputLimits(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage, 548 const PIPELINE_STATE* pipeline, spirv_inst_iter entrypoint) const; 549 bool ValidateShaderStorageImageFormats(SHADER_MODULE_STATE const* src) const; 550 bool ValidateShaderStageMaxResources(VkShaderStageFlagBits stage, const PIPELINE_STATE* pipeline) const; 551 bool ValidateShaderStageGroupNonUniform(SHADER_MODULE_STATE const* src, VkShaderStageFlagBits stage, 552 spirv_inst_iter& insn) const; 553 bool ValidateMemoryScope(SHADER_MODULE_STATE const* src, const spirv_inst_iter& insn) const; 554 bool ValidateWorkgroupSize(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage, 555 const std::unordered_map<uint32_t, std::vector<uint32_t>>& id_value_map) const; 556 bool ValidateCooperativeMatrix(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage, 557 const PIPELINE_STATE* pipeline) const; 558 bool ValidateShaderResolveQCOM(SHADER_MODULE_STATE const* src, VkPipelineShaderStageCreateInfo const* pStage, 559 const PIPELINE_STATE* pipeline) const; 560 bool ValidateShaderSubgroupSizeControl(VkPipelineShaderStageCreateInfo const* pStage) const; 561 bool ValidateAtomicsTypes(SHADER_MODULE_STATE const* src) const; 562 bool ValidateExecutionModes(SHADER_MODULE_STATE const* src, spirv_inst_iter entrypoint, VkShaderStageFlagBits stage, 563 const PIPELINE_STATE* pipeline) const; 564 bool ValidateViConsistency(VkPipelineVertexInputStateCreateInfo const* vi) const; 565 bool ValidateViAgainstVsInputs(VkPipelineVertexInputStateCreateInfo const* vi, SHADER_MODULE_STATE const* vs, 566 spirv_inst_iter entrypoint) const; 567 bool ValidateFsOutputsAgainstRenderPass(SHADER_MODULE_STATE const* fs, spirv_inst_iter entrypoint, 568 PIPELINE_STATE const* pipeline, uint32_t subpass_index) const; 569 bool ValidateFsOutputsAgainstDynamicRenderingRenderPass(SHADER_MODULE_STATE const* fs, spirv_inst_iter entrypoint, 570 PIPELINE_STATE const* pipeline) const; 571 bool ValidatePushConstantUsage(const PIPELINE_STATE& pipeline, SHADER_MODULE_STATE const* src, 572 VkPipelineShaderStageCreateInfo const* pStage, const std::string& vuid) const; 573 bool ValidateBuiltinLimits(SHADER_MODULE_STATE const* src, spirv_inst_iter entrypoint) const; 574 PushConstantByteState ValidatePushConstantSetUpdate(const std::vector<uint8_t>& push_constant_data_update, 575 const shader_struct_member& push_constant_used_in_shader, 576 uint32_t& out_issue_index) const; 577 bool ValidateSpecializations(VkPipelineShaderStageCreateInfo const* info) const; 578 bool RequirePropertyFlag(VkBool32 check, char const* flag, char const* structure, const char* vuid) const; 579 bool RequireFeature(VkBool32 feature, char const* feature_name, const char* vuid) const; 580 bool RequireApiVersion(uint32_t version, const char* vuid) const; 581 bool ValidateInterfaceBetweenStages(SHADER_MODULE_STATE const* producer, spirv_inst_iter producer_entrypoint, 582 shader_stage_attributes const* producer_stage, SHADER_MODULE_STATE const* consumer, 583 spirv_inst_iter consumer_entrypoint, shader_stage_attributes const* consumer_stage) const; 584 bool ValidateDecorations(SHADER_MODULE_STATE const* module) const; 585 bool ValidateTransformFeedback(SHADER_MODULE_STATE const* src) const; 586 bool ValidateShaderClock(SHADER_MODULE_STATE const* module, spirv_inst_iter& insn) const; 587 588 template <typename RegionType> 589 bool ValidateCopyImageTransferGranularityRequirements(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* src_img, 590 const IMAGE_STATE* dst_img, const RegionType* region, const uint32_t i, 591 const char* function, CopyCommandVersion version) const; 592 bool ValidateIdleBuffer(VkBuffer buffer) const; 593 template <typename T1> 594 bool ValidateUsageFlags(VkFlags actual, VkFlags desired, VkBool32 strict, const T1 object, 595 const VulkanTypedHandle& typed_handle, const char* msgCode, char const* func_name, 596 char const* usage_str) const; 597 bool ValidateImageSubresourceRange(const uint32_t image_mip_count, const uint32_t image_layer_count, 598 const VkImageSubresourceRange& subresourceRange, const char* cmd_name, 599 const char* param_name, const char* image_layer_count_var_name, const VkImage image, 600 const SubresourceRangeErrorCodes& errorCodes) const; 601 bool ValidateRenderPassLayoutAgainstFramebufferImageUsage(RenderPassCreateVersion rp_version, VkImageLayout layout, 602 const IMAGE_VIEW_STATE& image_view_state, VkFramebuffer framebuffer, 603 VkRenderPass renderpass, uint32_t attachment_index, 604 const char* variable_name) const; 605 template <typename RegionType> 606 bool ValidateBufferImageCopyData(const CMD_BUFFER_STATE* cb_node, uint32_t regionCount, const RegionType* pRegions, 607 const IMAGE_STATE* image_state, const char* function, CopyCommandVersion version, 608 bool image_to_buffer) const; 609 bool ValidateBufferViewRange(const BUFFER_STATE* buffer_state, const VkBufferViewCreateInfo* pCreateInfo, 610 const VkPhysicalDeviceLimits* device_limits) const; 611 bool ValidateBufferViewBuffer(const BUFFER_STATE* buffer_state, const VkBufferViewCreateInfo* pCreateInfo) const; 612 613 bool ValidateImageFormatFeatures(const VkImageCreateInfo* pCreateInfo) const; 614 615 bool PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 616 VkImage* pImage) const override; 617 618 void PostCallRecordCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 619 VkImage* pImage, VkResult result) override; 620 621 void PreCallRecordDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) override; 622 623 bool PreCallValidateDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) const override; 624 625 bool ValidateImageAttributes(const IMAGE_STATE* image_state, const VkImageSubresourceRange& range, 626 const char* param_name) const; 627 628 bool ValidateClearAttachmentExtent(const CMD_BUFFER_STATE &cb_node, uint32_t attachment_index, 629 const IMAGE_VIEW_STATE *image_view_state, const VkRect2D& render_area, 630 uint32_t rect_count, const VkClearRect* clear_rects) const; 631 632 template <typename ImageCopyRegionType> 633 bool ValidateImageCopyData(const uint32_t regionCount, const ImageCopyRegionType* ic_regions, const IMAGE_STATE* src_state, 634 const IMAGE_STATE* dst_state, CopyCommandVersion version) const; 635 636 bool VerifyClearImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, 637 const VkImageSubresourceRange& range, VkImageLayout dest_image_layout, const char* func_name) const; 638 639 bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, const VkImageSubresourceRange& range, 640 VkImageAspectFlags view_aspect, VkImageLayout explicit_layout, VkImageLayout optimal_layout, 641 const char* caller, const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code, 642 bool* error) const; 643 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)644 bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, const VkImageSubresourceRange& range, 645 VkImageLayout explicit_layout, VkImageLayout optimal_layout, const char* caller, 646 const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code, bool* error) const { 647 return VerifyImageLayout(cb_node, image_state, range, 0, explicit_layout, optimal_layout, caller, layout_invalid_msg_code, 648 layout_mismatch_msg_code, error); 649 } 650 651 bool VerifyImageLayout(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* image_state, 652 const VkImageSubresourceLayers& subLayers, VkImageLayout explicit_layout, VkImageLayout optimal_layout, 653 const char* caller, const char* layout_invalid_msg_code, const char* layout_mismatch_msg_code, 654 bool* error) const; 655 656 bool CheckItgExtent(const CMD_BUFFER_STATE* cb_node, const VkExtent3D* extent, const VkOffset3D* offset, 657 const VkExtent3D* granularity, const VkExtent3D* subresource_extent, const VkImageType image_type, 658 const uint32_t i, const char* function, const char* member, const char* vuid) const; 659 660 bool CheckItgOffset(const CMD_BUFFER_STATE* cb_node, const VkOffset3D* offset, const VkExtent3D* granularity, const uint32_t i, 661 const char* function, const char* member, const char* vuid) const; 662 VkExtent3D GetScaledItg(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img) const; 663 664 bool PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 665 const VkClearColorValue* pColor, uint32_t rangeCount, 666 const VkImageSubresourceRange* pRanges) const override; 667 668 void PreCallRecordCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 669 const VkClearColorValue* pColor, uint32_t rangeCount, 670 const VkImageSubresourceRange* pRanges) override; 671 672 bool ValidateClearDepthStencilValue(VkCommandBuffer commandBuffer, VkClearDepthStencilValue clearValue, 673 const char* apiName) const; 674 675 bool PreCallValidateCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 676 const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, 677 const VkImageSubresourceRange* pRanges) const override; 678 679 void PreCallRecordCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, 680 const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, 681 const VkImageSubresourceRange* pRanges) override; 682 683 bool FindLayouts(const IMAGE_STATE& image_state, std::vector<VkImageLayout>& layouts) const; 684 685 bool VerifyFramebufferAndRenderPassLayouts(RenderPassCreateVersion rp_version, const CMD_BUFFER_STATE* pCB, 686 const VkRenderPassBeginInfo* pRenderPassBegin, 687 const FRAMEBUFFER_STATE* framebuffer_state) const; 688 void RecordCmdBeginRenderPassLayouts(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 689 const VkSubpassContents contents); 690 void TransitionAttachmentRefLayout(CMD_BUFFER_STATE* pCB, FRAMEBUFFER_STATE* pFramebuffer, 691 const safe_VkAttachmentReference2& ref); 692 693 void TransitionSubpassLayouts(CMD_BUFFER_STATE*, const RENDER_PASS_STATE*, const int, FRAMEBUFFER_STATE*); 694 695 void TransitionBeginRenderPassLayouts(CMD_BUFFER_STATE*, const RENDER_PASS_STATE*, FRAMEBUFFER_STATE*); 696 697 bool ValidateBarrierLayoutToImageUsage(const Location& loc, VkImage image, VkImageLayout layout, VkImageUsageFlags usage) const; 698 699 template <typename ImageBarrier> 700 bool ValidateBarriersToImages(const Location& loc, const CMD_BUFFER_STATE* cb_state, uint32_t imageMemoryBarrierCount, 701 const ImageBarrier* pImageMemoryBarriers) const; 702 703 void RecordQueuedQFOTransfers(CMD_BUFFER_STATE* pCB); 704 705 template <typename ImgBarrier> 706 void TransitionImageLayouts(CMD_BUFFER_STATE* cb_state, uint32_t barrier_count, const ImgBarrier* barrier); 707 708 template <typename ImgBarrier> 709 void RecordTransitionImageLayout(CMD_BUFFER_STATE* cb_state, const IMAGE_STATE* image_state, const ImgBarrier& img_barrier, 710 bool is_release_op); 711 void RecordBarriers(Func func_name, CMD_BUFFER_STATE* cb_state, uint32_t bufferBarrierCount, 712 const VkBufferMemoryBarrier* pBufferMemBarriers, uint32_t imageMemBarrierCount, 713 const VkImageMemoryBarrier* pImageMemBarriers); 714 void RecordBarriers(Func func_name, CMD_BUFFER_STATE* cb_state, const VkDependencyInfoKHR& dep_info); 715 716 void TransitionFinalSubpassLayouts(CMD_BUFFER_STATE* pCB, const VkRenderPassBeginInfo* pRenderPassBegin, 717 FRAMEBUFFER_STATE* framebuffer_state); 718 719 template <typename RegionType> 720 bool ValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 721 VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions, 722 CopyCommandVersion version) const; 723 724 bool PreCallValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 725 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, 726 const VkImageCopy* pRegions) const override; 727 728 bool PreCallValidateCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo) const override; 729 730 bool PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, 731 const VkClearAttachment* pAttachments, uint32_t rectCount, 732 const VkClearRect* pRects) const override; 733 void PreCallRecordCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, 734 const VkClearAttachment* pAttachments, uint32_t rectCount, 735 const VkClearRect* pRects) override; 736 737 template <typename RegionType> 738 bool ValidateCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 739 VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions, 740 CopyCommandVersion version) const; 741 742 bool PreCallValidateCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 743 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, 744 const VkImageResolve* pRegions) const override; 745 746 bool PreCallValidateCmdResolveImage2KHR(VkCommandBuffer commandBuffer, 747 const VkResolveImageInfo2KHR* pResolveImageInfo) const override; 748 749 template <typename RegionType> 750 bool ValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 751 VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions, VkFilter filter, 752 CopyCommandVersion version) const; 753 754 bool PreCallValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 755 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, 756 const VkImageBlit* pRegions, VkFilter filter) const override; 757 758 bool PreCallValidateCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo) const override; 759 760 template <typename RegionType> 761 void RecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 762 VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions, VkFilter filter); 763 764 void PreCallRecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 765 VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, 766 VkFilter filter) override; 767 768 void PreCallRecordCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo) override; 769 770 bool ValidateCmdBufImageLayouts(const Location& loc, const CMD_BUFFER_STATE* pCB, 771 const GlobalImageLayoutMap& globalImageLayoutMap, GlobalImageLayoutMap& overlayLayoutMap) const; 772 773 void UpdateCmdBufImageLayouts(CMD_BUFFER_STATE* pCB); 774 775 template <typename T1> 776 bool VerifyBoundMemoryIsValid(const DEVICE_MEMORY_STATE* mem_state, const T1 object, const VulkanTypedHandle& typed_handle, 777 const char* api_name, const char* error_code) const; 778 template <typename T1, typename LocType> 779 bool VerifyBoundMemoryIsValid(const DEVICE_MEMORY_STATE* mem_state, const T1 object, const VulkanTypedHandle& typed_handle, 780 const LocType& location) const; 781 782 bool ValidateLayoutVsAttachmentDescription(const debug_report_data* report_data, RenderPassCreateVersion rp_version, 783 const VkImageLayout first_layout, const uint32_t attachment, 784 const VkAttachmentDescription2& attachment_description) const; 785 786 bool ValidateImageUsageFlags(IMAGE_STATE const* image_state, VkFlags desired, bool strict, const char* msgCode, 787 char const* func_name, char const* usage_string) const; 788 789 bool ValidateImageFormatFeatureFlags(IMAGE_STATE const* image_state, VkFormatFeatureFlags desired, char const* func_name, 790 const char* vuid) const; 791 792 bool ValidateImageSubresourceLayers(const CMD_BUFFER_STATE* cb_node, const VkImageSubresourceLayers* subresource_layers, 793 char const* func_name, char const* member, uint32_t i) const; 794 795 bool ValidateBufferUsageFlags(BUFFER_STATE const* buffer_state, VkFlags desired, bool strict, const char* msgCode, 796 char const* func_name, char const* usage_string) const; 797 798 bool PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, 799 const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) const override; 800 801 bool PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, 802 const VkAllocationCallbacks* pAllocator, VkBufferView* pView) const override; 803 804 bool ValidateImageAspectMask(VkImage image, VkFormat format, VkImageAspectFlags aspect_mask, const char* func_name, 805 const char* vuid = kVUID_Core_DrawState_InvalidImageAspect) const; 806 807 bool ValidateImageAcquired(IMAGE_STATE const& image_state, const char* func_name) const; 808 809 bool ValidateCreateImageViewSubresourceRange(const IMAGE_STATE* image_state, bool is_imageview_2d_type, 810 const VkImageSubresourceRange& subresourceRange) const; 811 812 bool ValidateCmdClearColorSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange, 813 const char* param_name) const; 814 815 bool ValidateCmdClearDepthSubresourceRange(const IMAGE_STATE* image_state, const VkImageSubresourceRange& subresourceRange, 816 const char* param_name) const; 817 818 bool ValidateImageBarrierSubresourceRange(const Location& loc, const IMAGE_STATE* image_state, 819 const VkImageSubresourceRange& subresourceRange) const; 820 821 bool ValidateImageViewFormatFeatures(const IMAGE_STATE* image_state, const VkFormat view_format, 822 const VkImageUsageFlags image_usage) const; 823 824 bool PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, 825 const VkAllocationCallbacks* pAllocator, VkImageView* pView) const override; 826 template <typename BufferImageCopyRegionType> 827 bool ValidateCmdCopyBufferBounds(const BUFFER_STATE* src_buffer_state, const BUFFER_STATE* dst_buffer_state, 828 uint32_t regionCount, const BufferImageCopyRegionType* pRegions, 829 CopyCommandVersion version) const; 830 831 template <typename BufferImageCopyRegionType> 832 bool ValidateImageBounds(const IMAGE_STATE* image_state, const uint32_t regionCount, const BufferImageCopyRegionType* pRegions, 833 const char* func_name, const char* msg_code) const; 834 835 template <typename BufferImageCopyRegionType> 836 bool ValidateBufferBounds(const IMAGE_STATE* image_state, const BUFFER_STATE* buff_state, uint32_t regionCount, 837 const BufferImageCopyRegionType* pRegions, const char* func_name, const char* msg_code) const; 838 839 template <typename BufferImageCopyRegionType> 840 bool ValidateCopyBufferImageTransferGranularityRequirements(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, 841 const BufferImageCopyRegionType* region, const uint32_t i, 842 const char* function, const char* vuid) const; 843 844 bool ValidateImageMipLevel(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, uint32_t mip_level, const uint32_t i, 845 const char* function, const char* member, const char* vuid) const; 846 847 bool ValidateImageArrayLayerRange(const CMD_BUFFER_STATE* cb_node, const IMAGE_STATE* img, const uint32_t base_layer, 848 const uint32_t layer_count, const uint32_t i, const char* function, const char* member, 849 const char* vuid) const; 850 bool ValidateWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout, const char* apiName) const; 851 852 void PreCallRecordCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, 853 VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) override; 854 855 void PreCallRecordCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo) override; 856 857 template <typename RegionType> 858 bool ValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, 859 const RegionType* pRegions, CopyCommandVersion version) const; 860 861 bool PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, 862 const VkBufferCopy* pRegions) const override; 863 864 bool PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, 865 const VkCopyBufferInfo2KHR* pCopyBufferInfos) const override; 866 867 bool PreCallValidateDestroyImageView(VkDevice device, VkImageView imageView, 868 const VkAllocationCallbacks* pAllocator) const override; 869 870 bool PreCallValidateDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) const override; 871 void PreCallRecordDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) override; 872 873 bool PreCallValidateDestroyBufferView(VkDevice device, VkBufferView bufferView, 874 const VkAllocationCallbacks* pAllocator) const override; 875 876 bool PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, 877 uint32_t data) const override; 878 879 template <typename RegionType> 880 bool ValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 881 VkBuffer dstBuffer, uint32_t regionCount, const RegionType* pRegions, 882 CopyCommandVersion version) const; 883 884 bool PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 885 VkBuffer dstBuffer, uint32_t regionCount, 886 const VkBufferImageCopy* pRegions) const override; 887 888 void PreCallRecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, 889 VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) override; 890 891 bool PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, 892 const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) const override; 893 894 void PreCallRecordCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, 895 const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) override; 896 897 template <typename RegionType> 898 bool ValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, 899 VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType* pRegions, 900 CopyCommandVersion version) const; 901 902 bool PreCallValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, 903 VkImageLayout dstImageLayout, uint32_t regionCount, 904 const VkBufferImageCopy* pRegions) const override; 905 906 void PreCallRecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, 907 VkImageLayout dstImageLayout, uint32_t regionCount, 908 const VkBufferImageCopy* pRegions) override; 909 910 bool PreCallValidateCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, 911 const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) const override; 912 913 void PreCallRecordCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, 914 const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) override; 915 916 bool PreCallValidateGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, 917 VkSubresourceLayout* pLayout) const override; 918 bool ValidateCreateImageANDROID(const debug_report_data* report_data, const VkImageCreateInfo* create_info) const; 919 bool ValidateCreateImageViewANDROID(const VkImageViewCreateInfo* create_info) const; 920 bool ValidateGetImageSubresourceLayoutANDROID(const VkImage image) const; 921 bool ValidatePhysicalDeviceQueueFamilies(uint32_t queue_family_count, const uint32_t* queue_families, const char* cmd_name, 922 const char* array_parameter_name, const char* vuid) const; 923 bool ValidateAllocateMemoryANDROID(const VkMemoryAllocateInfo* alloc_info) const; 924 bool ValidateGetImageMemoryRequirementsANDROID(const VkImage image, const char* func_name) const; 925 bool ValidateGetPhysicalDeviceImageFormatProperties2ANDROID(const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, 926 const VkImageFormatProperties2* pImageFormatProperties) const; 927 bool ValidateBufferImportedHandleANDROID(const char* func_name, VkExternalMemoryHandleTypeFlags handleType, 928 VkDeviceMemory memory, VkBuffer buffer) const; 929 bool ValidateImageImportedHandleANDROID(const char* func_name, VkExternalMemoryHandleTypeFlags handleType, 930 VkDeviceMemory memory, VkImage image) const; 931 bool PreCallValidateCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, 932 const VkAllocationCallbacks* pAllocator, 933 VkPipelineCache* pPipelineCache) const override; 934 bool PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 935 const VkGraphicsPipelineCreateInfo* pCreateInfos, 936 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 937 void* cgpl_state) const override; 938 bool PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 939 const VkComputePipelineCreateInfo* pCreateInfos, 940 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 941 void* pipe_state) const override; 942 bool PreCallValidateGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, 943 uint32_t* pExecutableCount, 944 VkPipelineExecutablePropertiesKHR* pProperties) const override; 945 bool ValidatePipelineExecutableInfo(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, 946 const char* caller_name, const char* feature_vuid) const; 947 bool PreCallValidateGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, 948 uint32_t* pStatisticCount, 949 VkPipelineExecutableStatisticKHR* pStatistics) const override; 950 bool PreCallValidateGetPipelineExecutableInternalRepresentationsKHR( 951 VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, 952 VkPipelineExecutableInternalRepresentationKHR* pStatistics) const override; 953 bool PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, 954 const VkAllocationCallbacks* pAllocator, 955 VkPipelineLayout* pPipelineLayout) const override; 956 bool PreCallValidateAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, 957 VkDescriptorSet* pDescriptorSets, void* ads_state) const override; 958 bool PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, 959 const VkRayTracingPipelineCreateInfoNV* pCreateInfos, 960 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 961 void* pipe_state) const override; 962 bool PreCallValidateCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, 963 VkPipelineCache pipelineCache, uint32_t count, 964 const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, 965 const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, 966 void* pipe_state) const override; 967 bool PreCallValidateCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, 968 VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, 969 VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, 970 VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, 971 VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, 972 VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, 973 uint32_t width, uint32_t height, uint32_t depth) const override; 974 bool PreCallValidateCmdTraceRaysKHR(VkCommandBuffer commandBuffer, 975 const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, 976 const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, 977 const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, 978 const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width, 979 uint32_t height, uint32_t depth) const override; 980 bool PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, 981 const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, 982 const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, 983 const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, 984 const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, 985 VkDeviceAddress indirectDeviceAddress) const override; 986 bool PreCallValidateCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, 987 const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const override; 988 void PostCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, 989 const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, VkResult result) override; 990 bool PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, 991 VkDeviceSize dataSize, const void* pData) const override; 992 bool PreCallValidateGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, 993 VkQueue* pQueue) const override; 994 bool PreCallValidateGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) const override; 995 bool PreCallValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, 996 const VkAllocationCallbacks* pAllocator, 997 VkSamplerYcbcrConversion* pYcbcrConversion) const override; 998 bool PreCallValidateCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, 999 const VkAllocationCallbacks* pAllocator, 1000 VkSamplerYcbcrConversion* pYcbcrConversion) const override; 1001 bool PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, 1002 const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) const override; 1003 bool PreCallValidateCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, 1004 const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) const override; 1005 void PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) override; 1006 bool PreCallValidateQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, 1007 VkFence fence) const override; 1008 void PostCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence, 1009 VkResult result) override; 1010 bool PreCallValidateQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2KHR* pSubmits, 1011 VkFence fence) const override; 1012 void PostCallRecordQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2KHR* pSubmits, VkFence fence, 1013 VkResult result) override; 1014 bool PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, 1015 const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) const override; 1016 bool PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks* pAllocator) const override; 1017 bool PreCallValidateWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, 1018 uint64_t timeout) const override; 1019 bool PreCallValidateQueueWaitIdle(VkQueue queue) const override; 1020 bool PreCallValidateDeviceWaitIdle(VkDevice device) const override; 1021 bool PreCallValidateCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, 1022 const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore) const override; 1023 bool PreCallValidateWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) const override; 1024 bool PreCallValidateWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) const override; 1025 bool PreCallValidateDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator) const override; 1026 bool PreCallValidateDestroySemaphore(VkDevice device, VkSemaphore semaphore, 1027 const VkAllocationCallbacks* pAllocator) const override; 1028 bool PreCallValidateDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator) const override; 1029 bool PreCallValidateDestroyQueryPool(VkDevice device, VkQueryPool queryPool, 1030 const VkAllocationCallbacks* pAllocator) const override; 1031 bool ValidateGetQueryPoolResultsQueries(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const; 1032 bool ValidatePerformanceQueryResults(const char* cmd_name, const QUERY_POOL_STATE* query_pool_state, uint32_t firstQuery, 1033 uint32_t queryCount, VkQueryResultFlags flags) const; 1034 bool ValidateGetQueryPoolPerformanceResults(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, void* pData, 1035 VkDeviceSize stride, VkQueryResultFlags flags, const char* apiName) const; 1036 bool PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, 1037 size_t dataSize, void* pData, VkDeviceSize stride, 1038 VkQueryResultFlags flags) const override; 1039 bool PreCallValidateBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, 1040 const VkBindBufferMemoryInfo* pBindInfos) const override; 1041 bool PreCallValidateBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, 1042 const VkBindBufferMemoryInfo* pBindInfos) const override; 1043 bool PreCallValidateBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, 1044 VkDeviceSize memoryOffset) const override; 1045 bool PreCallValidateGetImageMemoryRequirements(VkDevice device, VkImage image, 1046 VkMemoryRequirements* pMemoryRequirements) const override; 1047 bool PreCallValidateGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, 1048 VkMemoryRequirements2* pMemoryRequirements) const override; 1049 bool PreCallValidateGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, 1050 VkMemoryRequirements2* pMemoryRequirements) const override; 1051 bool PreCallValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, 1052 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, 1053 VkImageFormatProperties2* pImageFormatProperties) const override; 1054 bool PreCallValidateGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, 1055 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, 1056 VkImageFormatProperties2* pImageFormatProperties) const override; 1057 bool PreCallValidateDestroyPipeline(VkDevice device, VkPipeline pipeline, 1058 const VkAllocationCallbacks* pAllocator) const override; 1059 bool PreCallValidateDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator) const override; 1060 bool PreCallValidateDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, 1061 const VkAllocationCallbacks* pAllocator) const override; 1062 bool PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, 1063 const VkCommandBuffer* pCommandBuffers) const override; 1064 bool PreCallValidateCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, 1065 const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) const override; 1066 bool PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, 1067 const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) const override; 1068 bool PreCallValidateDestroyCommandPool(VkDevice device, VkCommandPool commandPool, 1069 const VkAllocationCallbacks* pAllocator) const override; 1070 bool PreCallValidateResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) const override; 1071 bool PreCallValidateResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) const override; 1072 bool PreCallValidateDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, 1073 const VkAllocationCallbacks* pAllocator) const override; 1074 bool PreCallValidateDestroyRenderPass(VkDevice device, VkRenderPass renderPass, 1075 const VkAllocationCallbacks* pAllocator) const override; 1076 bool PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, 1077 const VkAllocationCallbacks* pAllocator, 1078 VkDescriptorSetLayout* pSetLayout) const override; 1079 bool PreCallValidateResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, 1080 VkDescriptorPoolResetFlags flags) const override; 1081 bool PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, 1082 const VkDescriptorSet* pDescriptorSets) const override; 1083 bool PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, 1084 const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, 1085 const VkCopyDescriptorSet* pDescriptorCopies) const override; 1086 bool PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, 1087 const VkCommandBufferBeginInfo* pBeginInfo) const override; 1088 bool PreCallValidateCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, 1089 const VkRenderingInfoKHR* pRenderingInfo) const override; 1090 bool ValidateRenderingAttachmentInfoKHR(VkCommandBuffer commandBuffer, const VkRenderingAttachmentInfoKHR* pAttachments) const; 1091 bool PreCallValidateCmdEndRenderingKHR(VkCommandBuffer commandBuffer) const override; 1092 bool PreCallValidateEndCommandBuffer(VkCommandBuffer commandBuffer) const override; 1093 bool PreCallValidateResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) const override; 1094 bool PreCallValidateCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, 1095 VkPipeline pipeline) const override; 1096 bool ForbidInheritedViewportScissor(VkCommandBuffer, const CMD_BUFFER_STATE*, const char* vuid, const char* commandName) const; 1097 bool PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, 1098 const VkViewport* pViewports) const override; 1099 bool PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, 1100 const VkRect2D* pScissors) const override; 1101 bool PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, 1102 uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors) const override; 1103 1104 bool PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, 1105 const VkViewportWScalingNV* pViewportWScalings) const override; 1106 1107 bool PreCallValidateCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, 1108 VkImageLayout imageLayout) const override; 1109 bool PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, 1110 uint32_t viewportCount, 1111 const VkShadingRatePaletteNV* pShadingRatePalettes) const override; 1112 bool ValidateGeometryTrianglesNV(const VkGeometryTrianglesNV& triangles, const char* func_name) const; 1113 bool ValidateGeometryAABBNV(const VkGeometryAABBNV& geometry, const char* func_name) const; 1114 bool ValidateGeometryNV(const VkGeometryNV& geometry, const char* func_name) const; 1115 bool PreCallValidateCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, 1116 const VkAllocationCallbacks* pAllocator, 1117 VkAccelerationStructureNV* pAccelerationStructure) const override; 1118 bool PreCallValidateCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, 1119 const VkAllocationCallbacks* pAllocator, 1120 VkAccelerationStructureKHR* pAccelerationStructure) const override; 1121 bool PreCallValidateBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, 1122 const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) const override; 1123 bool PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, 1124 size_t dataSize, void* pData) const override; 1125 bool ValidateAccelerationBuffers(uint32_t info_index, const VkAccelerationStructureBuildGeometryInfoKHR& info, 1126 const char* func_name) const; 1127 bool PreCallValidateCmdBuildAccelerationStructuresKHR( 1128 VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, 1129 const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) const override; 1130 1131 bool PreCallValidateBuildAccelerationStructuresKHR( 1132 VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, 1133 const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, 1134 const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) const override; 1135 bool PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, 1136 VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, 1137 VkAccelerationStructureNV dst, VkAccelerationStructureNV src, 1138 VkBuffer scratch, VkDeviceSize scratchOffset) const override; 1139 bool PreCallValidateCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, 1140 VkAccelerationStructureNV src, 1141 VkCopyAccelerationStructureModeNV mode) const override; 1142 bool PreCallValidateDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, 1143 const VkAllocationCallbacks* pAllocator) const override; 1144 bool PreCallValidateDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, 1145 const VkAllocationCallbacks* pAllocator) const override; 1146 bool PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) const override; 1147 bool PreCallValidateCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, 1148 uint16_t lineStipplePattern) const override; 1149 bool PreCallValidateCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, 1150 float depthBiasSlopeFactor) const override; 1151 bool PreCallValidateCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) const override; 1152 bool PreCallValidateCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) const override; 1153 bool PreCallValidateCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, 1154 uint32_t compareMask) const override; 1155 bool PreCallValidateCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, 1156 uint32_t writeMask) const override; 1157 bool PreCallValidateCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, 1158 uint32_t reference) const override; 1159 bool PreCallValidateCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, 1160 VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, 1161 const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, 1162 const uint32_t* pDynamicOffsets) const override; 1163 bool PreCallValidateCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, 1164 VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, 1165 const VkWriteDescriptorSet* pDescriptorWrites) const override; 1166 bool PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1167 VkIndexType indexType) const override; 1168 bool PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, 1169 const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) const override; 1170 bool PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, 1171 uint32_t firstInstance) const override; 1172 bool PreCallValidateCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawInfoEXT* pVertexInfo, 1173 uint32_t instanceCount, uint32_t firstInstance, uint32_t stride) const override; 1174 bool ValidateCmdDrawIndexedBufferSize(const CMD_BUFFER_STATE& cb_state, uint32_t indexCount, uint32_t firstIndex, 1175 const char* caller, const char* first_index_vuid) const; 1176 bool PreCallValidateCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, 1177 uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) const override; 1178 bool PreCallValidateCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, 1179 const VkMultiDrawIndexedInfoEXT* pIndexInfo, uint32_t instanceCount, 1180 uint32_t firstInstance, uint32_t stride, 1181 const int32_t* pVertexOffset) const override; 1182 bool PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1183 uint32_t drawCount, uint32_t stride) const override; 1184 bool ValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1185 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1186 uint32_t stride, CMD_TYPE cmd_type) const; 1187 bool PreCallValidateCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1188 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1189 uint32_t stride) const override; 1190 bool PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1191 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1192 uint32_t stride) const override; 1193 bool PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) const override; 1194 bool PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) const override; 1195 bool PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, 1196 uint32_t stride) const override; 1197 bool ValidateBaseGroups(const CMD_BUFFER_STATE& cb_state, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, 1198 const char* apiName) const; 1199 bool PreCallValidateCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, 1200 uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, 1201 uint32_t groupCountZ) const override; 1202 bool PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, 1203 uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, 1204 uint32_t groupCountZ) const override; 1205 bool PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const override; 1206 bool PreCallValidateCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, 1207 const VkDependencyInfoKHR* pDependencyInfo) const override; 1208 bool PreCallValidateCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const override; 1209 bool PreCallValidateCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, 1210 VkPipelineStageFlags2KHR stageMask) const override; 1211 bool PreCallValidateCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1212 VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, 1213 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1214 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1215 uint32_t imageMemoryBarrierCount, 1216 const VkImageMemoryBarrier* pImageMemoryBarriers) const override; 1217 bool PreCallValidateCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1218 const VkDependencyInfoKHR* pDependencyInfos) const override; 1219 void PreCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1220 VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, 1221 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1222 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1223 uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) override; 1224 void PreCallRecordCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1225 const VkDependencyInfoKHR* pDependencyInfos) override; 1226 void PostCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1227 VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, 1228 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1229 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1230 uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) override; 1231 void PostCallRecordCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, 1232 const VkDependencyInfoKHR* pDependencyInfos) override; 1233 bool PreCallValidateCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, 1234 VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, 1235 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1236 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1237 uint32_t imageMemoryBarrierCount, 1238 const VkImageMemoryBarrier* pImageMemoryBarriers) const override; 1239 bool PreCallValidateCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, 1240 const VkDependencyInfoKHR* pDependencyInfo) const override; 1241 void PreCallRecordCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, 1242 VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, 1243 uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, 1244 uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, 1245 uint32_t imageMemoryBarrierCount, 1246 const VkImageMemoryBarrier* pImageMemoryBarriers) override; 1247 void PreCallRecordCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, const VkDependencyInfoKHR* pDependencyInfo) override; 1248 1249 void EnqueueVerifyBeginQuery(VkCommandBuffer, const QueryObject& query_obj, const char* func); 1250 bool PreCallValidateCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, 1251 VkFlags flags) const override; 1252 void PreCallRecordCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags) override; 1253 void EnqueueVerifyEndQuery(VkCommandBuffer, const QueryObject& query_obj); 1254 bool PreCallValidateCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) const override; 1255 void PreCallRecordCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) override; 1256 bool ValidateQueryPoolIndex(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, const char* func_name, 1257 const char* first_vuid, const char* sum_vuid) const; 1258 bool PreCallValidateCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 1259 uint32_t queryCount) const override; 1260 bool PreCallValidateCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 1261 uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, 1262 VkDeviceSize stride, VkQueryResultFlags flags) const override; 1263 void PreCallRecordCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, 1264 uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, 1265 VkQueryResultFlags flags) override; 1266 bool PreCallValidateCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, 1267 uint32_t offset, uint32_t size, const void* pValues) const override; 1268 bool PreCallValidateCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, 1269 VkQueryPool queryPool, uint32_t query) const override; 1270 bool PreCallValidateCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage, VkQueryPool queryPool, 1271 uint32_t query) const override; 1272 void PreCallRecordCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, 1273 uint32_t slot) override; 1274 void PreCallRecordCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage, VkQueryPool queryPool, 1275 uint32_t query) override; 1276 void PreCallRecordCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, 1277 uint32_t accelerationStructureCount, 1278 const VkAccelerationStructureKHR* pAccelerationStructures, 1279 VkQueryType queryType, VkQueryPool queryPool, 1280 uint32_t firstQuery) override; 1281 bool PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, 1282 const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) const override; 1283 bool PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, 1284 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const override; 1285 bool PreCallValidateGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory mem, VkDeviceSize* pCommittedMem) const override; 1286 1287 bool ValidateFragmentShadingRateAttachments(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo) const; 1288 bool ValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, 1289 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, 1290 const char* function_name) const; 1291 bool PreCallValidateCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, 1292 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const override; 1293 bool PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, 1294 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const override; 1295 bool PreCallValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1296 VkSubpassContents contents) const override; 1297 void PreCallRecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1298 VkSubpassContents contents) override; 1299 bool PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1300 const VkSubpassBeginInfo* pSubpassBeginInfo) const override; 1301 bool PreCallValidateCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1302 const VkSubpassBeginInfo* pSubpassBeginInfo) const override; 1303 void PreCallRecordCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1304 const VkSubpassBeginInfo* pSubpassBeginInfo) override; 1305 void PreCallRecordCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, 1306 const VkSubpassBeginInfo* pSubpassBeginInfo) override; 1307 bool PreCallValidateCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) const override; 1308 void PostCallRecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) override; 1309 bool PreCallValidateCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, 1310 const VkSubpassEndInfo* pSubpassEndInfo) const override; 1311 void PostCallRecordCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, 1312 const VkSubpassEndInfo* pSubpassEndInfo) override; 1313 bool PreCallValidateCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, 1314 const VkSubpassEndInfo* pSubpassEndInfo) const override; 1315 void PostCallRecordCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, 1316 const VkSubpassEndInfo* pSubpassEndInfo) override; 1317 bool PreCallValidateCmdEndRenderPass(VkCommandBuffer commandBuffer) const override; 1318 void PostCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer) override; 1319 bool PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) const override; 1320 void PostCallRecordCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) override; 1321 bool PreCallValidateCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) const override; 1322 void PostCallRecordCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) override; 1323 class ViewportScissorInheritanceTracker; 1324 bool PreCallValidateCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, 1325 const VkCommandBuffer* pCommandBuffers) const override; 1326 bool PreCallValidateMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, 1327 void** ppData) const override; 1328 bool PreCallValidateUnmapMemory(VkDevice device, VkDeviceMemory mem) const override; 1329 bool PreCallValidateFlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, 1330 const VkMappedMemoryRange* pMemRanges) const override; 1331 bool PreCallValidateInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, 1332 const VkMappedMemoryRange* pMemRanges) const override; 1333 bool PreCallValidateBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, 1334 VkDeviceSize memoryOffset) const override; 1335 bool PreCallValidateBindImageMemory2(VkDevice device, uint32_t bindInfoCount, 1336 const VkBindImageMemoryInfo* pBindInfos) const override; 1337 bool PreCallValidateBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, 1338 const VkBindImageMemoryInfo* pBindInfos) const override; 1339 bool PreCallValidateSetEvent(VkDevice device, VkEvent event) const override; 1340 bool PreCallValidateResetEvent(VkDevice device, VkEvent event) const override; 1341 bool PreCallValidateGetEventStatus(VkDevice device, VkEvent event) const override; 1342 bool ValidateSparseMemoryBind(const VkSparseMemoryBind* bind, const char* func_name, const char* parameter_name) const; 1343 bool PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, 1344 VkFence fence) const override; 1345 bool ValidateSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo, const char* api_name) const; 1346 bool PreCallValidateSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) const override; 1347 bool PreCallValidateSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) const override; 1348 bool PreCallValidateImportSemaphoreFdKHR(VkDevice device, 1349 const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) const override; 1350 #ifdef VK_USE_PLATFORM_WIN32_KHR 1351 bool PreCallValidateImportSemaphoreWin32HandleKHR( 1352 VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) const override; 1353 bool PreCallValidateImportFenceWin32HandleKHR( 1354 VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) const override; 1355 #endif // VK_USE_PLATFORM_WIN32_KHR 1356 bool PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) const override; 1357 1358 bool PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, 1359 const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) const override; 1360 void PreCallRecordDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, 1361 const VkAllocationCallbacks* pAllocator) override; 1362 void PostCallRecordGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, 1363 VkImage* pSwapchainImages, VkResult result) override; 1364 bool PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) const override; 1365 bool PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, 1366 const VkSwapchainCreateInfoKHR* pCreateInfos, 1367 const VkAllocationCallbacks* pAllocator, 1368 VkSwapchainKHR* pSwapchains) const override; 1369 bool PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, 1370 VkFence fence, uint32_t* pImageIndex) const override; 1371 bool PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, 1372 uint32_t* pImageIndex) const override; 1373 bool PreCallValidateWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, 1374 uint64_t timeout) const override; 1375 bool PreCallValidateDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, 1376 const VkAllocationCallbacks* pAllocator) const override; 1377 bool PreCallValidateGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 1378 VkSurfaceKHR surface, VkBool32* pSupported) const override; 1379 bool PreCallValidateCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, 1380 const VkAllocationCallbacks* pAllocator, 1381 VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) const override; 1382 bool PreCallValidateCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, 1383 const VkAllocationCallbacks* pAllocator, 1384 VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) const override; 1385 bool PreCallValidateUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, 1386 VkDescriptorUpdateTemplate descriptorUpdateTemplate, 1387 const void* pData) const override; 1388 bool PreCallValidateUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, 1389 VkDescriptorUpdateTemplate descriptorUpdateTemplate, 1390 const void* pData) const override; 1391 1392 bool PreCallValidateCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, 1393 VkDescriptorUpdateTemplate descriptorUpdateTemplate, 1394 VkPipelineLayout layout, uint32_t set, 1395 const void* pData) const override; 1396 bool PreCallValidateGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, 1397 uint32_t* pDisplayCount, VkDisplayKHR* pDisplays) const override; 1398 bool PreCallValidateGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, 1399 VkDisplayPlaneCapabilitiesKHR* pCapabilities) const override; 1400 bool PreCallValidateGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice, 1401 const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, 1402 VkDisplayPlaneCapabilities2KHR* pCapabilities) const override; 1403 bool PreCallValidateCreateDisplayPlaneSurfaceKHR(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, 1404 const VkAllocationCallbacks* pAllocator, 1405 VkSurfaceKHR* pSurface) const override; 1406 bool PreCallValidateCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) const override; 1407 1408 bool PreCallValidateCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, 1409 VkQueryControlFlags flags, uint32_t index) const override; 1410 void PreCallRecordCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, 1411 VkQueryControlFlags flags, uint32_t index) override; 1412 bool PreCallValidateCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, 1413 uint32_t index) const override; 1414 void PreCallRecordCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, 1415 uint32_t index) override; 1416 1417 bool PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, 1418 uint32_t discardRectangleCount, 1419 const VkRect2D* pDiscardRectangles) const override; 1420 bool PreCallValidateCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, 1421 const VkSampleLocationsInfoEXT* pSampleLocationsInfo) const override; 1422 bool ValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, 1423 VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, 1424 CMD_TYPE cmd_type) const; 1425 bool PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1426 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1427 uint32_t stride) const override; 1428 bool PreCallValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1429 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1430 uint32_t stride) const override; 1431 bool PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, 1432 VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, 1433 uint32_t counterOffset, uint32_t vertexStride) const override; 1434 bool PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) const override; 1435 bool PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1436 uint32_t drawCount, uint32_t stride) const override; 1437 bool PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, 1438 VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, 1439 uint32_t stride) const override; 1440 bool ValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const char* apiName) const; 1441 bool PreCallValidateGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const override; 1442 bool PreCallValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const override; 1443 bool PreCallValidateGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const override; 1444 bool ValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const char* apiName) const; 1445 bool ValidateGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, 1446 const char* apiName) const; 1447 bool PreCallValidateGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const override; 1448 bool PreCallValidateGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, 1449 const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) const override; 1450 bool PreCallValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const override; 1451 bool PreCallValidateGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, 1452 const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) const override; 1453 bool ValidateCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask, CMD_TYPE cmd_type) const; 1454 bool PreCallValidateCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) const override; 1455 bool PreCallValidateCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) const override; 1456 bool ValidateGetSemaphoreCounterValue(VkDevice device, VkSemaphore sempahore, uint64_t* pValue, const char* apiName) const; 1457 bool PreCallValidateGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore sempahore, uint64_t* pValue) const override; 1458 bool PreCallValidateGetSemaphoreCounterValue(VkDevice device, VkSemaphore sempahore, uint64_t* pValue) const override; 1459 bool ValidateComputeWorkGroupSizes(const SHADER_MODULE_STATE* shader, const spirv_inst_iter& entrypoint, 1460 const PipelineStageState& stage_state) const; 1461 1462 bool ValidateQueryRange(VkDevice device, VkQueryPool queryPool, uint32_t totalCount, uint32_t firstQuery, uint32_t queryCount, 1463 const char* vuid_badfirst, const char* vuid_badrange, const char* apiName) const; 1464 bool ValidateResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, 1465 const char* apiName) const; 1466 bool PreCallValidateResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, 1467 uint32_t queryCount) const override; 1468 bool PreCallValidateResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, 1469 uint32_t queryCount) const override; 1470 bool ValidateComputeWorkGroupInvocations(CMD_BUFFER_STATE* cb_state, uint32_t groupCountX, uint32_t groupCountY, 1471 uint32_t groupCountZ); 1472 bool ValidateQueryPoolStride(const std::string& vuid_not_64, const std::string& vuid_64, const VkDeviceSize stride, 1473 const char* parameter_name, const uint64_t parameter_value, const VkQueryResultFlags flags) const; 1474 bool ValidateCmdDrawStrideWithStruct(VkCommandBuffer commandBuffer, const std::string& vuid, const uint32_t stride, 1475 const char* struct_name, const uint32_t struct_size) const; 1476 bool ValidateCmdDrawStrideWithBuffer(VkCommandBuffer commandBuffer, const std::string& vuid, const uint32_t stride, 1477 const char* struct_name, const uint32_t struct_size, const uint32_t drawCount, 1478 const VkDeviceSize offset, const BUFFER_STATE* buffer_state) const; 1479 bool PreCallValidateReleaseProfilingLockKHR(VkDevice device) const override; 1480 bool PreCallValidateCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker) const override; 1481 bool PreCallValidateCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, 1482 uint32_t bindingCount, const VkBuffer* pBuffers, 1483 const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) const override; 1484 bool PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, 1485 uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, 1486 const VkDeviceSize* pCounterBufferOffsets) const override; 1487 bool PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, 1488 uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, 1489 const VkDeviceSize* pCounterBufferOffsets) const override; 1490 bool PreCallValidateCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, 1491 uint32_t pipelineStackSize) const override; 1492 bool PreCallValidateGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, 1493 VkShaderGroupShaderKHR groupShader) const override; 1494 1495 bool PreCallValidateWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, 1496 const VkAccelerationStructureKHR* pAccelerationStructures, 1497 VkQueryType queryType, size_t dataSize, void* pData, 1498 size_t stride) const override; 1499 1500 bool PreCallValidateCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, 1501 uint32_t accelerationStructureCount, 1502 const VkAccelerationStructureKHR* pAccelerationStructures, 1503 VkQueryType queryType, VkQueryPool queryPool, 1504 uint32_t firstQuery) const override; 1505 1506 bool PreCallValidateCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, 1507 uint32_t accelerationStructureCount, 1508 const VkAccelerationStructureNV* pAccelerationStructures, 1509 VkQueryType queryType, VkQueryPool queryPool, 1510 uint32_t firstQuery) const override; 1511 1512 // Calculates the total number of shader groups taking libraries into account. 1513 uint32_t CalcTotalShaderGroupCount(const PIPELINE_STATE* pipelineState) const; 1514 1515 bool PreCallValidateGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, 1516 uint32_t groupCount, size_t dataSize, void* pData) const override; 1517 1518 bool PreCallValidateGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, 1519 uint32_t groupCount, size_t dataSize, 1520 void* pData) const override; 1521 1522 bool PreCallValidateCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, 1523 const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, 1524 const VkDeviceAddress* pIndirectDeviceAddresses, 1525 const uint32_t* pIndirectStrides, 1526 const uint32_t* const* ppMaxPrimitiveCounts) const override; 1527 bool ValidateCopyAccelerationStructureInfoKHR(const VkCopyAccelerationStructureInfoKHR* pInfo, const char* api_name) const; 1528 bool PreCallValidateCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, 1529 const VkCopyAccelerationStructureInfoKHR* pInfo) const override; 1530 bool PreCallValidateCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, 1531 const VkCopyAccelerationStructureInfoKHR* pInfo) const override; 1532 bool PreCallValidateCmdCopyAccelerationStructureToMemoryKHR( 1533 VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) const override; 1534 bool PreCallValidateCmdCopyMemoryToAccelerationStructureKHR( 1535 VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) const override; 1536 1537 bool PreCallValidateCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp) const override; 1538 bool PreCallValidateCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints) const override; 1539 bool PreCallValidateCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer, 1540 VkBool32 rasterizerDiscardEnable) const override; 1541 bool PreCallValidateCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) const override; 1542 bool PreCallValidateCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer, 1543 VkBool32 primitiveRestartEnable) const override; 1544 1545 bool PreCallValidateCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) const override; 1546 bool PreCallValidateCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) const override; 1547 bool PreCallValidateCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, 1548 VkPrimitiveTopology primitiveTopology) const override; 1549 bool PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, 1550 const VkViewport* pViewports) const override; 1551 bool PreCallValidateCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, 1552 const VkRect2D* pScissors) const override; 1553 bool PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, 1554 const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, 1555 const VkDeviceSize* pStrides) const override; 1556 bool PreCallValidateCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) const override; 1557 bool PreCallValidateCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) const override; 1558 bool PreCallValidateCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) const override; 1559 bool PreCallValidateCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, 1560 VkBool32 depthBoundsTestEnable) const override; 1561 bool PreCallValidateCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) const override; 1562 bool PreCallValidateCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, 1563 VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) const override; 1564 bool PreCallValidateCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, 1565 VkEvent* pEvent) const override; 1566 bool PreCallValidateCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize, 1567 const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) const override; 1568 bool PreCallValidateCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer, uint32_t attachmentCount, 1569 const VkBool32* pColorWriteEnables) const override; 1570 bool PreCallValidateCmdBeginConditionalRenderingEXT( 1571 VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) const override; 1572 bool PreCallValidateCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) const override; 1573 #ifdef VK_USE_PLATFORM_WIN32_KHR 1574 bool PreCallValidateAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) const override; 1575 #endif 1576 1577 bool ValidatePhysicalDeviceSurfaceSupport(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, const char* vuid, 1578 const char* func_name) const; 1579 #ifdef VK_USE_PLATFORM_WIN32_KHR 1580 bool PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, 1581 VkDeviceGroupPresentModeFlagsKHR* pModes) const override; 1582 bool PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT(VkPhysicalDevice physicalDevice, 1583 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, 1584 uint32_t* pPresentModeCount, 1585 VkPresentModeKHR* pPresentModes) const override; 1586 #endif 1587 bool PreCallValidateGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, 1588 VkDeviceGroupPresentModeFlagsKHR* pModes) const override; 1589 bool PreCallValidateGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 1590 uint32_t* pRectCount, VkRect2D* pRects) const override; 1591 bool PreCallValidateGetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 1592 VkSurfaceCapabilities2EXT* pSurfaceCapabilities) const override; 1593 bool PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, 1594 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, 1595 VkSurfaceCapabilities2KHR* pSurfaceCapabilities) const override; 1596 bool PreCallValidateGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 1597 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) const override; 1598 bool PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, 1599 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, 1600 uint32_t* pSurfaceFormatCount, 1601 VkSurfaceFormat2KHR* pSurfaceFormats) const override; 1602 bool PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 1603 uint32_t* pSurfaceFormatCount, 1604 VkSurfaceFormatKHR* pSurfaceFormats) const override; 1605 bool PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, 1606 uint32_t* pPresentModeCount, 1607 VkPresentModeKHR* pPresentModes) const override; 1608 void PostCallRecordGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, 1609 size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags, 1610 VkResult result) override; 1611 1612 #ifdef VK_USE_PLATFORM_ANDROID_KHR 1613 bool PreCallValidateGetAndroidHardwareBufferPropertiesANDROID( 1614 VkDevice device, const struct AHardwareBuffer* buffer, 1615 VkAndroidHardwareBufferPropertiesANDROID* pProperties) const override; 1616 bool PreCallValidateGetMemoryAndroidHardwareBufferANDROID(VkDevice device, 1617 const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, 1618 struct AHardwareBuffer** pBuffer) const override; 1619 #endif // VK_USE_PLATFORM_ANDROID_KHR 1620 #ifdef VK_USE_PLATFORM_WAYLAND_KHR 1621 bool PreCallValidateGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 1622 struct wl_display* display) const override; 1623 #endif // VK_USE_PLATFORM_WAYLAND_KHR 1624 #ifdef VK_USE_PLATFORM_WIN32_KHR 1625 bool PreCallValidateGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, 1626 uint32_t queueFamilyIndex) const override; 1627 #endif // VK_USE_PLATFORM_WIN32_KHR 1628 #ifdef VK_USE_PLATFORM_XCB_KHR 1629 bool PreCallValidateGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 1630 xcb_connection_t* connection, 1631 xcb_visualid_t visual_id) const override; 1632 #endif // VK_USE_PLATFORM_XCB_KHR 1633 #ifdef VK_USE_PLATFORM_XLIB_KHR 1634 bool PreCallValidateGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, 1635 Display* dpy, VisualID visualID) const override; 1636 #endif // VK_USE_PLATFORM_XLIB_KHR 1637 }; // Class CoreChecks 1638