Blender
V5.3
source
blender
draw
intern
draw_attribute_shader_shared.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2025 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#pragma once
10
11
#ifndef GPU_SHADER
12
# include "
GPU_shader_shared_utils.hh
"
13
#endif
14
15
#ifdef GPU_SHADER
16
# include "
gpu_shader_compat.hh
"
17
#endif
18
19
/* Copy of DNA enum in `DNA_curves_types.h`. */
20
enum
[[
host_shared
]]
CurveType
: uint32_t {
21
CURVE_TYPE_CATMULL_ROM
= 0u,
22
CURVE_TYPE_POLY
= 1u,
23
CURVE_TYPE_BEZIER
= 2u,
24
CURVE_TYPE_NURBS
= 3u,
25
};
26
27
/* -------------------------------------------------------------------- */
34
35
struct
[[
host_shared
]]
StoredFloat4
{
36
float
x
;
37
float
y
;
38
float
z
;
39
float
w
;
40
};
41
42
struct
[[
host_shared
]]
StoredFloat3
{
43
float
x
;
44
float
y
;
45
float
z
;
46
};
47
48
struct
[[
host_shared
]]
StoredFloat2
{
49
float
x
;
50
float
y
;
51
};
52
53
struct
[[
host_shared
]]
StoredFloat
{
54
float
x
;
55
};
56
57
float4
load_data
(
StoredFloat4
data)
58
{
59
return
float4
(data.x, data.y, data.z, data.w);
60
}
61
62
float3
load_data
(
StoredFloat3
data)
63
{
64
return
float3
(data.x, data.y, data.z);
65
}
66
67
float2
load_data
(
StoredFloat2
data)
68
{
69
return
float2
(data.x, data.y);
70
}
71
72
float
load_data
(
StoredFloat
data)
73
{
74
return
float
(data.x);
75
}
76
77
StoredFloat4
as_data
(
float4
interp
)
78
{
79
StoredFloat4
data;
80
data.x =
interp
.x;
81
data.y =
interp
.y;
82
data.z =
interp
.z;
83
data.w =
interp
.w;
84
return
data;
85
}
86
87
StoredFloat3
as_data
(
float3
interp
)
88
{
89
StoredFloat3
data;
90
data.x =
interp
.x;
91
data.y =
interp
.y;
92
data.z =
interp
.z;
93
return
data;
94
}
95
96
StoredFloat2
as_data
(
float2
interp
)
97
{
98
StoredFloat2
data;
99
data.x =
interp
.x;
100
data.y =
interp
.y;
101
return
data;
102
}
103
104
StoredFloat
as_data
(
float
interp
)
105
{
106
StoredFloat
data;
107
data.x =
interp
;
108
return
data;
109
}
110
111
/* `uint` versions of the above structs to avoid special behavior when copying types that are not
112
* actually floats. */
113
114
struct
StoredUint
{
115
uint
x
;
116
};
117
118
struct
StoredUint2
{
119
uint
x
,
y
;
120
};
121
122
struct
StoredUint3
{
123
uint
x
,
y
,
z
;
124
};
125
126
struct
StoredUint4
{
127
uint
x
,
y
,
z
,
w
;
128
};
129
GPU_shader_shared_utils.hh
host_shared
#define host_shared
Definition
GPU_shader_shared_utils.hh:144
as_data
StoredFloat4 as_data(float4 interp)
Definition
draw_attribute_shader_shared.hh:77
load_data
float4 load_data(StoredFloat4 data)
Definition
draw_attribute_shader_shared.hh:57
CurveType
CurveType
Definition
draw_attribute_shader_shared.hh:20
CURVE_TYPE_BEZIER
@ CURVE_TYPE_BEZIER
Definition
draw_attribute_shader_shared.hh:23
CURVE_TYPE_NURBS
@ CURVE_TYPE_NURBS
Definition
draw_attribute_shader_shared.hh:24
CURVE_TYPE_POLY
@ CURVE_TYPE_POLY
Definition
draw_attribute_shader_shared.hh:22
CURVE_TYPE_CATMULL_ROM
@ CURVE_TYPE_CATMULL_ROM
Definition
draw_attribute_shader_shared.hh:21
gpu_shader_compat.hh
interp
ccl_device_inline float interp(const float a, const float b, const float t)
Definition
math_base.h:549
float
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
Definition
shadow_state_template.h:80
StoredFloat2
Definition
draw_attribute_shader_shared.hh:48
StoredFloat2::x
float x
Definition
draw_attribute_shader_shared.hh:49
StoredFloat2::y
float y
Definition
draw_attribute_shader_shared.hh:50
StoredFloat3
Definition
draw_attribute_shader_shared.hh:42
StoredFloat3::z
float z
Definition
draw_attribute_shader_shared.hh:45
StoredFloat3::x
float x
Definition
draw_attribute_shader_shared.hh:43
StoredFloat3::y
float y
Definition
draw_attribute_shader_shared.hh:44
StoredFloat4
Definition
draw_attribute_shader_shared.hh:35
StoredFloat4::w
float w
Definition
draw_attribute_shader_shared.hh:39
StoredFloat4::z
float z
Definition
draw_attribute_shader_shared.hh:38
StoredFloat4::y
float y
Definition
draw_attribute_shader_shared.hh:37
StoredFloat4::x
float x
Definition
draw_attribute_shader_shared.hh:36
StoredFloat
Definition
draw_attribute_shader_shared.hh:53
StoredFloat::x
float x
Definition
draw_attribute_shader_shared.hh:54
StoredUint2
Definition
draw_attribute_shader_shared.hh:118
StoredUint2::x
uint x
Definition
draw_attribute_shader_shared.hh:119
StoredUint2::y
uint y
Definition
draw_attribute_shader_shared.hh:119
StoredUint3
Definition
draw_attribute_shader_shared.hh:122
StoredUint3::x
uint x
Definition
draw_attribute_shader_shared.hh:123
StoredUint3::y
uint y
Definition
draw_attribute_shader_shared.hh:123
StoredUint3::z
uint z
Definition
draw_attribute_shader_shared.hh:123
StoredUint4
Definition
draw_attribute_shader_shared.hh:126
StoredUint4::z
uint z
Definition
draw_attribute_shader_shared.hh:127
StoredUint4::w
uint w
Definition
draw_attribute_shader_shared.hh:127
StoredUint4::y
uint y
Definition
draw_attribute_shader_shared.hh:127
StoredUint4::x
uint x
Definition
draw_attribute_shader_shared.hh:127
StoredUint
Definition
draw_attribute_shader_shared.hh:114
StoredUint::x
uint x
Definition
draw_attribute_shader_shared.hh:115
float2
Definition
types_float2.h:13
float3
Definition
sky_math.h:135
float4
Definition
sky_math.h:224
Generated on
for Blender by
doxygen
1.18.0