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 struct enable_if { typedef T type; }; -template struct enable_if { }; - -template -struct has_LoadMemoryCompiledShader { - typedef int yes; - typedef char no; - - template struct type_check; - template static yes &chk(type_check*); - template static no &chk(...); - static bool const value = sizeof(chk(0)) == sizeof(yes); -}; - -template -typename enable_if::value, bool>::type -load_memory_shader(T *ss, const char *name, const char *buffer) -{ - return ss->LoadMemoryCompiledShader(name, buffer); -} - -template -typename enable_if::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;