diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-16 22:54:27 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-16 22:54:27 +0400 |
commit | 5fd67a3ba5ad10a932a0a1b4cbd3fe37691fbae1 (patch) | |
tree | 8dd8bde6ac10df92c30cf4a66d168eedef396e82 /intern | |
parent | 33691eb0e7d0c6b7aa47f3b8640b1a332004de6d (diff) |
Cycles: enable multi closure sampling and transparent shadows only on CPU and
CUDA cards with shader model >= 2 for now (GTX 4xx, 5xx, ..). The CUDA compiler
can't handle the increased kernel size currently.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/device.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/device.h | 3 | ||||
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 5 | ||||
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 8 | ||||
-rw-r--r-- | intern/cycles/device/device_multi.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/device/device_network.cpp | 5 | ||||
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 5 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 11 | ||||
-rw-r--r-- | intern/cycles/render/scene.h | 2 | ||||
-rw-r--r-- | intern/cycles/render/svm.cpp | 2 |
10 files changed, 44 insertions, 9 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index 01c50817709..f43ccffe461 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -157,8 +157,6 @@ Device *Device::create(DeviceType type, bool background, int threads) return NULL; } - device->device_type = type; - return device; } diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index 360478cfd75..5d6ac10dc40 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -75,13 +75,12 @@ class Device { protected: Device() {} - DeviceType device_type; bool background; public: virtual ~Device() {} - DeviceType type() { return device_type; } + virtual bool support_full_kernel() = 0; /* info */ virtual string description() = 0; diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 2409cc65998..d6e1c200996 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -69,6 +69,11 @@ public: kernel_globals_free(kg); } + bool support_full_kernel() + { + return true; + } + string description() { return system_cpu_brand_string(); diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 3773dda7631..1438dd67ca5 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -181,6 +181,14 @@ public: cuda_assert(cuCtxDetach(cuContext)) } + bool support_full_kernel() + { + int major, minor; + cuDeviceComputeCapability(&major, &minor, cuDevId); + + return (major >= 2); + } + string description() { /* print device information */ diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp index f2f6251685e..128c80ac396 100644 --- a/intern/cycles/device/device_multi.cpp +++ b/intern/cycles/device/device_multi.cpp @@ -90,6 +90,16 @@ public: delete sub.device; } + bool support_full_kernel() + { + foreach(SubDevice& sub, devices) { + if(!sub.device->support_full_kernel()) + return false; + } + + return true; + } + string description() { /* create map to find duplicate descriptions */ diff --git a/intern/cycles/device/device_network.cpp b/intern/cycles/device/device_network.cpp index af7d90478cf..a5ad84831fc 100644 --- a/intern/cycles/device/device_network.cpp +++ b/intern/cycles/device/device_network.cpp @@ -57,6 +57,11 @@ public: { } + bool support_full_kernel() + { + return false; + } + string description() { RPCSend snd(socket, "description"); diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index bd26f4a78fb..d8df8025a08 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -402,6 +402,11 @@ public: clReleaseContext(cxContext); } + bool support_full_kernel() + { + return false; + } + string description() { char name[1024]; diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index df438fe8d90..d8270b2cd71 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -44,15 +44,22 @@ CCL_NAMESPACE_BEGIN #define __EMISSION__ #define __TEXTURES__ #define __HOLDOUT__ -#define __MULTI_CLOSURE__ -#define __TRANSPARENT_SHADOWS__ //#define __MULTI_LIGHT__ #endif #ifdef __KERNEL_CPU__ +#define __MULTI_CLOSURE__ +#define __TRANSPARENT_SHADOWS__ //#define __OSL__ #endif +#ifdef __KERNEL_CUDA__ +#if __CUDA_ARCH__ >= 200 +#define __MULTI_CLOSURE__ +#define __TRANSPARENT_SHADOWS__ +#endif +#endif + //#define __SOBOL_FULL_SCREEN__ //#define __MODIFY_TP__ //#define __QBVH__ diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h index c191f8a56e5..17bd7e20129 100644 --- a/intern/cycles/render/scene.h +++ b/intern/cycles/render/scene.h @@ -100,7 +100,6 @@ public: class SceneParams { public: enum { OSL, SVM } shadingsystem; - bool use_multi_closure; enum BVHType { BVH_DYNAMIC, BVH_STATIC } bvh_type; bool use_bvh_cache; bool use_bvh_spatial_split; @@ -109,7 +108,6 @@ public: SceneParams() { shadingsystem = SVM; - use_multi_closure = true; bvh_type = BVH_DYNAMIC; use_bvh_cache = false; use_bvh_spatial_split = false; diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index b9c4219f852..f088a8143cc 100644 --- a/intern/cycles/render/svm.cpp +++ b/intern/cycles/render/svm.cpp @@ -58,7 +58,7 @@ void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene } bool sunsky_done = false; - bool use_multi_closure = (scene->params.use_multi_closure && device->type() != DEVICE_OPENCL); + bool use_multi_closure = device->support_full_kernel(); for(i = 0; i < scene->shaders.size(); i++) { Shader *shader = scene->shaders[i]; |