#include <string>
#include "source/opcode.h"
#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/util/bitutils.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validate_scopes.h"
#include "source/val/validation_state.h"
namespace spvtools {
namespace val {
namespace {
bool CheckAllImageOperandsHandled() { … }
struct ImageTypeInfo { … };
bool GetImageTypeInfo(const ValidationState_t& _, uint32_t id,
ImageTypeInfo* info) { … }
bool IsImplicitLod(spv::Op opcode) { … }
bool IsExplicitLod(spv::Op opcode) { … }
bool IsValidLodOperand(const ValidationState_t& _, spv::Op opcode) { … }
bool IsValidGatherLodBiasAMD(const ValidationState_t& _, spv::Op opcode) { … }
bool IsProj(spv::Op opcode) { … }
uint32_t GetPlaneCoordSize(const ImageTypeInfo& info) { … }
uint32_t GetMinCoordSize(spv::Op opcode, const ImageTypeInfo& info) { … }
spv_result_t ValidateImageOperands(ValidationState_t& _,
const Instruction* inst,
const ImageTypeInfo& info,
uint32_t word_index) { … }
spv_result_t ValidateImageProj(ValidationState_t& _, const Instruction* inst,
const ImageTypeInfo& info) { … }
spv_result_t ValidateImageReadWrite(ValidationState_t& _,
const Instruction* inst,
const ImageTypeInfo& info) { … }
bool IsSparse(spv::Op opcode) { … }
spv_result_t GetActualResultType(ValidationState_t& _, const Instruction* inst,
uint32_t* actual_result_type) { … }
const char* GetActualResultTypeStr(spv::Op opcode) { … }
spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateTypeSampledImage(ValidationState_t& _,
const Instruction* inst) { … }
bool IsAllowedSampledImageOperand(spv::Op opcode, ValidationState_t& _) { … }
spv_result_t ValidateSampledImage(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageTexelPointer(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateImageDref(ValidationState_t& _, const Instruction* inst,
const ImageTypeInfo& info) { … }
spv_result_t ValidateImageDrefLod(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageFetch(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateImageGather(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateImage(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateImageQuerySizeLod(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageQuerySize(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageQueryFormatOrOrder(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageQueryLod(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageSparseLod(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageQueryLevelsOrSamples(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageSparseTexelsResident(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateImageProcessingQCOMDecoration(ValidationState_t& _, int id,
spv::Decoration decor) { … }
spv_result_t ValidateImageProcessing2QCOMWindowDecoration(ValidationState_t& _,
int id) { … }
spv_result_t ValidateImageProcessingQCOM(ValidationState_t& _,
const Instruction* inst) { … }
}
spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { … }
bool IsImageInstruction(const spv::Op opcode) { … }
spv_result_t ValidateQCOMImageProcessingTextureUsages(ValidationState_t& _,
const Instruction* inst) { … }
}
}