[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56623] trunk/blender/intern/cycles/render /osl.cpp: Cycles / OSL:

Thomas Dinges blender at dingto.org
Thu May 9 16:13:43 CEST 2013


Revision: 56623
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56623
Author:   dingto
Date:     2013-05-09 14:13:43 +0000 (Thu, 09 May 2013)
Log Message:
-----------
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. 

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52885

Modified Paths:
--------------
    trunk/blender/intern/cycles/render/osl.cpp

Modified: trunk/blender/intern/cycles/render/osl.cpp
===================================================================
--- trunk/blender/intern/cycles/render/osl.cpp	2013-05-09 14:05:40 UTC (rev 56622)
+++ trunk/blender/intern/cycles/render/osl.cpp	2013-05-09 14:13:43 UTC (rev 56623)
@@ -347,43 +347,9 @@
 	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;




More information about the Bf-blender-cvs mailing list