| 495 | } |
| 496 | |
| 497 | spv_result_t ValidateDecorationGroup(ValidationState_t& _, |
| 498 | const Instruction* inst) { |
| 499 | const auto decoration_group_id = inst->GetOperandAs<uint32_t>(0); |
| 500 | const auto decoration_group = _.FindDef(decoration_group_id); |
| 501 | for (auto pair : decoration_group->uses()) { |
| 502 | auto use = pair.first; |
| 503 | if (use->opcode() != spv::Op::OpDecorate && |
| 504 | use->opcode() != spv::Op::OpGroupDecorate && |
| 505 | use->opcode() != spv::Op::OpGroupMemberDecorate && |
| 506 | use->opcode() != spv::Op::OpName && !use->IsNonSemantic()) { |
| 507 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 508 | << "Result id of OpDecorationGroup can only " |
| 509 | << "be targeted by OpName, OpGroupDecorate, " |
| 510 | << "OpDecorate, OpDecorateId, and OpGroupMemberDecorate"; |
| 511 | } |
| 512 | } |
| 513 | return SPV_SUCCESS; |
| 514 | } |
| 515 | |
| 516 | spv_result_t ValidateGroupDecorate(ValidationState_t& _, |
| 517 | const Instruction* inst) { |
no test coverage detected