| 220 | } |
| 221 | |
| 222 | std::string VectorShape::str() const { |
| 223 | if (!isDefined()) { |
| 224 | return "undef_shape"; |
| 225 | } |
| 226 | |
| 227 | std::stringstream ss; |
| 228 | if (isVarying()) { |
| 229 | ss << "varying"; |
| 230 | } else if (isUniform()) { |
| 231 | ss << "uni"; |
| 232 | } else if (isContiguous()) { |
| 233 | ss << "cont"; |
| 234 | } else { |
| 235 | ss << "stride(" << stride << ")"; |
| 236 | } |
| 237 | |
| 238 | if (alignment > 1) { |
| 239 | ss << ", alignment(" << alignment << ", " << getAlignmentGeneral() << ")"; |
| 240 | } |
| 241 | |
| 242 | return ss.str(); |
| 243 | } |
| 244 | |
| 245 | VectorShape truncateToTypeSize(const VectorShape &a, unsigned typeSize) { |
| 246 | if (!a.isDefined()) |