Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2011-11-13 02:22:00 +0400
committerThomas Dinges <blender@dingto.org>2011-11-13 02:22:00 +0400
commit880225db77cddaa43174388768b81e361e9e99d6 (patch)
tree2ded8390bb6db311a8338854933c6301264c8d2c /intern
parentfc42a6185ddeb6a24ec92287dfa7b89beb059716 (diff)
OpenCL/Nvidia:
* Enable OpenCL Full Shading on NVIDIA cards. Notes: It makes not much sense to use OpenCL on a nVidia card (as it is slower compared to CUDA), but as OpenCL comes without dependencies, it's an good alternative if you don't want to install the CUDA toolkit or the build comes without CUDA kernels.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/device/device_opencl.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index d8df8025a08..c96d4617ffb 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -177,6 +177,7 @@ public:
bool opencl_version_check()
{
char version[256];
+
int major, minor, req_major = 1, req_minor = 1;
clGetPlatformInfo(cpPlatform, CL_PLATFORM_VERSION, sizeof(version), &version, NULL);
@@ -265,6 +266,20 @@ public:
build_options += "-I " + kernel_path + ""; /* todo: escape path */
build_options += " -cl-fast-relaxed-math ";
+
+ /* Full Shading only on NVIDIA cards at the moment */
+ char vendor[256];
+
+ clGetPlatformInfo(cpPlatform, CL_PLATFORM_NAME, sizeof(vendor), &vendor, NULL);
+ string name = vendor;
+
+ if (name == "NVIDIA CUDA") {
+ build_options += "-D __SVM__ ";
+ build_options += "-D __EMISSION__ ";
+ build_options += "-D __TEXTURES__ ";
+ build_options += "-D __HOLDOUT__ ";
+ build_options += "-D __MULTI_CLOSURE__ ";
+ }
ciErr = clBuildProgram(cpProgram, 0, NULL, build_options.c_str(), NULL, NULL);