#include <cassert>
#include <cinttypes>
#include <sstream>
#include <string>
#include <vector>
#include <vulkan/vk_enum_string_helper.h>
#include "core_validation.h"
#include "generated/spirv_grammar_helper.h"
#include "state_tracker/shader_stage_state.h"
#include "utils/hash_util.h"
#include "chassis/chassis_modification_state.h"
#include "state_tracker/descriptor_sets.h"
#include "state_tracker/render_pass_state.h"
#include "spirv-tools/optimizer.hpp"
bool CoreChecks::ValidateShaderInputAttachment(const spirv::Module &module_state, const vvl::Pipeline &pipeline,
const spirv::ResourceInterfaceVariable &variable, const Location &loc) const { … }
bool CoreChecks::ValidateConservativeRasterization(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const spirv::StatelessData &stateless_data, const Location &loc) const { … }
bool CoreChecks::ValidatePushConstantUsage(const spirv::Module &module_state, const vvl::Pipeline &pipeline,
const spirv::EntryPoint &entrypoint, const Location &loc) const { … }
static void TypeToDescriptorTypeSet(const spirv::Module &module_state, uint32_t type_id, uint32_t &descriptor_count,
vvl::unordered_set<uint32_t> &descriptor_type_set, bool is_khr) { … }
static std::string string_DescriptorTypeSet(const vvl::unordered_set<uint32_t> &descriptor_type_set) { … }
bool CoreChecks::ValidateShaderStageGroupNonUniform(const spirv::Module &module_state, const spirv::StatelessData &stateless_data,
VkShaderStageFlagBits stage, const Location &loc) const { … }
bool CoreChecks::ValidateMemoryScope(const spirv::Module &module_state, const spirv::Instruction &insn, const Location &loc) const { … }
bool CoreChecks::ValidateSubgroupRotateClustered(const spirv::Module &module_state, const spirv::Instruction &insn,
const Location &loc) const { … }
bool CoreChecks::ValidateShaderStorageImageFormatsVariables(const spirv::Module &module_state, const spirv::Instruction &insn,
const Location &loc) const { … }
VkComponentTypeKHR GetComponentType(const spirv::Instruction *insn) { … }
bool CoreChecks::ValidateCooperativeMatrix(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const ShaderStageState &stage_state, const uint32_t local_size_x,
const Location &loc) const { … }
bool CoreChecks::ValidateShaderResolveQCOM(const spirv::Module &module_state, VkShaderStageFlagBits stage,
const vvl::Pipeline &pipeline, const Location &loc) const { … }
bool CoreChecks::ValidateAtomicsTypes(const spirv::Module &module_state, const spirv::StatelessData &stateless_data,
const Location &loc) const { … }
bool CoreChecks::ValidateShaderFloatControl(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const spirv::StatelessData &stateless_data, const Location &loc) const { … }
bool CoreChecks::ValidateExecutionModes(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const spirv::StatelessData &stateless_data, const Location &loc) const { … }
bool CoreChecks::ValidateShaderExecutionModes(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
VkShaderStageFlagBits stage, const vvl::Pipeline *pipeline,
const Location &loc) const { … }
static VkDescriptorSetLayoutBinding const *GetDescriptorBinding(vvl::PipelineLayout const *pipelineLayout, uint32_t set,
uint32_t binding) { … }
bool CoreChecks::ValidatePointSizeShaderState(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const vvl::Pipeline &pipeline, VkShaderStageFlagBits stage,
const Location &loc) const { … }
bool CoreChecks::ValidatePrimitiveRateShaderState(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const vvl::Pipeline &pipeline, VkShaderStageFlagBits stage,
const Location &loc) const { … }
bool CoreChecks::ValidateTransformFeedbackDecorations(const spirv::Module &module_state, const Location &loc) const { … }
bool CoreChecks::ValidateWorkgroupSharedMemory(const spirv::Module &module_state, VkShaderStageFlagBits stage,
uint32_t total_workgroup_shared_memory, const Location &loc) const { … }
struct VariableInstInfo { … };
static void GetVariableInfo(const spirv::Module &module_state, const spirv::Instruction *insn, VariableInstInfo &info) { … }
bool CoreChecks::ValidateVariables(const spirv::Module &module_state, const Location &loc) const { … }
bool CoreChecks::ValidateShaderDescriptorVariable(const spirv::Module &module_state, const vvl::Pipeline &pipeline,
const spirv::EntryPoint &entrypoint, const Location &loc) const { … }
bool CoreChecks::ValidateTransformFeedbackPipeline(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const vvl::Pipeline &pipeline, const Location &loc) const { … }
bool CoreChecks::ValidateTransformFeedbackEmitStreams(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const spirv::StatelessData &stateless_data, const Location &loc) const { … }
bool CoreChecks::ValidateTexelOffsetLimits(const spirv::Module &module_state, const spirv::Instruction &insn,
const Location &loc) const { … }
bool CoreChecks::ValidateShaderClock(const spirv::Module &module_state, const spirv::StatelessData &stateless_data,
const Location &loc) const { … }
bool CoreChecks::ValidateImageWrite(const spirv::Module &module_state, const Location &loc) const { … }
static const std::string GetShaderTileImageCapabilitiesString(const spirv::Module &module_state) { … }
bool CoreChecks::ValidateShaderTileImage(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const vvl::Pipeline *pipeline, const VkShaderStageFlagBits stage,
const Location &loc) const { … }
bool CoreChecks::ValidateShaderStage(const ShaderStageState &stage_state, const vvl::Pipeline *pipeline,
const Location &loc) const { … }
uint32_t CoreChecks::CalcShaderStageCount(const vvl::Pipeline &pipeline, VkShaderStageFlagBits stageBit) const { … }
bool CoreChecks::GroupHasValidIndex(const vvl::Pipeline &pipeline, uint32_t group, uint32_t stage) const { … }
void CoreChecks::PreCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule,
const RecordObject &record_obj, chassis::CreateShaderModule &chassis_state) { … }
void CoreChecks::PreCallRecordCreateShadersEXT(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT *pCreateInfos,
const VkAllocationCallbacks *pAllocator, VkShaderEXT *pShaders,
const RecordObject &record_obj, chassis::ShaderObject &chassis_state) { … }
bool CoreChecks::RunSpirvValidation(spv_const_binary_t &binary, const Location &loc, ValidationCache *cache) const { … }
bool CoreChecks::ValidateShaderModuleCreateInfo(const VkShaderModuleCreateInfo &create_info,
const Location &create_info_loc) const { … }
bool CoreChecks::PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetShaderModuleIdentifierEXT(VkDevice device, VkShaderModule shaderModule,
VkShaderModuleIdentifierEXT *pIdentifier,
const ErrorObject &error_obj) const { … }
bool CoreChecks::PreCallValidateGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo,
VkShaderModuleIdentifierEXT *pIdentifier,
const ErrorObject &error_obj) const { … }
bool CoreChecks::ValidateRequiredSubgroupSize(const spirv::Module &module_state, const ShaderStageState &stage_state,
uint64_t invocations, uint32_t local_size_x, uint32_t local_size_y,
uint32_t local_size_z, const Location &loc) const { … }
bool CoreChecks::ValidateComputeWorkGroupSizes(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const ShaderStageState &stage_state, uint32_t local_size_x, uint32_t local_size_y,
uint32_t local_size_z, const Location &loc) const { … }
bool CoreChecks::ValidateTaskMeshWorkGroupSizes(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z,
const Location &loc) const { … }
bool CoreChecks::ValidateEmitMeshTasksSize(const spirv::Module &module_state, const spirv::EntryPoint &entrypoint,
const ShaderStageState &stage_state, const Location &loc) const { … }
bool CoreChecks::ValidateSpirvStateless(const spirv::Module &module_state, const spirv::StatelessData &stateless_data,
const Location &loc) const { … }