2
3
4
5
6
7
8
11#ifndef _GLSL_STRUCT_STRUCT_CHECKS_HPP_
12 #define _GLSL_STRUCT_STRUCT_CHECKS_HPP_
14 #include <glslstruct/config.hpp>
17_GLSL_STRUCT_ERROR(
"This is only available for c++17 and greater!");
20 #include <glslstruct/type/checks/layouts_checks.hpp>
24 template<utils::glsl_layout Layout>
26 template<
class Layout, std::enable_if_t<utils::is_glsl_layout_v<Layout>,
bool> =
true>
31
32
33
34 using std140_struct = base_struct<std140_layout>;
36
37
38
39 using std430_struct = base_struct<std430_layout>;
41
42
43
44 using scalar_struct = base_struct<scalar_layout>;
47 #pragma region IS_STRUCT
50
51
52
53
55 struct is_glsl_struct : std::false_type {};
58 struct is_glsl_struct<base_struct<L> > : std::true_type {};
61
62
63
64
70
71
72
73
74 template<
class S> concept glsl_struct = is_glsl_struct_v<S>;
78 #pragma region IS_STRUCTS_VECTOR
80
81
82
88
89
90
91 template<
class T> concept glsl_structs_array = is_glsl_structs_array_v<T>;
95 #pragma region IS_LAYOUT_STRUCT
98
99
100
101
102
103 template<
class S,
class Layout>
104 struct is_glsl_layout_struct : std::false_type {};
106 template<
class L,
class Layout>
107 struct is_glsl_layout_struct<base_struct<Layout>, L> : std::bool_constant<std::is_same_v<Layout, L> > {};
110
111
112
113
114
115 template<
class S,
class Layout>
120
121
122
123
124
125 template<
class S,
class Layout> concept glsl_layout_struct = is_glsl_layout_struct_v<S, Layout>;
129 #pragma region IS_LAYOUT_STRUCTS_VECTOR
131
132
133
134
135
136 template<
class VS,
class Layout>
141
142
143
144
145
146 template<
class VS,
class Layout> concept glsl_layout_structs_array = is_glsl_layout_structs_array_v<VS, Layout>;
150 #pragma region IS_SIMPLE_OR_LAYOUT_STRUCT
152
153
154
155
156
157 template<
class T,
class Layout>
159 is_glsl_simple_v<T> || is_glsl_layout_struct_v<T, Layout>;
163
164
165
166
167
168 template<
class T,
class Layout> concept glsl_simple_or_layout_struct = is_glsl_simple_or_layout_struct_v<T, Layout>;
172 #pragma region IS_SIMPLE_OR_STRUCT
174
175
176
177
183
184
185
186
187 template<
class T> concept glsl_simple_or_struct = is_glsl_simple_or_struct_v<T>;
#define _GLSL_STRUCT_HAS_CXX20
check if compiler has c++ version greater or equal to c++20 and if user enabled c++20 features using ...
Definition config.hpp:142
#define _GLSL_STRUCT_HAS_CXX17
check if compiler has c++ version greater or equal to c++17
Definition config.hpp:130
#define _GLSL_STRUCT_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:196