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