Blender V5.0
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, int, transparent)
29KERNEL_STRUCT_MEMBER(background, float, transparent_roughness_squared_threshold)
30/* Sun sampling. */
31KERNEL_STRUCT_MEMBER(background, float, sun_weight)
32/* Importance map sampling. */
33KERNEL_STRUCT_MEMBER(background, float, map_weight)
34KERNEL_STRUCT_MEMBER(background, float, portal_weight)
35KERNEL_STRUCT_MEMBER(background, int, map_res_x)
36KERNEL_STRUCT_MEMBER(background, int, map_res_y)
37/* Multiple importance sampling. */
38KERNEL_STRUCT_MEMBER(background, int, use_mis)
39/* Light-group. */
40KERNEL_STRUCT_MEMBER(background, int, lightgroup)
41/* Light Index. */
42KERNEL_STRUCT_MEMBER(background, int, light_index)
43/* Object Index. */
44KERNEL_STRUCT_MEMBER(background, int, object_index)
45/* Padding. */
46KERNEL_STRUCT_MEMBER(background, int, pad1)
47KERNEL_STRUCT_MEMBER(background, int, pad2)
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_volume_scatter)
107KERNEL_STRUCT_MEMBER(film, int, pass_volume_scatter_denoised)
108KERNEL_STRUCT_MEMBER(film, int, pass_volume_transmit)
109KERNEL_STRUCT_MEMBER(film, int, pass_volume_transmit_denoised)
110KERNEL_STRUCT_MEMBER(film, int, pass_volume_majorant)
111KERNEL_STRUCT_MEMBER(film, int, pass_volume_majorant_sample_count)
112KERNEL_STRUCT_MEMBER(film, int, pass_emission)
113KERNEL_STRUCT_MEMBER(film, int, pass_background)
114KERNEL_STRUCT_MEMBER(film, int, pass_ao)
115KERNEL_STRUCT_MEMBER(film, float, pass_alpha_threshold)
116KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher)
117KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_sample_count)
118KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_matte)
119KERNEL_STRUCT_MEMBER(film, int, pass_render_time)
120/* Cryptomatte. */
121KERNEL_STRUCT_MEMBER(film, int, cryptomatte_passes)
122KERNEL_STRUCT_MEMBER(film, int, cryptomatte_depth)
123KERNEL_STRUCT_MEMBER(film, int, pass_cryptomatte)
124/* Adaptive sampling. */
125KERNEL_STRUCT_MEMBER(film, int, pass_adaptive_aux_buffer)
126KERNEL_STRUCT_MEMBER(film, int, pass_sample_count)
127/* Mist. */
128KERNEL_STRUCT_MEMBER(film, int, pass_mist)
129KERNEL_STRUCT_MEMBER(film, float, mist_start)
130KERNEL_STRUCT_MEMBER(film, float, mist_inv_depth)
131KERNEL_STRUCT_MEMBER(film, float, mist_falloff)
132/* Denoising. */
133KERNEL_STRUCT_MEMBER(film, int, pass_denoising_normal)
134KERNEL_STRUCT_MEMBER(film, int, pass_denoising_albedo)
135KERNEL_STRUCT_MEMBER(film, int, pass_denoising_depth)
136/* AOVs. */
137KERNEL_STRUCT_MEMBER(film, int, pass_aov_color)
138KERNEL_STRUCT_MEMBER(film, int, pass_aov_value)
139/* Light groups. */
140KERNEL_STRUCT_MEMBER(film, int, pass_lightgroup)
141/* Baking. */
142KERNEL_STRUCT_MEMBER(film, int, pass_bake_primitive)
143KERNEL_STRUCT_MEMBER(film, int, pass_bake_seed)
144KERNEL_STRUCT_MEMBER(film, int, pass_bake_differential)
145/* Shadow catcher. */
146KERNEL_STRUCT_MEMBER(film, int, use_approximate_shadow_catcher)
147/* Path Guiding */
148KERNEL_STRUCT_MEMBER(film, int, pass_guiding_color)
149KERNEL_STRUCT_MEMBER(film, int, pass_guiding_probability)
150KERNEL_STRUCT_MEMBER(film, int, pass_guiding_avg_roughness)
151KERNEL_STRUCT_END(KernelFilm)
152
153/* Integrator. */
154
155KERNEL_STRUCT_BEGIN(KernelIntegrator, integrator)
156/* Emission. */
157KERNEL_STRUCT_MEMBER(integrator, int, use_direct_light)
158KERNEL_STRUCT_MEMBER(integrator, int, use_light_mis)
159KERNEL_STRUCT_MEMBER(integrator, int, use_light_tree)
160KERNEL_STRUCT_MEMBER(integrator, int, num_lights)
161KERNEL_STRUCT_MEMBER(integrator, int, num_distant_lights)
162KERNEL_STRUCT_MEMBER(integrator, int, num_background_lights)
163/* Portal sampling. */
164KERNEL_STRUCT_MEMBER(integrator, int, num_portals)
165KERNEL_STRUCT_MEMBER(integrator, int, portal_offset)
166/* Flat light distribution. */
167KERNEL_STRUCT_MEMBER(integrator, int, num_distribution)
168KERNEL_STRUCT_MEMBER(integrator, float, distribution_pdf_triangles)
169KERNEL_STRUCT_MEMBER(integrator, float, distribution_pdf_lights)
170KERNEL_STRUCT_MEMBER(integrator, float, light_inv_rr_threshold)
171/* Bounces. */
172KERNEL_STRUCT_MEMBER(integrator, int, min_bounce)
173KERNEL_STRUCT_MEMBER(integrator, int, max_bounce)
174KERNEL_STRUCT_MEMBER(integrator, int, max_diffuse_bounce)
175KERNEL_STRUCT_MEMBER(integrator, int, max_glossy_bounce)
176KERNEL_STRUCT_MEMBER(integrator, int, max_transmission_bounce)
177KERNEL_STRUCT_MEMBER(integrator, int, max_volume_bounce)
178/* AO bounces. */
179KERNEL_STRUCT_MEMBER(integrator, int, ao_bounces)
180KERNEL_STRUCT_MEMBER(integrator, float, ao_bounces_distance)
181KERNEL_STRUCT_MEMBER(integrator, float, ao_bounces_factor)
182KERNEL_STRUCT_MEMBER(integrator, float, ao_additive_factor)
183/* Transparency. */
184KERNEL_STRUCT_MEMBER(integrator, int, transparent_min_bounce)
185KERNEL_STRUCT_MEMBER(integrator, int, transparent_max_bounce)
186KERNEL_STRUCT_MEMBER(integrator, int, transparent_shadows)
187/* Caustics. */
188KERNEL_STRUCT_MEMBER(integrator, int, caustics_reflective)
189KERNEL_STRUCT_MEMBER(integrator, int, caustics_refractive)
190KERNEL_STRUCT_MEMBER(integrator, float, filter_glossy)
191/* Seed. */
193KERNEL_STRUCT_MEMBER(integrator, int, seed)
194/* Clamp. */
195KERNEL_STRUCT_MEMBER(integrator, float, sample_clamp_direct)
196KERNEL_STRUCT_MEMBER(integrator, float, sample_clamp_indirect)
197/* Caustics. */
198KERNEL_STRUCT_MEMBER(integrator, int, use_caustics)
199/* Sampling pattern. */
200KERNEL_STRUCT_MEMBER(integrator, int, sampling_pattern)
201KERNEL_STRUCT_MEMBER(integrator, float, scrambling_distance)
202/* Sobol pattern. */
204KERNEL_STRUCT_MEMBER(integrator, int, tabulated_sobol_sequence_size)
206KERNEL_STRUCT_MEMBER(integrator, int, sobol_index_mask)
208KERNEL_STRUCT_MEMBER(integrator, int, blue_noise_sequence_length)
209/* Volume render. */
210KERNEL_STRUCT_MEMBER(integrator, int, use_volumes)
211KERNEL_STRUCT_MEMBER(integrator, int, volume_ray_marching)
212KERNEL_STRUCT_MEMBER(integrator, int, volume_max_steps)
213/* Shadow catcher. */
214KERNEL_STRUCT_MEMBER(integrator, int, has_shadow_catcher)
215/* Closure filter. */
216KERNEL_STRUCT_MEMBER(integrator, int, filter_closures)
217/* MIS debugging. */
218KERNEL_STRUCT_MEMBER(integrator, int, direct_light_sampling_type)
219/* Path Guiding */
220KERNEL_STRUCT_MEMBER(integrator, float, surface_guiding_probability)
221KERNEL_STRUCT_MEMBER(integrator, float, volume_guiding_probability)
222KERNEL_STRUCT_MEMBER(integrator, int, guiding_distribution_type)
223KERNEL_STRUCT_MEMBER(integrator, int, guiding_directional_sampling_type)
224KERNEL_STRUCT_MEMBER(integrator, float, guiding_roughness_threshold)
225KERNEL_STRUCT_MEMBER(integrator, int, use_guiding)
226KERNEL_STRUCT_MEMBER(integrator, int, train_guiding)
227KERNEL_STRUCT_MEMBER(integrator, int, use_surface_guiding)
228KERNEL_STRUCT_MEMBER(integrator, int, use_volume_guiding)
229KERNEL_STRUCT_MEMBER(integrator, int, use_guiding_direct_light)
230KERNEL_STRUCT_MEMBER(integrator, int, use_guiding_mis_weights)
231
232/* Padding. */
233KERNEL_STRUCT_MEMBER(integrator, int, pad1)
234KERNEL_STRUCT_MEMBER(integrator, int, pad2)
235KERNEL_STRUCT_END(KernelIntegrator)
236
237/* SVM. For shader specialization. */
238
239KERNEL_STRUCT_BEGIN(KernelSVMUsage, svm_usage)
240#define SHADER_NODE_TYPE(type) KERNEL_STRUCT_MEMBER(svm_usage, int, type)
242KERNEL_STRUCT_END(KernelSVMUsage)
243
244#undef KERNEL_STRUCT_BEGIN
245#undef KERNEL_STRUCT_MEMBER
246#undef KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE
247#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)
#define KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE