Blender V5.3
shadow_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/********************************* Shadow Path State **************************/
6
7KERNEL_STRUCT_BEGIN(shadow_path)
8/* Index of a pixel within the device render buffer. */
9KERNEL_STRUCT_MEMBER(shadow_path, uint32_t, render_pixel_index, KERNEL_FEATURE_PATH_TRACING)
10/* Current sample number. */
12/* Random number generator per-pixel info. */
13KERNEL_STRUCT_MEMBER(shadow_path, uint32_t, rng_pixel, KERNEL_FEATURE_PATH_TRACING)
14/* Random number dimension offset. */
15KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, rng_offset, KERNEL_FEATURE_PATH_TRACING)
16/* Current ray bounce depth. */
17KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, bounce, KERNEL_FEATURE_PATH_TRACING)
18/* Current transparent ray bounce depth. */
19KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, transparent_bounce, KERNEL_FEATURE_PATH_TRACING)
20/* Current diffuse ray bounce depth. */
21KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, diffuse_bounce, KERNEL_FEATURE_PATH_TRACING)
22/* Current glossy ray bounce depth. */
23KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, glossy_bounce, KERNEL_FEATURE_PATH_TRACING)
24/* Current transmission ray bounce depth. */
25KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, transmission_bounce, KERNEL_FEATURE_PATH_TRACING)
26/* Current volume bounds ray bounce depth. */
27KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, volume_bounds_bounce, KERNEL_FEATURE_PATH_TRACING)
28/* Current portal ray bounce depth. */
29KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, portal_bounce, KERNEL_FEATURE_NODE_PORTAL)
30/* DeviceKernel bit indicating queued kernels. */
31KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, queued_kernel, KERNEL_FEATURE_PATH_TRACING)
32/* enum PathRayVisibilityFlag, limited to bits from PATH_RAY_VISIBILITY_ALL */
33KERNEL_STRUCT_MEMBER(shadow_path, uint8_t, visibility, KERNEL_FEATURE_PATH_TRACING)
34/* enum PathRayFlag */
35KERNEL_STRUCT_MEMBER(shadow_path, uint32_t, flag, KERNEL_FEATURE_PATH_TRACING)
36/* Throughput. */
38/* Throughput for shadow pass. */
41 unshadowed_throughput,
43/* Ratio of throughput to distinguish diffuse / glossy / transmission render passes. */
44KERNEL_STRUCT_MEMBER(shadow_path,
50 pass_glossy_weight,
52/* Packed number of intersections found by ray-tracing, and on GPU also the resume hit index
53 * and skip_volume flag for cache miss handling.
54 * Note that this is the total number of intersections for the shadow ray.
55 * The number of recorded intersections in the shadow_isect array might be different as it contains
56 * up INTEGRATOR_SHADOW_ISECT_SIZE closest intersections. */
57KERNEL_STRUCT_MEMBER(shadow_path, uint16_t, packed_num_hits, KERNEL_FEATURE_PATH_TRACING)
58/* Light group. */
59KERNEL_STRUCT_MEMBER(shadow_path, uint8_t, lightgroup, KERNEL_FEATURE_PATH_TRACING)
60/* Path guiding. */
61KERNEL_STRUCT_MEMBER(shadow_path,
65#if defined(__PATH_GUIDING__)
66KERNEL_STRUCT_MEMBER(shadow_path,
67 openpgl::cpp::PathSegment *,
68 path_segment,
70#else
72#endif
74 float,
75 guiding_light_linking_mis_weight,
77/* Only need when path tracing without the light tree. Stored as a single float to save
78 * space, as we do not expect to make it a big difference. */
79KERNEL_STRUCT_MEMBER(shadow_path,
80 float,
83KERNEL_STRUCT_END(shadow_path)
84
85/********************************** Shadow Ray *******************************/
86
93KERNEL_STRUCT_MEMBER_PACKED(shadow_ray, int, self_light_object, KERNEL_FEATURE_PATH_TRACING)
94KERNEL_STRUCT_MEMBER_PACKED(shadow_ray, int, self_light_prim, KERNEL_FEATURE_PATH_TRACING)
97KERNEL_STRUCT_END(shadow_ray)
98
99/*********************** Shadow Intersection result **************************/
100
101/* Result from scene intersection.
102 * It contains INTEGRATOR_SHADOW_ISECT_SIZE closest intersections of the shadow ray. */
103KERNEL_STRUCT_BEGIN(shadow_isect)
110KERNEL_STRUCT_END_ARRAY(shadow_isect,
113
114/**************************** Shadow Volume Stack *****************************/
115
116KERNEL_STRUCT_BEGIN(shadow_volume_stack)
117KERNEL_STRUCT_ARRAY_MEMBER(shadow_volume_stack, int, object, KERNEL_FEATURE_VOLUME)
118KERNEL_STRUCT_ARRAY_MEMBER(shadow_volume_stack, int, shader, KERNEL_FEATURE_VOLUME)
119KERNEL_STRUCT_END_ARRAY(shadow_volume_stack,
#define D
unsigned long long int uint64_t
#define KERNEL_FEATURE_LIGHT_TREE
#define KERNEL_FEATURE_VOLUME
#define KERNEL_FEATURE_NODE_PORTAL
#define INTEGRATOR_SHADOW_ISECT_SIZE_CPU
#define KERNEL_FEATURE_PATH_GUIDING
#define INTEGRATOR_SHADOW_ISECT_SIZE_GPU
#define KERNEL_FEATURE_LIGHT_PASSES
#define KERNEL_FEATURE_PATH_TRACING
#define KERNEL_FEATURE_AO_ADDITIVE
#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)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING bsdf_eval_average
pass_diffuse_weight
KERNEL_FEATURE_LIGHT_PASSES unlit_throughput
KernelFeatureRequest(const uint64_t on)
Definition features.h:237
packed_float3 PackedSpectrum