Sampler state caching.

This commit is contained in:
Ben Vanik
2014-05-31 16:34:05 -07:00
parent 6607606b15
commit 529a1478d8
4 changed files with 41 additions and 25 deletions

View File

@@ -134,6 +134,16 @@ typedef XECACHEALIGN volatile void xe_aligned_void_t;
#endif // GNUC
#endif // !MIN
XEFORCEINLINE size_t hash_combine(size_t seed) {
return seed;
}
template <typename T, typename... Ts>
size_t hash_combine(size_t seed, const T& v, const Ts&... vs) {
std::hash<T> hasher;
seed ^= hasher(v) + 0x9E3779B9 + (seed << 6) + (seed >> 2);
return hash_combine(seed, vs...);
}
#if XE_PLATFORM_WIN32
#define XESAFERELEASE(p) if (p) { p->Release(); }
#endif // WIN32