* @brief Hash function used for procedural partition assignment. * * @param inp The hash seed. * * @return The hashed value. */
| 112 | * @return The hashed value. |
| 113 | */ |
| 114 | static uint32_t hash52( |
| 115 | uint32_t inp |
| 116 | ) { |
| 117 | inp ^= inp >> 15; |
| 118 | |
| 119 | // (2^4 + 1) * (2^7 + 1) * (2^17 - 1) |
| 120 | inp *= 0xEEDE0891; |
| 121 | inp ^= inp >> 5; |
| 122 | inp += inp << 16; |
| 123 | inp ^= inp >> 7; |
| 124 | inp ^= inp >> 3; |
| 125 | inp ^= inp << 6; |
| 126 | inp ^= inp >> 17; |
| 127 | return inp; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * @brief Select texel assignment for a single coordinate. |