renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups.

This commit is contained in:
bunnei
2015-10-05 22:33:47 -04:00
parent 3c057bd3d8
commit c86b9d4242
11 changed files with 527 additions and 788 deletions

View File

@@ -4,6 +4,9 @@
#pragma once
#include <cstddef>
#include <functional>
#include "common_types.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
@@ -95,3 +98,18 @@ inline u64 _rotr64(u64 x, unsigned int shift){
// This function might change the error code.
// Defined in Misc.cpp.
const char* GetLastErrorMsg();
template <typename T>
inline std::size_t hash(const T& o) {
return std::hash<T>()(o);
}
template <typename T>
inline std::size_t combine_hash(const T& o) {
return hash(o);
}
template <typename T, typename... Args>
inline std::size_t combine_hash(const T& o, const Args&... args) {
return hash(o) * 3 + combine_hash(args...);
}