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

Function ValidateGroupDecorate

source/val/validate_annotation.cpp:516–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514}
515
516spv_result_t ValidateGroupDecorate(ValidationState_t& _,
517 const Instruction* inst) {
518 const auto decoration_group_id = inst->GetOperandAs<uint32_t>(0);
519 auto decoration_group = _.FindDef(decoration_group_id);
520 if (!decoration_group ||
521 spv::Op::OpDecorationGroup != decoration_group->opcode()) {
522 return _.diag(SPV_ERROR_INVALID_ID, inst)
523 << "OpGroupDecorate Decoration group <id> "
524 << _.getIdName(decoration_group_id) << " is not a decoration group.";
525 }
526 for (unsigned i = 1; i < inst->operands().size(); ++i) {
527 auto target_id = inst->GetOperandAs<uint32_t>(i);
528 auto target = _.FindDef(target_id);
529 if (!target || target->opcode() == spv::Op::OpDecorationGroup) {
530 return _.diag(SPV_ERROR_INVALID_ID, inst)
531 << "OpGroupDecorate may not target OpDecorationGroup <id> "
532 << _.getIdName(target_id);
533 }
534 }
535 return SPV_SUCCESS;
536}
537
538spv_result_t ValidateGroupMemberDecorate(ValidationState_t& _,
539 const Instruction* inst) {

Callers 1

AnnotationPassFunction · 0.85

Calls 6

FindDefMethod · 0.80
diagMethod · 0.80
getIdNameMethod · 0.80
operandsMethod · 0.80
opcodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected