Blender
V3.3
intern
cycles
kernel
osl
kernel/osl/shader.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: Apache-2.0
2
* Copyright 2011-2022 Blender Foundation */
3
4
#ifndef __OSL_SHADER_H__
5
#define __OSL_SHADER_H__
6
7
#ifdef WITH_OSL
8
9
/* OSL Shader Engine
10
*
11
* Holds all variables to execute and use OSL shaders from the kernel. These
12
* are initialized externally by OSLShaderManager before rendering starts.
13
*
14
* Before/after a thread starts rendering, thread_init/thread_free must be
15
* called, which will store any per thread OSL state in thread local storage.
16
* This means no thread state must be passed along in the kernel itself.
17
*/
18
19
# include "
kernel/types.h
"
20
21
CCL_NAMESPACE_BEGIN
22
23
class
Scene
;
24
25
struct
ShaderClosure
;
26
struct
ShaderData
;
27
struct
IntegratorStateCPU
;
28
struct
differential3
;
29
struct
KernelGlobalsCPU
;
30
31
struct
OSLGlobals;
32
struct
OSLShadingSystem;
33
34
class
OSLShader {
35
public
:
36
/* init */
37
static
void
register_closures(OSLShadingSystem *ss);
38
39
/* per thread data */
40
static
void
thread_init(
KernelGlobalsCPU
*kg, OSLGlobals *osl_globals);
41
static
void
thread_free(
KernelGlobalsCPU
*kg);
42
43
/* eval */
44
static
void
eval_surface(
const
KernelGlobalsCPU
*kg,
45
const
void
*
state
,
46
ShaderData
*sd,
47
uint32_t
path_flag);
48
static
void
eval_background(
const
KernelGlobalsCPU
*kg,
49
const
void
*
state
,
50
ShaderData
*sd,
51
uint32_t
path_flag);
52
static
void
eval_volume(
const
KernelGlobalsCPU
*kg,
53
const
void
*
state
,
54
ShaderData
*sd,
55
uint32_t
path_flag);
56
static
void
eval_displacement
(
const
KernelGlobalsCPU
*kg,
const
void
*
state
,
ShaderData
*sd);
57
58
/* attributes */
59
static
int
find_attribute
(
const
KernelGlobalsCPU
*kg,
60
const
ShaderData
*sd,
61
uint
id
,
62
AttributeDescriptor
*desc);
63
};
64
65
CCL_NAMESPACE_END
66
67
#endif
68
69
#endif
/* __OSL_SHADER_H__ */
uint
unsigned int uint
Definition:
BLI_sys_types.h:67
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition:
cuda/compat.h:9
state
const int state
Definition:
kernel/device/gpu/kernel.h:89
find_attribute
ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals kg, ccl_private const ShaderData *sd, uint id)
Definition:
kernel/geom/attribute.h:48
types.h
ShaderData
ShaderData
Definition:
kernel/types.h:925
ShaderClosure
ShaderClosure
Definition:
kernel/types.h:726
CCL_NAMESPACE_BEGIN
Definition:
python.cpp:37
uint32_t
unsigned int uint32_t
Definition:
stdint.h:80
AttributeDescriptor
Definition:
kernel/types.h:655
IntegratorStateCPU
Definition:
state.h:62
KernelGlobalsCPU
Definition:
device/cpu/globals.h:37
Scene
Definition:
DNA_scene_types.h:1739
differential3
Definition:
kernel/types.h:504
eval_displacement
static void eval_displacement(SubdivDisplacement *displacement, const int ptex_face_index, const float u, const float v, const float dPdu[3], const float dPdv[3], float r_D[3])
Definition:
subdiv_displacement_multires.c:321
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1