MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ValidateConstantSampler

Function ValidateConstantSampler

source/val/validate_constants.cpp:477–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477spv_result_t ValidateConstantSampler(ValidationState_t& _,
478 const Instruction* inst) {
479 const auto result_type = _.FindDef(inst->type_id());
480 if (!result_type || result_type->opcode() != spv::Op::OpTypeSampler) {
481 return _.diag(SPV_ERROR_INVALID_ID, result_type)
482 << "OpConstantSampler Result Type <id> "
483 << _.getIdName(inst->type_id()) << " is not a sampler type.";
484 }
485
486 return SPV_SUCCESS;
487}
488
489// True if instruction defines a type that can have a null value, as defined by
490// the SPIR-V spec. Tracks composite-type components through module to check

Callers 1

ConstantPassFunction · 0.85

Calls 5

FindDefMethod · 0.80
diagMethod · 0.80
getIdNameMethod · 0.80
type_idMethod · 0.45
opcodeMethod · 0.45

Tested by

no test coverage detected