Blender V4.3
device/optix/globals.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/* Constant Globals */
6
7#pragma once
8
9#include "kernel/types.h"
10
12
14
16
17/* Not actually used, just a NULL pointer that gets passed everywhere, which we
18 * hope gets optimized out by the compiler. */
19struct KernelGlobalsGPU {
20 int unused[1];
21};
23
24/* Launch parameters */
26 /* Kernel arguments */
27 const int *path_index_array;
29 int offset;
30
31 /* Global scene data and textures */
33#define KERNEL_DATA_ARRAY(type, name) const type *name;
34#include "kernel/data_arrays.h"
35
36 /* Integrator state */
38};
39
40#ifdef __NVCC__
41extern "C"
42# ifndef __CUDACC_RDC__
43 static
44# endif
45 __constant__ KernelParamsOptiX kernel_params;
46#endif
47
48/* Abstraction macros */
49#define kernel_data kernel_params.data
50#define kernel_data_array(name) kernel_params.name
51#define kernel_data_fetch(name, index) kernel_params.name[(index)]
52#define kernel_integrator_state kernel_params.integrator_state
53
#define ccl_restrict
#define ccl_global
#define CCL_NAMESPACE_END
ccl_global const KernelGlobalsGPU *ccl_restrict KernelGlobals
KernelData
IntegratorStateGPU integrator_state