summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar bunnei2015-10-05 22:33:47 -0400
committerGravatar bunnei2015-10-21 21:53:14 -0400
commitc86b9d42423b5a83ccba40f828b7ad9dafe3e317 (patch)
tree04bdd0a99fa7fa36946422d0119b3d537dd99526 /src/common
parentgl_rasterizer: Move logic for creating ShaderCacheKey to a static function. (diff)
downloadyuzu-c86b9d42423b5a83ccba40f828b7ad9dafe3e317.tar.gz
yuzu-c86b9d42423b5a83ccba40f828b7ad9dafe3e317.tar.xz
yuzu-c86b9d42423b5a83ccba40f828b7ad9dafe3e317.zip
renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/common_funcs.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index ed20c3629..7a8dd39a0 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -4,6 +4,9 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <cstddef>
8#include <functional>
9
7#include "common_types.h" 10#include "common_types.h"
8 11
9#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) 12#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
@@ -95,3 +98,18 @@ inline u64 _rotr64(u64 x, unsigned int shift){
95// This function might change the error code. 98// This function might change the error code.
96// Defined in Misc.cpp. 99// Defined in Misc.cpp.
97const char* GetLastErrorMsg(); 100const char* GetLastErrorMsg();
101
102template <typename T>
103inline std::size_t hash(const T& o) {
104 return std::hash<T>()(o);
105}
106
107template <typename T>
108inline std::size_t combine_hash(const T& o) {
109 return hash(o);
110}
111
112template <typename T, typename... Args>
113inline std::size_t combine_hash(const T& o, const Args&... args) {
114 return hash(o) * 3 + combine_hash(args...);
115}