diff options
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/util/util_path.cpp | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 7f2f141bd2f..f6ad6c01893 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -282,6 +282,10 @@ public: if(experimental) command += " -D__KERNEL_CUDA_EXPERIMENTAL__"; + if(getenv("CYCLES_CUDA_EXTRA_CFLAGS")) { + command += string(" ") + getenv("CYCLES_CUDA_EXTRA_CFLAGS"); + } + #ifdef WITH_CYCLES_DEBUG command += " -D__KERNEL_DEBUG__"; #endif diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp index b688033fc9b..a3dbad08e32 100644 --- a/intern/cycles/util/util_path.cpp +++ b/intern/cycles/util/util_path.cpp @@ -49,6 +49,25 @@ static string from_boost(const boost::filesystem::path& path) return path.string().c_str(); } +static char *path_specials(const string& sub) +{ + static bool env_init = false; + static char *env_shader_path; + static char *env_kernel_path; + if(!env_init) { + env_shader_path = getenv("CYCLES_SHADER_PATH"); + env_kernel_path = getenv("CYCLES_KERNEL_PATH"); + env_init = true; + } + if(env_shader_path != NULL && sub == "shader") { + return env_shader_path; + } + else if(env_shader_path != NULL && sub == "kernel") { + return env_kernel_path; + } + return NULL; +} + void path_init(const string& path, const string& user_path) { cached_path = path; @@ -62,6 +81,10 @@ void path_init(const string& path, const string& user_path) string path_get(const string& sub) { + char *special = path_specials(sub); + if(special != NULL) + return special; + if(cached_path == "") cached_path = path_dirname(Sysutil::this_program_path()); |