diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-27 20:21:07 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-27 20:21:07 +0400 |
commit | 4bdb54a76e3b15f99f2efc149b9d78aeef3203a4 (patch) | |
tree | 24defa9eeb8e4d7d04508fbca6229ffe23e13d9b /intern/cycles/util/util_path.cpp | |
parent | 5460e31d56fda5957cf13f77c910d378d4bd85fb (diff) |
Cycles OpenCL: patch #35514 by Doug Gale
* Support using devices from all OpenCL platforms, so that you can use e.g. both
Intel and NVidia OpenCL implementations if you have them installed.
* Fix compile error due to missing fmodf after recent math node change.
* Enable advanced shading for Intel OpenCL.
* CYCLES_OPENCL_DEBUG environment variable for generating debug symbols so you
can debug with gdb. This crashes the compiler with Intel OpenCL on Linux though.
To make this work the preprocessed kernel source code is written out, as gdb
needs this.
* Show OpenCL compiler warnings even if the build succeeded.
* Some small fixes to initialize cdDevice to NULL, add missing NULL check when
creating buffer and add missing space at end of build options for Apple OpenCL.
* Fix crash with multi device + opencl, now e.g. CPU + GPU render should work.
I did a few tweaks to the code and also:
* Fix viewport render failing sometimes with Apple CPU OpenCL, was not taking
workgroup size limits into account properly.
* Add compile error when advanced shading in the Blender binary and OpenCL kernel
are not in sync.
Diffstat (limited to 'intern/cycles/util/util_path.cpp')
-rw-r--r-- | intern/cycles/util/util_path.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp index 8cf23bc6a76..79062fe251f 100644 --- a/intern/cycles/util/util_path.cpp +++ b/intern/cycles/util/util_path.cpp @@ -145,6 +145,14 @@ bool path_write_binary(const string& path, const vector<uint8_t>& binary) return true; } +bool path_write_text(const string& path, string& text) +{ + vector<uint8_t> binary(text.length(), 0); + std::copy(text.begin(), text.end(), binary.begin()); + + return path_write_binary(path, binary); +} + bool path_read_binary(const string& path, vector<uint8_t>& binary) { binary.resize(boost::filesystem::file_size(path)); @@ -176,7 +184,7 @@ bool path_read_text(const string& path, string& text) if(!path_exists(path) || !path_read_binary(path, binary)) return false; - + const char *str = (const char*)&binary[0]; size_t size = binary.size(); text = string(str, size); |