Returns true if inst is a logical pointer.
| 26 | |
| 27 | // Returns true if inst is a logical pointer. |
| 28 | bool IsLogicalPointer(const ValidationState_t& _, const Instruction* inst) { |
| 29 | if (!_.IsPointerType(inst->type_id())) { |
| 30 | return false; |
| 31 | } |
| 32 | |
| 33 | // Physical storage buffer pointers are not logical pointers. |
| 34 | auto type_inst = _.FindDef(inst->type_id()); |
| 35 | auto sc = type_inst->GetOperandAs<spv::StorageClass>(1); |
| 36 | if (sc == spv::StorageClass::PhysicalStorageBuffer) { |
| 37 | return false; |
| 38 | } |
| 39 | |
| 40 | return true; |
| 41 | } |
| 42 | |
| 43 | // Returns true if inst is a variable pointer. |
| 44 | // Caches the result in variable_pointers. |
no test coverage detected