#include <cstdlib>
#include <sstream>
#include <string>
#include <vector>
#include "NonSemanticShaderDebugInfo100.h"
#include "OpenCLDebugInfo100.h"
#include "source/common_debug_info.h"
#include "source/enum_string_mapping.h"
#include "source/extensions.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/latest_version_opencl_std_header.h"
#include "source/spirv_constant.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
#include "spirv/unified1/NonSemanticClspvReflection.h"
namespace spvtools {
namespace val {
namespace {
std::string ReflectionInstructionName(ValidationState_t& _,
const Instruction* inst) { … }
uint32_t GetSizeTBitWidth(const ValidationState_t& _) { … }
bool IsIntScalar(ValidationState_t& _, uint32_t id, bool must_len32,
bool must_unsigned) { … }
bool IsUint32Constant(ValidationState_t& _, uint32_t id) { … }
uint32_t GetUint32Constant(ValidationState_t& _, uint32_t id) { … }
spv_result_t ValidateOperandForDebugInfo(
ValidationState_t& _, const std::string& operand_name,
spv::Op expected_opcode, const Instruction* inst, uint32_t word_index,
const std::function<std::string()>& ext_inst_name) { … }
spv_result_t ValidateUint32ConstantOperandForDebugInfo(
ValidationState_t& _, const std::string& operand_name,
const Instruction* inst, uint32_t word_index,
const std::function<std::string()>& ext_inst_name) { … }
#define CHECK_OPERAND(NAME, opcode, index) …
#define CHECK_CONST_UINT_OPERAND(NAME, index) …
bool DoesDebugInfoOperandMatchExpectation(
const ValidationState_t& _,
const std::function<bool(CommonDebugInfoInstructions)>& expectation,
const Instruction* inst, uint32_t word_index) { … }
bool DoesDebugInfoOperandMatchExpectation(
const ValidationState_t& _,
const std::function<bool(NonSemanticShaderDebugInfo100Instructions)>&
expectation,
const Instruction* inst, uint32_t word_index) { … }
spv_result_t ValidateDebugInfoOperand(
ValidationState_t& _, const std::string& debug_inst_name,
CommonDebugInfoInstructions expected_debug_inst, const Instruction* inst,
uint32_t word_index, const std::function<std::string()>& ext_inst_name) { … }
#define CHECK_DEBUG_OPERAND(NAME, debug_opcode, index) …
spv_result_t ValidateOperandBaseType(
ValidationState_t& _, const Instruction* inst, uint32_t word_index,
const std::function<std::string()>& ext_inst_name) { … }
spv_result_t ValidateOperandLexicalScope(
ValidationState_t& _, const std::string& debug_inst_name,
const Instruction* inst, uint32_t word_index,
const std::function<std::string()>& ext_inst_name) { … }
spv_result_t ValidateOperandDebugType(
ValidationState_t& _, const std::string& debug_inst_name,
const Instruction* inst, uint32_t word_index,
const std::function<std::string()>& ext_inst_name,
bool allow_template_param) { … }
spv_result_t ValidateClspvReflectionKernel(ValidationState_t& _,
const Instruction* inst,
uint32_t version) { … }
spv_result_t ValidateClspvReflectionArgumentInfo(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateKernelDecl(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateArgInfo(ValidationState_t& _, const Instruction* inst,
uint32_t info_index) { … }
spv_result_t ValidateClspvReflectionArgumentBuffer(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionArgumentOffsetBuffer(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionArgumentPushConstant(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionArgumentWorkgroup(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionSpecConstantTriple(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionSpecConstantWorkDim(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionPushConstant(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionInitializedData(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionSampler(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionPropertyRequiredWorkgroupSize(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionSubgroupMaxSize(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionPointerRelocation(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionImageMetadataPushConstant(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionImageMetadataUniform(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionPushConstantData(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionPrintfInfo(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionPrintfStorageBuffer(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionPrintfPushConstant(
ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateClspvReflectionInstruction(ValidationState_t& _,
const Instruction* inst,
uint32_t version) { … }
bool IsConstIntScalarTypeWith32Or64Bits(ValidationState_t& _,
Instruction* instr) { … }
bool IsConstWithIntScalarType(ValidationState_t& _, const Instruction* inst,
uint32_t word_index) { … }
bool IsDebugVariableWithIntScalarType(ValidationState_t& _,
const Instruction* inst,
uint32_t word_index) { … }
}
spv_result_t ValidateExtension(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateExtInstImport(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ExtensionPass(ValidationState_t& _, const Instruction* inst) { … }
}
}