Cycles: Remove few function arguments needed only for the split kernel
[blender.git] / intern / cycles / kernel / kernel_debug.h
1 /*
2  * Copyright 2011-2014 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 CCL_NAMESPACE_BEGIN
18
19 ccl_device_inline void debug_data_init(DebugData *debug_data)
20 {
21         debug_data->num_bvh_traversal_steps = 0;
22         debug_data->num_bvh_traversed_instances = 0;
23         debug_data->num_ray_bounces = 0;
24 }
25
26 ccl_device_inline void kernel_write_debug_passes(KernelGlobals *kg,
27                                                  ccl_global float *buffer,
28                                                  ccl_addr_space PathState *state,
29                                                  DebugData *debug_data,
30                                                  int sample)
31 {
32         int flag = kernel_data.film.pass_flag;
33         if(flag & PASS_BVH_TRAVERSAL_STEPS) {
34                 kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversal_steps,
35                                         sample,
36                                         debug_data->num_bvh_traversal_steps);
37         }
38         if(flag & PASS_BVH_TRAVERSED_INSTANCES) {
39                 kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversed_instances,
40                                         sample,
41                                         debug_data->num_bvh_traversed_instances);
42         }
43         if(flag & PASS_RAY_BOUNCES) {
44                 kernel_write_pass_float(buffer + kernel_data.film.pass_ray_bounces,
45                                         sample,
46                                         debug_data->num_ray_bounces);
47         }
48 }
49
50 CCL_NAMESPACE_END