Cycles: Equi-Angular and MIS Volume sampling work on GPU now.

* malloc() is used now, which is supported since sm_20: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#dynamic-global-memory-allocation-and-operations The performance of this needs to be tested on various cards still.
* This also works for Heterogeneous Decoupled Ray Marching, but in this case I get sporadic "Illegal Address" errors on my Geforce 540, therefore I did not remove the GPU check in kernel_volume_use_decoupled() yet.

I would appreciate some tests from people who compile themselves, enable Volumetrics in kernel_types.h.
This commit is contained in:
Thomas Dinges 2014-07-06 13:59:52 +02:00
parent 22fa83173b
commit 5fefc84783
1 changed files with 1 additions and 6 deletions

View File

@ -629,11 +629,8 @@ ccl_device void kernel_volume_decoupled_record(KernelGlobals *kg, PathState *sta
segment->closure_flag = 0;
segment->numsteps = 0;
#ifdef __KERNEL_CPU__
segment->steps = (VolumeStep*)malloc(sizeof(VolumeStep)*max_steps);
#else
kernel_assert(max_steps == 1);
#endif
VolumeStep *step = segment->steps;
@ -719,9 +716,7 @@ ccl_device void kernel_volume_decoupled_record(KernelGlobals *kg, PathState *sta
ccl_device void kernel_volume_decoupled_free(KernelGlobals *kg, VolumeSegment *segment)
{
#ifdef __KERNEL_CPU__
free(segment->steps);
#endif
}
/* scattering for homogeneous and heterogeneous volumes, using decoupled ray