* 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:
Brecht Van Lommel
2011-09-03 10:49:54 +00:00
parent 67030aaf84
commit db1664ed4c
10 changed files with 66 additions and 13 deletions

View File

@@ -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