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.
This commit is contained in:
Brecht Van Lommel 2011-10-16 18:54:27 +00:00
parent 33691eb0e7
commit 5fd67a3ba5
10 changed files with 44 additions and 9 deletions

@ -157,8 +157,6 @@ Device *Device::create(DeviceType type, bool background, int threads)
return NULL; return NULL;
} }
device->device_type = type;
return device; return device;
} }

@ -75,13 +75,12 @@ class Device {
protected: protected:
Device() {} Device() {}
DeviceType device_type;
bool background; bool background;
public: public:
virtual ~Device() {} virtual ~Device() {}
DeviceType type() { return device_type; } virtual bool support_full_kernel() = 0;
/* info */ /* info */
virtual string description() = 0; virtual string description() = 0;

@ -69,6 +69,11 @@ public:
kernel_globals_free(kg); kernel_globals_free(kg);
} }
bool support_full_kernel()
{
return true;
}
string description() string description()
{ {
return system_cpu_brand_string(); return system_cpu_brand_string();

@ -181,6 +181,14 @@ public:
cuda_assert(cuCtxDetach(cuContext)) cuda_assert(cuCtxDetach(cuContext))
} }
bool support_full_kernel()
{
int major, minor;
cuDeviceComputeCapability(&major, &minor, cuDevId);
return (major >= 2);
}
string description() string description()
{ {
/* print device information */ /* print device information */

@ -90,6 +90,16 @@ public:
delete sub.device; delete sub.device;
} }
bool support_full_kernel()
{
foreach(SubDevice& sub, devices) {
if(!sub.device->support_full_kernel())
return false;
}
return true;
}
string description() string description()
{ {
/* create map to find duplicate descriptions */ /* create map to find duplicate descriptions */

@ -57,6 +57,11 @@ public:
{ {
} }
bool support_full_kernel()
{
return false;
}
string description() string description()
{ {
RPCSend snd(socket, "description"); RPCSend snd(socket, "description");

@ -402,6 +402,11 @@ public:
clReleaseContext(cxContext); clReleaseContext(cxContext);
} }
bool support_full_kernel()
{
return false;
}
string description() string description()
{ {
char name[1024]; char name[1024];

@ -44,15 +44,22 @@ CCL_NAMESPACE_BEGIN
#define __EMISSION__ #define __EMISSION__
#define __TEXTURES__ #define __TEXTURES__
#define __HOLDOUT__ #define __HOLDOUT__
#define __MULTI_CLOSURE__
#define __TRANSPARENT_SHADOWS__
//#define __MULTI_LIGHT__ //#define __MULTI_LIGHT__
#endif #endif
#ifdef __KERNEL_CPU__ #ifdef __KERNEL_CPU__
#define __MULTI_CLOSURE__
#define __TRANSPARENT_SHADOWS__
//#define __OSL__ //#define __OSL__
#endif #endif
#ifdef __KERNEL_CUDA__
#if __CUDA_ARCH__ >= 200
#define __MULTI_CLOSURE__
#define __TRANSPARENT_SHADOWS__
#endif
#endif
//#define __SOBOL_FULL_SCREEN__ //#define __SOBOL_FULL_SCREEN__
//#define __MODIFY_TP__ //#define __MODIFY_TP__
//#define __QBVH__ //#define __QBVH__

@ -100,7 +100,6 @@ public:
class SceneParams { class SceneParams {
public: public:
enum { OSL, SVM } shadingsystem; enum { OSL, SVM } shadingsystem;
bool use_multi_closure;
enum BVHType { BVH_DYNAMIC, BVH_STATIC } bvh_type; enum BVHType { BVH_DYNAMIC, BVH_STATIC } bvh_type;
bool use_bvh_cache; bool use_bvh_cache;
bool use_bvh_spatial_split; bool use_bvh_spatial_split;
@ -109,7 +108,6 @@ public:
SceneParams() SceneParams()
{ {
shadingsystem = SVM; shadingsystem = SVM;
use_multi_closure = true;
bvh_type = BVH_DYNAMIC; bvh_type = BVH_DYNAMIC;
use_bvh_cache = false; use_bvh_cache = false;
use_bvh_spatial_split = false; use_bvh_spatial_split = false;

@ -58,7 +58,7 @@ void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
} }
bool sunsky_done = false; 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++) { for(i = 0; i < scene->shaders.size(); i++) {
Shader *shader = scene->shaders[i]; Shader *shader = scene->shaders[i];