Blender V5.0
state_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/************************************ Path State *****************************/
6
8/* Index of a pixel within the device render buffer where this path will write its result.
9 * To get an actual offset within the buffer the value needs to be multiplied by the
10 * `kernel_data.film.pass_stride`.
11 *
12 * The multiplication is delayed for later, so that state can use 32bit integer. */
13KERNEL_STRUCT_MEMBER(path, uint32_t, render_pixel_index, KERNEL_FEATURE_PATH_TRACING)
14/* Current sample number. */
16/* Current ray bounce depth. */
18/* Current transparent ray bounce depth. */
19KERNEL_STRUCT_MEMBER(path, uint16_t, transparent_bounce, KERNEL_FEATURE_PATH_TRACING)
20/* Current diffuse ray bounce depth. */
21KERNEL_STRUCT_MEMBER(path, uint16_t, diffuse_bounce, KERNEL_FEATURE_PATH_TRACING)
22/* Current glossy ray bounce depth. */
23KERNEL_STRUCT_MEMBER(path, uint16_t, glossy_bounce, KERNEL_FEATURE_PATH_TRACING)
24/* Current transmission ray bounce depth. */
25KERNEL_STRUCT_MEMBER(path, uint16_t, transmission_bounce, KERNEL_FEATURE_PATH_TRACING)
26/* Current volume ray bounce depth. */
27KERNEL_STRUCT_MEMBER(path, uint16_t, volume_bounce, KERNEL_FEATURE_PATH_TRACING)
28/* Current volume bounds ray bounce depth. */
29KERNEL_STRUCT_MEMBER(path, uint16_t, volume_bounds_bounce, KERNEL_FEATURE_PATH_TRACING)
30/* Current portal ray bounce depth. */
31KERNEL_STRUCT_MEMBER(path, uint16_t, portal_bounce, KERNEL_FEATURE_NODE_PORTAL)
32/* DeviceKernel bit indicating queued kernels. */
33KERNEL_STRUCT_MEMBER(path, uint16_t, queued_kernel, KERNEL_FEATURE_PATH_TRACING)
34/* Random number generator per-pixel info. */
35KERNEL_STRUCT_MEMBER(path, uint32_t, rng_pixel, KERNEL_FEATURE_PATH_TRACING)
36/* Random number dimension offset. */
37KERNEL_STRUCT_MEMBER(path, uint16_t, rng_offset, KERNEL_FEATURE_PATH_TRACING)
38/* enum PathRayFlag */
40/* enum PathRayMNEE */
42/* Majorant volume optical depth. */
43KERNEL_STRUCT_MEMBER(path, float, optical_depth, KERNEL_FEATURE_PATH_TRACING)
44/* Multiple importance sampling
45 * The PDF of BSDF sampling at the last scatter point, which is at ray distance
46 * zero and distance. Note that transparency and volume attenuation increase
47 * the ray tmin but keep P unmodified so that this works. */
49/* Object at last scatter point for light linking. */
50KERNEL_STRUCT_MEMBER(path, int, mis_ray_object, KERNEL_FEATURE_LIGHT_LINKING)
51/* Normal at last scatter point for light tree. */
53/* Filter glossy. */
55/* Continuation probability for path termination. */
56KERNEL_STRUCT_MEMBER(path, float, continuation_probability, KERNEL_FEATURE_PATH_TRACING)
57/* Throughput. */
59/* Factor to multiple with throughput to get remove any guiding PDFS.
60 * Such throughput without guiding PDFS is used for Russian roulette termination. */
61KERNEL_STRUCT_MEMBER(path, float, unguided_throughput, KERNEL_FEATURE_PATH_GUIDING)
62/* Ratio of throughput to distinguish diffuse / glossy / transmission render passes. */
65/* Denoising. */
66KERNEL_STRUCT_MEMBER(path, PackedSpectrum, denoising_feature_throughput, KERNEL_FEATURE_DENOISING)
67/* Shader sorting. */
68/* TODO: compress as uint16? or leave out entirely and recompute key in sorting code? */
69KERNEL_STRUCT_MEMBER(path, uint32_t, shader_sort_key, KERNEL_FEATURE_PATH_TRACING)
71
72/************************************** Ray ***********************************/
73
82KERNEL_STRUCT_MEMBER(ray, float, previous_dt, KERNEL_FEATURE_LIGHT_TREE)
84
85/*************************** Intersection result ******************************/
86
87/* Result from scene intersection. */
96
97/*************** Subsurface closure state for subsurface kernel ***************/
98
102KERNEL_STRUCT_MEMBER_PACKED(subsurface, float, anisotropy, KERNEL_FEATURE_SUBSURFACE)
104KERNEL_STRUCT_END(subsurface)
105
106/********************************** Volume Stack ******************************/
107
108KERNEL_STRUCT_BEGIN(volume_stack)
109KERNEL_STRUCT_ARRAY_MEMBER(volume_stack, int, object, KERNEL_FEATURE_VOLUME)
110KERNEL_STRUCT_ARRAY_MEMBER(volume_stack, int, shader, KERNEL_FEATURE_VOLUME)
111KERNEL_STRUCT_END_ARRAY(volume_stack,
114
115/************************************ Path Guiding *****************************/
116KERNEL_STRUCT_BEGIN(guiding)
117#if defined(__PATH_GUIDING__)
118/* Current path segment of the random walk/path. */
120 openpgl::cpp::PathSegment *,
121 path_segment,
123#else
124/* Current path segment of the random walk/path. */
126#endif
127/* If surface guiding is enabled */
128KERNEL_STRUCT_MEMBER(guiding, bool, use_surface_guiding, KERNEL_FEATURE_PATH_GUIDING)
129/* Random number used for additional guiding decisions (e.g., cache query, selection to use guiding
130 * or BSDF sampling) */
131KERNEL_STRUCT_MEMBER(guiding, float, sample_surface_guiding_rand, KERNEL_FEATURE_PATH_GUIDING)
132/* The probability to use surface guiding (i.e., diffuse sampling prob * guiding prob)*/
133KERNEL_STRUCT_MEMBER(guiding, float, surface_guiding_sampling_prob, KERNEL_FEATURE_PATH_GUIDING)
134/* Probability of sampling a BSSRDF closure instead of a BSDF closure. */
135KERNEL_STRUCT_MEMBER(guiding, float, bssrdf_sampling_prob, KERNEL_FEATURE_PATH_GUIDING)
136/* If volume guiding is enabled */
137KERNEL_STRUCT_MEMBER(guiding, bool, use_volume_guiding, KERNEL_FEATURE_PATH_GUIDING)
138/* Random number used for additional guiding decisions (e.g., cache query, selection to use guiding
139 * or BSDF sampling) */
140KERNEL_STRUCT_MEMBER(guiding, float, sample_volume_guiding_rand, KERNEL_FEATURE_PATH_GUIDING)
141/* The probability to use surface guiding (i.e., diffuse sampling prob * guiding prob). */
142KERNEL_STRUCT_MEMBER(guiding, float, volume_guiding_sampling_prob, KERNEL_FEATURE_PATH_GUIDING)
143KERNEL_STRUCT_END(guiding)
144
145/******************************* Shadow linking *******************************/
146
147KERNEL_STRUCT_BEGIN(shadow_link)
148KERNEL_STRUCT_MEMBER(shadow_link, float, dedicated_light_weight, KERNEL_FEATURE_SHADOW_LINKING)
149/* Copy of primitive and object from the last main path intersection. */
150KERNEL_STRUCT_MEMBER(shadow_link, int, last_isect_prim, KERNEL_FEATURE_SHADOW_LINKING)
151KERNEL_STRUCT_MEMBER(shadow_link, int, last_isect_object, KERNEL_FEATURE_SHADOW_LINKING)
152KERNEL_STRUCT_END(shadow_link)
#define D
ATTR_WARN_UNUSED_RESULT const BMVert * v
unsigned long long int uint64_t
#define KERNEL_FEATURE_LIGHT_TREE
#define KERNEL_FEATURE_VOLUME
#define KERNEL_FEATURE_NODE_PORTAL
#define KERNEL_FEATURE_PATH_GUIDING
#define KERNEL_FEATURE_SUBSURFACE
#define KERNEL_FEATURE_LIGHT_PASSES
#define KERNEL_FEATURE_PATH_TRACING
#define KERNEL_FEATURE_SHADOW_LINKING
#define KERNEL_FEATURE_DENOISING
#define KERNEL_FEATURE_LIGHT_LINKING
#define N
#define KERNEL_STRUCT_END(name)
#define KERNEL_STRUCT_BEGIN(name)
#define KERNEL_STRUCT_VOLUME_STACK_SIZE
#define KERNEL_STRUCT_END_ARRAY(name, cpu_array_size, gpu_array_size)
#define KERNEL_STRUCT_MEMBER_PACKED
#define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature)
#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature)
#define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature)
packed_float3 PackedSpectrum
uint8_t flag
Definition wm_window.cc:145