Returns true if \c inst is an input or output variable.
| 32 | |
| 33 | // Returns true if \c inst is an input or output variable. |
| 34 | bool is_interface_variable(const Instruction* inst, bool is_spv_1_4) { |
| 35 | if (is_spv_1_4) { |
| 36 | // Starting in SPIR-V 1.4, all global variables are interface variables. |
| 37 | return (inst->opcode() == spv::Op::OpVariable || |
| 38 | inst->opcode() == spv::Op::OpUntypedVariableKHR) && |
| 39 | inst->GetOperandAs<spv::StorageClass>(2u) != |
| 40 | spv::StorageClass::Function; |
| 41 | } else { |
| 42 | return (inst->opcode() == spv::Op::OpVariable || |
| 43 | inst->opcode() == spv::Op::OpUntypedVariableKHR) && |
| 44 | (inst->GetOperandAs<spv::StorageClass>(2u) == |
| 45 | spv::StorageClass::Input || |
| 46 | inst->GetOperandAs<spv::StorageClass>(2u) == |
| 47 | spv::StorageClass::Output); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | // Special validation for varibles that are between shader stages |
| 52 | spv_result_t ValidateInputOutputInterfaceVariables(ValidationState_t& _, |
no test coverage detected