Returns true if the two instructions represent structs that, as far as the validator can tell, have the exact same data layout.
| 58 | // Returns true if the two instructions represent structs that, as far as the |
| 59 | // validator can tell, have the exact same data layout. |
| 60 | bool AreLayoutCompatibleStructs(ValidationState_t& _, const Instruction* type1, |
| 61 | const Instruction* type2) { |
| 62 | if (type1->opcode() != spv::Op::OpTypeStruct) { |
| 63 | return false; |
| 64 | } |
| 65 | if (type2->opcode() != spv::Op::OpTypeStruct) { |
| 66 | return false; |
| 67 | } |
| 68 | |
| 69 | if (!HaveLayoutCompatibleMembers(_, type1, type2)) return false; |
| 70 | |
| 71 | return HaveSameLayoutDecorations(_, type1, type2); |
| 72 | } |
| 73 | |
| 74 | // Returns true if the operands to the OpTypeStruct instruction defining the |
| 75 | // types are the same or are layout compatible types. |type1| and |type2| must |
no test coverage detected