| 651 | } // namespace |
| 652 | |
| 653 | spv_result_t AnnotationPass(ValidationState_t& _, const Instruction* inst) { |
| 654 | switch (inst->opcode()) { |
| 655 | case spv::Op::OpDecorate: |
| 656 | if (auto error = ValidateDecorate(_, inst)) return error; |
| 657 | break; |
| 658 | case spv::Op::OpDecorateId: |
| 659 | if (auto error = ValidateDecorateId(_, inst)) return error; |
| 660 | break; |
| 661 | // TODO(dneto): spv::Op::OpDecorateStringGOOGLE |
| 662 | // See https://github.com/KhronosGroup/SPIRV-Tools/issues/2253 |
| 663 | case spv::Op::OpMemberDecorate: |
| 664 | case spv::Op::OpMemberDecorateIdEXT: |
| 665 | if (auto error = ValidateMemberDecorate(_, inst)) return error; |
| 666 | break; |
| 667 | case spv::Op::OpDecorationGroup: |
| 668 | if (auto error = ValidateDecorationGroup(_, inst)) return error; |
| 669 | break; |
| 670 | case spv::Op::OpGroupDecorate: |
| 671 | if (auto error = ValidateGroupDecorate(_, inst)) return error; |
| 672 | break; |
| 673 | case spv::Op::OpGroupMemberDecorate: |
| 674 | if (auto error = ValidateGroupMemberDecorate(_, inst)) return error; |
| 675 | break; |
| 676 | default: |
| 677 | break; |
| 678 | } |
| 679 | |
| 680 | // In order to validate decoration rules, we need to know all the decorations |
| 681 | // that are applied to any given <id>. |
| 682 | RegisterDecorations(_, inst); |
| 683 | |
| 684 | return SPV_SUCCESS; |
| 685 | } |
| 686 | |
| 687 | } // namespace val |
| 688 | } // namespace spvtools |
no test coverage detected