| 738 | } |
| 739 | |
| 740 | spv_result_t ValidateVariableVulkanInterface(ValidationState_t& _, |
| 741 | const Instruction* inst, |
| 742 | spv::StorageClass storage_class, |
| 743 | const Instruction* value_type, |
| 744 | uint32_t value_id) { |
| 745 | // Check for invalid use of Invariant |
| 746 | if (storage_class != spv::StorageClass::Input && |
| 747 | storage_class != spv::StorageClass::Output) { |
| 748 | if (_.HasDecoration(inst->id(), spv::Decoration::Invariant)) { |
| 749 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 750 | << _.VkErrorID(4677) |
| 751 | << "Variable decorated with Invariant must only be identified " |
| 752 | "with the Input or Output storage class in Vulkan " |
| 753 | "environment."; |
| 754 | } |
| 755 | // Need to check if only the members in a struct are decorated |
| 756 | if (value_type && value_type->opcode() == spv::Op::OpTypeStruct) { |
| 757 | if (_.HasDecoration(value_id, spv::Decoration::Invariant)) { |
| 758 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 759 | << _.VkErrorID(4677) |
| 760 | << "Variable struct member decorated with Invariant must only " |
| 761 | "be identified with the Input or Output storage class in " |
| 762 | "Vulkan environment."; |
| 763 | } |
| 764 | } |
| 765 | } |
| 766 | |
| 767 | return SPV_SUCCESS; |
| 768 | } |
| 769 | |
| 770 | spv_result_t ValidateVariableCoopMat(ValidationState_t& _, |
| 771 | const Instruction* inst, |
no test coverage detected