| 61 | } |
| 62 | |
| 63 | bool IsIntScalar(ValidationState_t& _, uint32_t id, bool must_len32, |
| 64 | bool must_unsigned) { |
| 65 | auto type = _.FindDef(id); |
| 66 | if (!type || type->opcode() != spv::Op::OpTypeInt) { |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | if (must_len32 && type->GetOperandAs<uint32_t>(1) != 32) { |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | return !must_unsigned || type->GetOperandAs<uint32_t>(2) == 0; |
| 75 | } |
| 76 | |
| 77 | bool IsUint32Constant(ValidationState_t& _, uint32_t id) { |
| 78 | auto inst = _.FindDef(id); |
no test coverage detected