Blender V5.3
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
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`. */
26
27/* -------------------------------------------------------------------- */
34
36 float x;
37 float y;
38 float z;
39 float w;
40};
41
43 float x;
44 float y;
45 float z;
46};
47
49 float x;
50 float y;
51};
52
54 float x;
55};
56
58{
59 return float4(data.x, data.y, data.z, data.w);
60}
61
63{
64 return float3(data.x, data.y, data.z);
65}
66
68{
69 return float2(data.x, data.y);
70}
71
73{
74 return float(data.x);
75}
76
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
88{
89 StoredFloat3 data;
90 data.x = interp.x;
91 data.y = interp.y;
92 data.z = interp.z;
93 return data;
94}
95
97{
98 StoredFloat2 data;
99 data.x = interp.x;
100 data.y = interp.y;
101 return data;
102}
103
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
115 uint x;
116};
117
119 uint x, y;
120};
121
123 uint x, y, z;
124};
125
127 uint x, y, z, w;
128};
129
#define host_shared
StoredFloat4 as_data(float4 interp)
float4 load_data(StoredFloat4 data)
ccl_device_inline float interp(const float a, const float b, const float t)
Definition math_base.h:549
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float