#define PI 3.141592653589793 #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define CLAMP(x, low, high) (((x) < (low)) ? (low) : (((x) > (high)) ? (high) : (x))) #define CEIL_DIV(a, b) ((((a) + (b) + 1)) / (b)) #define ALIGN_UP(val, align) ((decltype(val))(((uintptr_t)(val) + (align) - 1) & ~((uintptr_t)(align) - 1))) #define S(str) str, strlen(str) static uint32_t HashCombine32(uint32_t seed, uint32_t v) { seed ^= v + 0x9E3779B9u + (seed << 6) + (seed >> 2); return seed; } static uint64_t HashCombine64(uint64_t seed, uint64_t v) { seed ^= v + 0x9E3779B97F4A7C15ull + (seed << 12) + (seed >> 4); return seed; } static uint32_t HashBytes32(const void* bytes, uint32_t count) { uint32_t h = 0x811C9DC5u; for (uint64_t i = 0; i < count; ++i) h = (h ^ ((uint8_t*)bytes)[i]) * 0x01000193u; return h; } static uint64_t HashBytes64(const void* bytes, uint32_t count) { uint64_t h = 0xCBF29CE484222325ull; for (uint64_t i = 0; i < count; ++i) h = (h ^ ((uint8_t*)bytes)[i]) * 0x100000001B3ull; return h; } #include "float2.cc" #include "float3.cc" #include "float4.cc" #include "float4x4.cc"