| 139 | } |
| 140 | |
| 141 | static uint32_t getScalarElementCount(const analysis::Type& type) { |
| 142 | switch (type.kind()) { |
| 143 | case analysis::Type::kVector: |
| 144 | return type.AsVector()->element_count(); |
| 145 | case analysis::Type::kMatrix: |
| 146 | return getScalarElementCount(*type.AsMatrix()->element_type()); |
| 147 | case analysis::Type::kStruct: |
| 148 | assert(0 && "getScalarElementCount() does not recognized struct types"); |
| 149 | return 0; |
| 150 | default: |
| 151 | return 1; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | // Aligns the specified value to a multiple of alignment, whereas the |
| 156 | // alignment must be a power-of-two. |
no test coverage detected