Blender  V3.3
data_template.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef KERNEL_STRUCT_BEGIN
5 # define KERNEL_STRUCT_BEGIN(name, parent)
6 #endif
7 #ifndef KERNEL_STRUCT_END
8 # define KERNEL_STRUCT_END(name)
9 #endif
10 #ifndef KERNEL_STRUCT_MEMBER
11 # define KERNEL_STRUCT_MEMBER(parent, type, name)
12 #endif
13 
14 /* Background. */
15 
16 KERNEL_STRUCT_BEGIN(KernelBackground, background)
17 /* xyz store direction, w the angle. float4 instead of float3 is used
18  * to ensure consistent padding/alignment across devices. */
19 KERNEL_STRUCT_MEMBER(background, float4, sun)
20 /* Only shader index. */
21 KERNEL_STRUCT_MEMBER(background, int, surface_shader)
22 KERNEL_STRUCT_MEMBER(background, int, volume_shader)
23 KERNEL_STRUCT_MEMBER(background, float, volume_step_size)
24 KERNEL_STRUCT_MEMBER(background, int, transparent)
25 KERNEL_STRUCT_MEMBER(background, float, transparent_roughness_squared_threshold)
26 /* Portal sampling. */
27 KERNEL_STRUCT_MEMBER(background, float, portal_weight)
28 KERNEL_STRUCT_MEMBER(background, int, num_portals)
29 KERNEL_STRUCT_MEMBER(background, int, portal_offset)
30 /* Sun sampling. */
31 KERNEL_STRUCT_MEMBER(background, float, sun_weight)
32 /* Importance map sampling. */
33 KERNEL_STRUCT_MEMBER(background, float, map_weight)
34 KERNEL_STRUCT_MEMBER(background, int, map_res_x)
35 KERNEL_STRUCT_MEMBER(background, int, map_res_y)
36 /* Multiple importance sampling. */
37 KERNEL_STRUCT_MEMBER(background, int, use_mis)
38 /* Lightgroup. */
39 KERNEL_STRUCT_MEMBER(background, int, lightgroup)
40 /* Padding. */
41 KERNEL_STRUCT_MEMBER(background, int, pad1)
42 KERNEL_STRUCT_MEMBER(background, int, pad2)
43 KERNEL_STRUCT_MEMBER(background, int, pad3)
44 KERNEL_STRUCT_END(KernelBackground)
45 
46 /* BVH: own BVH2 if no native device acceleration struct used. */
47 
48 KERNEL_STRUCT_BEGIN(KernelBVH, bvh)
49 KERNEL_STRUCT_MEMBER(bvh, int, root)
50 KERNEL_STRUCT_MEMBER(bvh, int, have_motion)
51 KERNEL_STRUCT_MEMBER(bvh, int, have_curves)
52 KERNEL_STRUCT_MEMBER(bvh, int, have_points)
53 KERNEL_STRUCT_MEMBER(bvh, int, have_volumes)
54 KERNEL_STRUCT_MEMBER(bvh, int, bvh_layout)
55 KERNEL_STRUCT_MEMBER(bvh, int, use_bvh_steps)
56 KERNEL_STRUCT_MEMBER(bvh, int, curve_subdivisions)
57 KERNEL_STRUCT_END(KernelBVH)
58 
59 /* Film. */
60 
61 KERNEL_STRUCT_BEGIN(KernelFilm, film)
62 /* XYZ to rendering color space transform. float4 instead of float3 to
63  * ensure consistent padding/alignment across devices. */
64 KERNEL_STRUCT_MEMBER(film, float4, xyz_to_r)
65 KERNEL_STRUCT_MEMBER(film, float4, xyz_to_g)
66 KERNEL_STRUCT_MEMBER(film, float4, xyz_to_b)
67 KERNEL_STRUCT_MEMBER(film, float4, rgb_to_y)
68 /* Rec709 to rendering color space. */
69 KERNEL_STRUCT_MEMBER(film, float4, rec709_to_r)
70 KERNEL_STRUCT_MEMBER(film, float4, rec709_to_g)
71 KERNEL_STRUCT_MEMBER(film, float4, rec709_to_b)
72 KERNEL_STRUCT_MEMBER(film, int, is_rec709)
73 /* Exposure. */
74 KERNEL_STRUCT_MEMBER(film, float, exposure)
75 /* Passed used. */
76 KERNEL_STRUCT_MEMBER(film, int, pass_flag)
77 KERNEL_STRUCT_MEMBER(film, int, light_pass_flag)
78 /* Pass offsets. */
80 KERNEL_STRUCT_MEMBER(film, int, pass_combined)
81 KERNEL_STRUCT_MEMBER(film, int, pass_depth)
82 KERNEL_STRUCT_MEMBER(film, int, pass_position)
83 KERNEL_STRUCT_MEMBER(film, int, pass_normal)
84 KERNEL_STRUCT_MEMBER(film, int, pass_roughness)
85 KERNEL_STRUCT_MEMBER(film, int, pass_motion)
86 KERNEL_STRUCT_MEMBER(film, int, pass_motion_weight)
87 KERNEL_STRUCT_MEMBER(film, int, pass_uv)
88 KERNEL_STRUCT_MEMBER(film, int, pass_object_id)
89 KERNEL_STRUCT_MEMBER(film, int, pass_material_id)
90 KERNEL_STRUCT_MEMBER(film, int, pass_diffuse_color)
91 KERNEL_STRUCT_MEMBER(film, int, pass_glossy_color)
92 KERNEL_STRUCT_MEMBER(film, int, pass_transmission_color)
93 KERNEL_STRUCT_MEMBER(film, int, pass_diffuse_indirect)
94 KERNEL_STRUCT_MEMBER(film, int, pass_glossy_indirect)
95 KERNEL_STRUCT_MEMBER(film, int, pass_transmission_indirect)
96 KERNEL_STRUCT_MEMBER(film, int, pass_volume_indirect)
97 KERNEL_STRUCT_MEMBER(film, int, pass_diffuse_direct)
98 KERNEL_STRUCT_MEMBER(film, int, pass_glossy_direct)
99 KERNEL_STRUCT_MEMBER(film, int, pass_transmission_direct)
100 KERNEL_STRUCT_MEMBER(film, int, pass_volume_direct)
101 KERNEL_STRUCT_MEMBER(film, int, pass_emission)
102 KERNEL_STRUCT_MEMBER(film, int, pass_background)
103 KERNEL_STRUCT_MEMBER(film, int, pass_ao)
104 KERNEL_STRUCT_MEMBER(film, float, pass_alpha_threshold)
105 KERNEL_STRUCT_MEMBER(film, int, pass_shadow)
106 KERNEL_STRUCT_MEMBER(film, float, pass_shadow_scale)
107 KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher)
108 KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_sample_count)
109 KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_matte)
110 /* Cryptomatte. */
111 KERNEL_STRUCT_MEMBER(film, int, cryptomatte_passes)
112 KERNEL_STRUCT_MEMBER(film, int, cryptomatte_depth)
113 KERNEL_STRUCT_MEMBER(film, int, pass_cryptomatte)
114 /* Adaptive sampling. */
115 KERNEL_STRUCT_MEMBER(film, int, pass_adaptive_aux_buffer)
117 /* Mist. */
118 KERNEL_STRUCT_MEMBER(film, int, pass_mist)
119 KERNEL_STRUCT_MEMBER(film, float, mist_start)
120 KERNEL_STRUCT_MEMBER(film, float, mist_inv_depth)
121 KERNEL_STRUCT_MEMBER(film, float, mist_falloff)
122 /* Denoising. */
123 KERNEL_STRUCT_MEMBER(film, int, pass_denoising_normal)
124 KERNEL_STRUCT_MEMBER(film, int, pass_denoising_albedo)
125 KERNEL_STRUCT_MEMBER(film, int, pass_denoising_depth)
126 /* AOVs. */
127 KERNEL_STRUCT_MEMBER(film, int, pass_aov_color)
128 KERNEL_STRUCT_MEMBER(film, int, pass_aov_value)
129 /* Light groups. */
130 KERNEL_STRUCT_MEMBER(film, int, pass_lightgroup)
131 /* Baking. */
132 KERNEL_STRUCT_MEMBER(film, int, pass_bake_primitive)
133 KERNEL_STRUCT_MEMBER(film, int, pass_bake_differential)
134 /* Shadow catcher. */
135 KERNEL_STRUCT_MEMBER(film, int, use_approximate_shadow_catcher)
136 /* Padding. */
137 KERNEL_STRUCT_MEMBER(film, int, pad1)
138 KERNEL_STRUCT_MEMBER(film, int, pad2)
139 KERNEL_STRUCT_END(KernelFilm)
140 
141 /* Integrator. */
142 
143 KERNEL_STRUCT_BEGIN(KernelIntegrator, integrator)
144 /* Emission. */
145 KERNEL_STRUCT_MEMBER(integrator, int, use_direct_light)
146 KERNEL_STRUCT_MEMBER(integrator, int, num_distribution)
147 KERNEL_STRUCT_MEMBER(integrator, int, num_all_lights)
148 KERNEL_STRUCT_MEMBER(integrator, float, pdf_triangles)
149 KERNEL_STRUCT_MEMBER(integrator, float, pdf_lights)
150 KERNEL_STRUCT_MEMBER(integrator, float, light_inv_rr_threshold)
151 /* Bounces. */
152 KERNEL_STRUCT_MEMBER(integrator, int, min_bounce)
153 KERNEL_STRUCT_MEMBER(integrator, int, max_bounce)
154 KERNEL_STRUCT_MEMBER(integrator, int, max_diffuse_bounce)
155 KERNEL_STRUCT_MEMBER(integrator, int, max_glossy_bounce)
156 KERNEL_STRUCT_MEMBER(integrator, int, max_transmission_bounce)
157 KERNEL_STRUCT_MEMBER(integrator, int, max_volume_bounce)
158 /* AO bounces. */
159 KERNEL_STRUCT_MEMBER(integrator, int, ao_bounces)
160 KERNEL_STRUCT_MEMBER(integrator, float, ao_bounces_distance)
161 KERNEL_STRUCT_MEMBER(integrator, float, ao_bounces_factor)
162 KERNEL_STRUCT_MEMBER(integrator, float, ao_additive_factor)
163 /* Transparency. */
164 KERNEL_STRUCT_MEMBER(integrator, int, transparent_min_bounce)
165 KERNEL_STRUCT_MEMBER(integrator, int, transparent_max_bounce)
166 KERNEL_STRUCT_MEMBER(integrator, int, transparent_shadows)
167 /* Caustics. */
168 KERNEL_STRUCT_MEMBER(integrator, int, caustics_reflective)
169 KERNEL_STRUCT_MEMBER(integrator, int, caustics_refractive)
170 KERNEL_STRUCT_MEMBER(integrator, float, filter_glossy)
171 /* Seed. */
172 KERNEL_STRUCT_MEMBER(integrator, int, seed)
173 /* Clamp. */
174 KERNEL_STRUCT_MEMBER(integrator, float, sample_clamp_direct)
175 KERNEL_STRUCT_MEMBER(integrator, float, sample_clamp_indirect)
176 /* MIS. */
177 KERNEL_STRUCT_MEMBER(integrator, int, use_lamp_mis)
178 /* Caustics. */
179 KERNEL_STRUCT_MEMBER(integrator, int, use_caustics)
180 /* Sampling pattern. */
181 KERNEL_STRUCT_MEMBER(integrator, int, sampling_pattern)
182 KERNEL_STRUCT_MEMBER(integrator, float, scrambling_distance)
183 /* Volume render. */
184 KERNEL_STRUCT_MEMBER(integrator, int, use_volumes)
185 KERNEL_STRUCT_MEMBER(integrator, int, volume_max_steps)
186 KERNEL_STRUCT_MEMBER(integrator, float, volume_step_rate)
187 /* Shadow catcher. */
188 KERNEL_STRUCT_MEMBER(integrator, int, has_shadow_catcher)
189 /* Closure filter. */
190 KERNEL_STRUCT_MEMBER(integrator, int, filter_closures)
191 /* MIS debugging. */
192 KERNEL_STRUCT_MEMBER(integrator, int, direct_light_sampling_type)
193 /* Padding */
194 KERNEL_STRUCT_MEMBER(integrator, int, pad1)
195 KERNEL_STRUCT_END(KernelIntegrator)
196 
197 /* SVM. For shader specialization. */
198 
199 KERNEL_STRUCT_BEGIN(KernelSVMUsage, svm_usage)
200 #define SHADER_NODE_TYPE(type) KERNEL_STRUCT_MEMBER(svm_usage, int, type)
202 KERNEL_STRUCT_END(KernelSVMUsage)
203 
204 #undef KERNEL_STRUCT_BEGIN
205 #undef KERNEL_STRUCT_MEMBER
206 #undef KERNEL_STRUCT_END
float float4[4]
static unsigned long seed
Definition: btSoftBody.h:39
#define KERNEL_STRUCT_END(name)
Definition: data_template.h:8
#define KERNEL_STRUCT_MEMBER(parent, type, name)
Definition: data_template.h:11
#define KERNEL_STRUCT_BEGIN(name, parent)
Definition: data_template.h:5
ccl_gpu_kernel_postfix ccl_global float int int int int int int int pass_stride
ccl_gpu_kernel_postfix ccl_global float int int int int int int int int int int int pass_sample_count