#include <assert.h>
#include <vulkan/vk_enum_string_helper.h>
#include "generated/chassis.h"
#include "generated/pnext_chain_extraction.h"
#include "core_validation.h"
#include "cc_buffer_address.h"
#include "state_tracker/image_state.h"
#include "state_tracker/buffer_state.h"
#include "state_tracker/ray_tracing_state.h"
bool CoreChecks::VerifyBoundMemoryIsValid(const vvl::DeviceMemory *mem_state, const LogObjectList &objlist,
const VulkanTypedHandle &typed_handle, const Location &loc, const char *vuid) const { … }
bool CoreChecks::VerifyBoundMemoryIsDeviceVisible(const vvl::DeviceMemory *mem_state, const LogObjectList &objlist,
const VulkanTypedHandle &typed_handle, const Location &loc,
const char *vuid) const { … }
bool CoreChecks::ValidateMemoryIsBoundToImage(const LogObjectList &objlist, const vvl::Image &image_state, const Location &loc,
const char *vuid) const { … }
bool CoreChecks::ValidateAccelStructsMemoryDoNotOverlap(const Location &function_loc, LogObjectList objlist,
const vvl::AccelerationStructureKHR &accel_struct_a, const Location &loc_a,
const vvl::AccelerationStructureKHR &accel_struct_b, const Location &loc_b,
const char *vuid) const { … }
static bool ValidateBufferAndAccelStructsMemoryDoNotOverlap(const CoreChecks &validator, const vvl::Buffer &buffer_a,
sparse_container::range<VkDeviceSize> range_a,
const vvl::AccelerationStructureKHR &accel_struct_b,
const Location &loc_b, std::string *err_msg) { … }
bool CoreChecks::ValidateScratchMemoryNoOverlap(const Location &function_loc, LogObjectList objlist,
const vvl::span<vvl::Buffer *const> &scratches_a, VkDeviceAddress scratch_a_address,
VkDeviceSize scratch_a_size, const Location &loc_scratches_a,
const vvl::AccelerationStructureKHR *src_accel_struct,
const Location &loc_src_accel_struct,
const vvl::AccelerationStructureKHR &dst_accel_struct,
const Location &loc_dst_accel_struct,
const vvl::span<vvl::Buffer *const> &scratches_b, VkDeviceAddress scratch_b_address,
VkDeviceSize scratch_b_size, const Location *loc_scratches_b) const { … }
bool CoreChecks::ValidateAccelStructBufferMemoryIsHostVisible(const vvl::AccelerationStructureKHR &accel_struct,
const Location &buffer_loc, const char *vuid) const { … }
bool CoreChecks::ValidateAccelStructBufferMemoryIsNotMultiInstance(const vvl::AccelerationStructureKHR &accel_struct,
const Location &accel_struct_loc, const char *vuid) const { … }
bool CoreChecks::ValidateSetMemBinding(const vvl::DeviceMemory &memory_state, const vvl::Bindable &mem_binding,
const Location &loc) const { … }
bool CoreChecks::IgnoreAllocationSize(const VkMemoryAllocateInfo &allocate_info) const { … }
bool CoreChecks::HasExternalMemoryImportSupport(const vvl::Buffer &buffer, VkExternalMemoryHandleTypeFlagBits handle_type) const { … }
bool CoreChecks::HasExternalMemoryImportSupport(const vvl::Image &image, VkExternalMemoryHandleTypeFlagBits handle_type) const { … }
bool CoreChecks::PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo,
const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator,
const ErrorObject &error_obj) const { … }
bool CoreChecks::ValidateInsertMemoryRange(const VulkanTypedHandle &typed_handle, const vvl::DeviceMemory &mem_info,
VkDeviceSize memoryOffset, const Location &loc) const { … }
bool CoreChecks::ValidateInsertImageMemoryRange(VkImage image, const vvl::DeviceMemory &mem_info, VkDeviceSize mem_offset,
const Location &loc) const { … }
bool CoreChecks::ValidateInsertBufferMemoryRange(VkBuffer buffer, const vvl::DeviceMemory &mem_info, VkDeviceSize mem_offset,
const Location &loc) const { … }
bool CoreChecks::ValidateMemoryTypes(const vvl::DeviceMemory &mem_info, const uint32_t memory_type_bits,
const Location &resource_loc, const char *vuid) const { … }
bool CoreChecks::ValidateBindBufferMemory(VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset, const void *pNext,
const Location &loc) const { … }
bool CoreChecks::PreCallValidateBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount,
const VkBindBufferMemoryInfo *pBindInfos, const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetImageMemoryRequirements(VkDevice device, VkImage image,
VkMemoryRequirements *pMemoryRequirements,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
VkMemoryRequirements2 *pMemoryRequirements,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
VkMemoryRequirements2 *pMemoryRequirements,
const ErrorObject &error_obj) const { … }
bool CoreChecks::ValidateMapMemory(const vvl::DeviceMemory &mem_info, VkDeviceSize offset, VkDeviceSize size,
const Location &offset_loc, const Location &size_loc) const { … }
bool CoreChecks::PreCallValidateMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size,
VkFlags flags, void **ppData, const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateMapMemory2KHR(VkDevice device, const VkMemoryMapInfoKHR *pMemoryMapInfo, void **ppData,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateUnmapMemory(VkDevice device, VkDeviceMemory memory, const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfoKHR *pMemoryUnmapInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::ValidateMemoryIsMapped(uint32_t mem_range_count, const VkMappedMemoryRange *mem_ranges,
const ErrorObject &error_obj) const { … }
bool CoreChecks::ValidateMappedMemoryRangeDeviceLimits(uint32_t mem_range_count, const VkMappedMemoryRange *mem_ranges,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
const VkMappedMemoryRange *pMemoryRanges,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
const VkMappedMemoryRange *pMemoryRanges,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMem,
const ErrorObject &error_obj) const { … }
bool CoreChecks::ValidateBindImageMemory(uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset,
const ErrorObject &error_obj) const { … }
void CoreChecks::PostCallRecordBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset,
const RecordObject &record_obj) { … }
bool CoreChecks::PreCallValidateBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos,
const ErrorObject &error_obj) const { … }
void CoreChecks::PostCallRecordBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos,
const RecordObject &record_obj) { … }
bool CoreChecks::PreCallValidateBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount,
const VkBindImageMemoryInfo *pBindInfos, const ErrorObject &error_obj) const { … }
void CoreChecks::PostCallRecordBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos,
const RecordObject &record_obj) { … }
bool CoreChecks::ValidateBufferSparseMemoryBindAlignments(const VkSparseMemoryBind &bind, const vvl::Buffer &buffer,
const Location &bind_loc, const Location &buffer_bind_info_loc) const { … }
bool CoreChecks::ValidateImageSparseMemoryBindAlignments(const VkSparseMemoryBind &bind, const vvl::Image &image,
const Location &bind_loc, const Location &image_bind_info_loc) const { … }
bool CoreChecks::ValidateSparseMemoryBind(const VkSparseMemoryBind &bind, const VkMemoryRequirements &requirements,
VkDeviceSize resource_size, VkExternalMemoryHandleTypeFlags external_handle_types,
const VulkanTypedHandle &resource_handle, const Location &loc) const { … }
bool CoreChecks::ValidateImageSubresourceSparseImageMemoryBind(vvl::Image const &image_state, VkImageSubresource const &subresource,
const Location &bind_loc, const Location &subresource_loc) const { … }
bool CoreChecks::ValidateSparseImageMemoryBind(vvl::Image const *image_state, VkSparseImageMemoryBind const &bind,
const Location &bind_loc, const Location &memory_loc) const { … }
bool CoreChecks::PreCallValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo *pInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetDeviceMemoryOpaqueCaptureAddress(VkDevice device,
const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device,
const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo,
const ErrorObject &error_obj) const { … }
bool CoreChecks::ValidateMemoryIsBoundToBuffer(LogObjectList objlist, const vvl::Buffer &buffer_state, const Location &buffer_loc,
const char *vuid) const { … }