Cycles:
* Compute MD5 hash to deal with nvidia opencl compiler cache not recognizing changes in #included files, makes it possible to do kernel compile only once and remember it for the next time blender is started. * Kernel tweak to compile with ATI/linux. Enabling any more functionality than simple clay render still chokes the compiler though, without a specific error message ..
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "util_debug.h"
|
||||
#include "util_md5.h"
|
||||
#include "util_path.h"
|
||||
#include "util_string.h"
|
||||
|
||||
@@ -59,5 +60,29 @@ string path_join(const string& dir, const string& file)
|
||||
return (boost::filesystem::path(dir) / boost::filesystem::path(file)).string();
|
||||
}
|
||||
|
||||
string path_files_md5_hash(const string& dir)
|
||||
{
|
||||
/* computes md5 hash of all files in the directory */
|
||||
MD5Hash hash;
|
||||
|
||||
if(boost::filesystem::exists(dir)) {
|
||||
boost::filesystem::directory_iterator it(dir), it_end;
|
||||
|
||||
for(; it != it_end; it++) {
|
||||
if(boost::filesystem::is_directory(it->status())) {
|
||||
path_files_md5_hash(it->path().string());
|
||||
}
|
||||
else {
|
||||
string filepath = it->path().string();
|
||||
|
||||
hash.append((const uint8_t*)filepath.c_str(), filepath.size());
|
||||
hash.append_file(filepath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hash.get_hex();
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
|
Reference in New Issue
Block a user