Blender V4.3
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. */
14/* Current sample number. */
16/* Current ray bounce depth. */
18/* Current transparent ray bounce depth. */
20/* Current diffuse ray bounce depth. */
22/* Current glossy ray bounce depth. */
24/* Current transmission ray bounce depth. */
26/* Current volume ray bounce depth. */
28/* Current volume bounds ray bounce depth. */
30/* DeviceKernel bit indicating queued kernels. */
32/* Random number generator per-pixel info. */
34/* Random number dimension offset. */
36/* enum PathRayFlag */
38/* enum PathRayMNEE */
40/* Multiple importance sampling
41 * The PDF of BSDF sampling at the last scatter point, which is at ray distance
42 * zero and distance. Note that transparency and volume attenuation increase
43 * the ray tmin but keep P unmodified so that this works. */
45/* Object at last scatter point for light linking. */
46KERNEL_STRUCT_MEMBER(path, int, mis_ray_object, KERNEL_FEATURE_LIGHT_LINKING)
47/* Normal at last scatter point for light tree. */
49/* Filter glossy. */
51/* Continuation probability for path termination. */
52KERNEL_STRUCT_MEMBER(path, float, continuation_probability, KERNEL_FEATURE_PATH_TRACING)
53/* Throughput. */
55/* Factor to multiple with throughput to get remove any guiding PDFS.
56 * Such throughput without guiding PDFS is used for Russian roulette termination. */
57KERNEL_STRUCT_MEMBER(path, float, unguided_throughput, KERNEL_FEATURE_PATH_GUIDING)
58/* Ratio of throughput to distinguish diffuse / glossy / transmission render passes. */
61/* Denoising. */
62KERNEL_STRUCT_MEMBER(path, PackedSpectrum, denoising_feature_throughput, KERNEL_FEATURE_DENOISING)
63/* Shader sorting. */
64/* TODO: compress as uint16? or leave out entirely and recompute key in sorting code? */
67
68/************************************** Ray ***********************************/
69
78KERNEL_STRUCT_MEMBER(ray, float, previous_dt, KERNEL_FEATURE_LIGHT_TREE)
80
81/*************************** Intersection result ******************************/
82
83/* Result from scene intersection. */
92
93/*************** Subsurface closure state for subsurface kernel ***************/
94
98KERNEL_STRUCT_MEMBER_PACKED(subsurface, float, anisotropy, KERNEL_FEATURE_SUBSURFACE)
100KERNEL_STRUCT_END(subsurface)
101
102/********************************** Volume Stack ******************************/
103
104KERNEL_STRUCT_BEGIN(volume_stack)
105KERNEL_STRUCT_ARRAY_MEMBER(volume_stack, int, object, KERNEL_FEATURE_VOLUME)
106KERNEL_STRUCT_ARRAY_MEMBER(volume_stack, int, shader, KERNEL_FEATURE_VOLUME)
107KERNEL_STRUCT_END_ARRAY(volume_stack,
110
111/************************************ Path Guiding *****************************/
112KERNEL_STRUCT_BEGIN(guiding)
113#ifdef __PATH_GUIDING__
114/* Current path segment of the random walk/path. */
116 openpgl::cpp::PathSegment *,
117 path_segment,
119#else
120/* Current path segment of the random walk/path. */
122#endif
123/* If surface guiding is enabled */
124KERNEL_STRUCT_MEMBER(guiding, bool, use_surface_guiding, KERNEL_FEATURE_PATH_GUIDING)
125/* Random number used for additional guiding decisions (e.g., cache query, selection to use guiding
126 * or BSDF sampling) */
127KERNEL_STRUCT_MEMBER(guiding, float, sample_surface_guiding_rand, KERNEL_FEATURE_PATH_GUIDING)
128/* The probability to use surface guiding (i.e., diffuse sampling prob * guiding prob)*/
129KERNEL_STRUCT_MEMBER(guiding, float, surface_guiding_sampling_prob, KERNEL_FEATURE_PATH_GUIDING)
130/* Probability of sampling a BSSRDF closure instead of a BSDF closure. */
131KERNEL_STRUCT_MEMBER(guiding, float, bssrdf_sampling_prob, KERNEL_FEATURE_PATH_GUIDING)
132/* If volume guiding is enabled */
133KERNEL_STRUCT_MEMBER(guiding, bool, use_volume_guiding, KERNEL_FEATURE_PATH_GUIDING)
134/* Random number used for additional guiding decisions (e.g., cache query, selection to use guiding
135 * or BSDF sampling) */
136KERNEL_STRUCT_MEMBER(guiding, float, sample_volume_guiding_rand, KERNEL_FEATURE_PATH_GUIDING)
137/* The probability to use surface guiding (i.e., diffuse sampling prob * guiding prob). */
138KERNEL_STRUCT_MEMBER(guiding, float, volume_guiding_sampling_prob, KERNEL_FEATURE_PATH_GUIDING)
139KERNEL_STRUCT_END(guiding)
140
141/******************************* Shadow linking *******************************/
142
143KERNEL_STRUCT_BEGIN(shadow_link)
144KERNEL_STRUCT_MEMBER(shadow_link, float, dedicated_light_weight, KERNEL_FEATURE_SHADOW_LINKING)
145/* Copy of primitive and object from the last main path intersection. */
146KERNEL_STRUCT_MEMBER(shadow_link, int, last_isect_prim, KERNEL_FEATURE_SHADOW_LINKING)
147KERNEL_STRUCT_MEMBER(shadow_link, int, last_isect_object, KERNEL_FEATURE_SHADOW_LINKING)
148KERNEL_STRUCT_END(shadow_link)
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define KERNEL_FEATURE_LIGHT_TREE
#define KERNEL_FEATURE_VOLUME
#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)
unsigned short uint16_t
Definition stdint.h:79
unsigned int uint32_t
Definition stdint.h:80
unsigned char uint8_t
Definition stdint.h:78
unsigned __int64 uint64_t
Definition stdint.h:90
PACKED_SPECTRUM_DATA_TYPE PackedSpectrum
uint8_t flag
Definition wm_window.cc:138