| 736 | } // namespace |
| 737 | |
| 738 | spv_result_t ValidateInterfaces(ValidationState_t& _) { |
| 739 | bool is_spv_1_4 = _.version() >= SPV_SPIRV_VERSION_WORD(1, 4); |
| 740 | for (auto& inst : _.ordered_instructions()) { |
| 741 | if (is_interface_variable(&inst, is_spv_1_4)) { |
| 742 | if (auto error = check_interface_variable(_, &inst)) { |
| 743 | return error; |
| 744 | } |
| 745 | } |
| 746 | } |
| 747 | |
| 748 | if (spvIsVulkanEnv(_.context()->target_env)) { |
| 749 | for (auto& inst : _.ordered_instructions()) { |
| 750 | if (inst.opcode() == spv::Op::OpEntryPoint) { |
| 751 | if (auto error = ValidateLocations(_, &inst)) { |
| 752 | return error; |
| 753 | } |
| 754 | if (auto error = ValidateStorageClass(_, &inst)) { |
| 755 | return error; |
| 756 | } |
| 757 | } |
| 758 | if (inst.opcode() == spv::Op::OpTypeVoid) break; |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | return SPV_SUCCESS; |
| 763 | } |
| 764 | |
| 765 | } // namespace val |
| 766 | } // namespace spvtools |
no test coverage detected