diff options
author | Thomas Dinges <blender@dingto.org> | 2013-05-09 18:13:43 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-05-09 18:13:43 +0400 |
commit | ce40e7fe27698c8f0d16139f1592c06a1fc5b125 (patch) | |
tree | d047982c4684caf255cdd0e4a2e5244c0ab168ee | |
parent | d0ffbeec7393ec4f4b2d67e38ee8a25cfc704df9 (diff) |
Cycles / OSL:
* Remove custom template from r52885, not needed anymore as OSL 1.3 is a requirement and we do not use a custom branch anymore.
-rw-r--r-- | intern/cycles/render/osl.cpp | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index 6e5c787742e..8efc6b553e0 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -347,43 +347,9 @@ const char *OSLShaderManager::shader_load_filepath(string filepath) return shader_load_bytecode(bytecode_hash, bytecode); } -/* don't try this at home .. this is a template trick to use either - * LoadMemoryShader or LoadMemoryCompiledShader which are the function - * names in our custom branch and the official repository. */ - -template<bool C, typename T = void> struct enable_if { typedef T type; }; -template<typename T> struct enable_if<false, T> { }; - -template<typename T, typename Sign> -struct has_LoadMemoryCompiledShader { - typedef int yes; - typedef char no; - - template<typename U, U> struct type_check; - template<typename _1> static yes &chk(type_check<Sign, &_1::LoadMemoryCompiledShader>*); - template<typename > static no &chk(...); - static bool const value = sizeof(chk<T>(0)) == sizeof(yes); -}; - -template<typename T> -typename enable_if<has_LoadMemoryCompiledShader<T, - bool(T::*)(const char*, const char*)>::value, bool>::type -load_memory_shader(T *ss, const char *name, const char *buffer) -{ - return ss->LoadMemoryCompiledShader(name, buffer); -} - -template<typename T> -typename enable_if<!has_LoadMemoryCompiledShader<T, - bool(T::*)(const char*, const char*)>::value, bool>::type -load_memory_shader(T *ss, const char *name, const char *buffer) -{ - return ss->LoadMemoryShader(name, buffer); -} - const char *OSLShaderManager::shader_load_bytecode(const string& hash, const string& bytecode) { - load_memory_shader(ss, hash.c_str(), bytecode.c_str()); + ss->LoadMemoryCompiledShader(hash.c_str(), bytecode.c_str()); /* this is a bit weak, but works */ OSLShaderInfo info; |