| 498 | } |
| 499 | |
| 500 | uint32_t DataFormat::getNumComponents(void) const |
| 501 | { |
| 502 | // From IDA |
| 503 | constexpr const int numComponentsPerElement[] = { |
| 504 | 0, 1, 1, 2, 1, 2, 3, 3, |
| 505 | 4, 4, 4, 2, 4, 3, 4, -1, |
| 506 | 3, 4, 4, 4, 2, 2, 2, -1, |
| 507 | -1, -1, -1, -1, -1, -1, -1, -1, |
| 508 | 3, 3, 3, 4, 4, 4, 1, 2, |
| 509 | 3, 4, -1, -1, 2, 2, 2, 2, |
| 510 | 2, 2, 2, 2, 2, 2, 2, 2, |
| 511 | 2, 2, 3, 1, 1 |
| 512 | }; |
| 513 | |
| 514 | uint32_t numComponents = 0; |
| 515 | if (m_bits.m_surfaceFormat <= kSurfaceFormat1Reversed) |
| 516 | { |
| 517 | numComponents = static_cast<uint32_t>(numComponentsPerElement[m_bits.m_surfaceFormat]); |
| 518 | } |
| 519 | return numComponents; |
| 520 | } |
| 521 | |
| 522 | bool DataFormat::operator==(const DataFormat& other) const |
| 523 | { |