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
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2016-01-07 01:38:13 +0300
committerThomas Dinges <blender@dingto.org>2016-01-07 01:43:29 +0300
commit83e73a2100688655f0eb2df5cbfac2ca1f051fff (patch)
tree76f1cd502187544777b61fa55f5695b2503993a8 /intern/cycles/device/device_opencl.cpp
parentbe28706bacfb95e7c3c1b58b183acda0e35977f8 (diff)
Cycles: Refactor how we pass bounce info to light path node.
This commit changes the way how we pass bounce information to the Light Path node. Instead of manualy copying the bounces into ShaderData, we now directly pass PathState. This reduces the arguments that we need to pass around and also makes it easier to extend the feature. This commit also exposes the Transmission Bounce Depth to the Light Path node. It works similar to the Transparent Depth Output: Replace a Transmission lightpath after X bounces with another shader, e.g a Diffuse one. This can be used to avoid black surfaces, due to low amount of max bounces. Reviewed by Sergey and Brecht, thanks for some hlp with this. I tested compilation and usage on CPU (SVM and OSL), CUDA, OpenCL Split and Mega kernel. Hopefully this covers all devices. :)
Diffstat (limited to 'intern/cycles/device/device_opencl.cpp')
-rw-r--r--intern/cycles/device/device_opencl.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index c49583b07f3..64a311f2c13 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -1920,10 +1920,6 @@ public:
cl_mem time_sd_DL_shadow;
cl_mem ray_length_sd;
cl_mem ray_length_sd_DL_shadow;
- cl_mem ray_depth_sd;
- cl_mem ray_depth_sd_DL_shadow;
- cl_mem transparent_depth_sd;
- cl_mem transparent_depth_sd_DL_shadow;
/* Ray differentials. */
cl_mem dP_sd, dI_sd;
@@ -2073,10 +2069,6 @@ public:
time_sd_DL_shadow = NULL;
ray_length_sd = NULL;
ray_length_sd_DL_shadow = NULL;
- ray_depth_sd = NULL;
- ray_depth_sd_DL_shadow = NULL;
- transparent_depth_sd = NULL;
- transparent_depth_sd_DL_shadow = NULL;
/* Ray differentials. */
dP_sd = NULL;
@@ -2417,10 +2409,6 @@ public:
release_mem_object_safe(time_sd_DL_shadow);
release_mem_object_safe(ray_length_sd);
release_mem_object_safe(ray_length_sd_DL_shadow);
- release_mem_object_safe(ray_depth_sd);
- release_mem_object_safe(ray_depth_sd_DL_shadow);
- release_mem_object_safe(transparent_depth_sd);
- release_mem_object_safe(transparent_depth_sd_DL_shadow);
/* Ray differentials. */
release_mem_object_safe(dP_sd);
@@ -2619,10 +2607,6 @@ public:
time_sd_DL_shadow = mem_alloc(num_global_elements * 2 * sizeof(float));
ray_length_sd = mem_alloc(num_global_elements * sizeof(float));
ray_length_sd_DL_shadow = mem_alloc(num_global_elements * 2 * sizeof(float));
- ray_depth_sd = mem_alloc(num_global_elements * sizeof(int));
- ray_depth_sd_DL_shadow = mem_alloc(num_global_elements * 2 * sizeof(int));
- transparent_depth_sd = mem_alloc(num_global_elements * sizeof(int));
- transparent_depth_sd_DL_shadow = mem_alloc(num_global_elements * 2 * sizeof(int));
/* Ray differentials. */
dP_sd = mem_alloc(num_global_elements * sizeof(differential3));
@@ -2725,11 +2709,7 @@ public:
time_sd,
time_sd_DL_shadow,
ray_length_sd,
- ray_length_sd_DL_shadow,
- ray_depth_sd,
- ray_depth_sd_DL_shadow,
- transparent_depth_sd,
- transparent_depth_sd_DL_shadow);
+ ray_length_sd_DL_shadow);
/* Ray differentials. */
start_arg_index +=