| 475 | } |
| 476 | |
| 477 | spv_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 |