12
12
#include < NZSL/Ast/Enums.hpp>
13
13
#include < NZSL/Ast/ExpressionValue.hpp>
14
14
#include < NZSL/Lang/SourceLocation.hpp>
15
- #include < optional>
16
15
#include < string>
17
16
#include < variant>
18
17
#include < vector>
19
18
20
- #ifdef NAZARA_COMPILER_GCC
21
- #pragma GCC diagnostic push
22
- #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
23
- #endif
19
+ NAZARA_WARNING_PUSH ()
20
+ NAZARA_WARNING_GCC_DISABLE(" -Wmaybe-uninitialized" )
24
21
25
22
namespace nzsl
26
23
{
@@ -137,6 +134,22 @@ namespace nzsl::Ast
137
134
inline bool operator !=(const MethodType& rhs) const ;
138
135
};
139
136
137
+ struct ModuleType
138
+ {
139
+ std::size_t moduleIndex;
140
+
141
+ inline bool operator ==(const ModuleType& rhs) const ;
142
+ inline bool operator !=(const ModuleType& rhs) const ;
143
+ };
144
+
145
+ struct NamedExternalBlockType
146
+ {
147
+ std::size_t namedExternalBlockIndex;
148
+
149
+ inline bool operator ==(const NamedExternalBlockType& rhs) const ;
150
+ inline bool operator !=(const NamedExternalBlockType& rhs) const ;
151
+ };
152
+
140
153
struct NoType
141
154
{
142
155
inline bool operator ==(const NoType& rhs) const ;
@@ -216,7 +229,7 @@ namespace nzsl::Ast
216
229
inline bool operator !=(const PushConstantType& rhs) const ;
217
230
};
218
231
219
- using ExpressionType = std::variant<NoType, AliasType, ArrayType, DynArrayType, FunctionType, IntrinsicFunctionType, MatrixType, MethodType, PrimitiveType, PushConstantType, SamplerType, StorageType, StructType, TextureType, Type, UniformType, VectorType>;
232
+ using ExpressionType = std::variant<NoType, AliasType, ArrayType, DynArrayType, FunctionType, IntrinsicFunctionType, MatrixType, MethodType, ModuleType, NamedExternalBlockType, PrimitiveType, PushConstantType, SamplerType, StorageType, StructType, TextureType, Type, UniformType, VectorType>;
220
233
221
234
struct ContainedType
222
235
{
@@ -252,6 +265,8 @@ namespace nzsl::Ast
252
265
inline bool IsIntrinsicFunctionType (const ExpressionType& type);
253
266
inline bool IsMatrixType (const ExpressionType& type);
254
267
inline bool IsMethodType (const ExpressionType& type);
268
+ inline bool IsModuleType (const ExpressionType& type);
269
+ inline bool IsNamedExternalBlockType (const ExpressionType& type);
255
270
inline bool IsNoType (const ExpressionType& type);
256
271
inline bool IsPrimitiveType (const ExpressionType& type);
257
272
inline bool IsPushConstantType (const ExpressionType& type);
@@ -296,6 +311,8 @@ namespace nzsl::Ast
296
311
struct Stringifier
297
312
{
298
313
std::function<std::string(std::size_t aliasIndex)> aliasStringifier;
314
+ std::function<std::string(std::size_t moduleIndex)> moduleStringifier;
315
+ std::function<std::string(std::size_t moduleIndex)> namedExternalBlockStringifier;
299
316
std::function<std::string(std::size_t structIndex)> structStringifier;
300
317
std::function<std::string(std::size_t typeIndex)> typeStringifier;
301
318
};
@@ -308,6 +325,8 @@ namespace nzsl::Ast
308
325
NZSL_API std::string ToString (const IntrinsicFunctionType& type, const Stringifier& stringifier = {});
309
326
NZSL_API std::string ToString (const MatrixType& type, const Stringifier& stringifier = {});
310
327
NZSL_API std::string ToString (const MethodType& type, const Stringifier& stringifier = {});
328
+ NZSL_API std::string ToString (const ModuleType& type, const Stringifier& stringifier = {});
329
+ NZSL_API std::string ToString (const NamedExternalBlockType& type, const Stringifier& stringifier = {});
311
330
NZSL_API std::string ToString (NoType type, const Stringifier& stringifier = {});
312
331
NZSL_API std::string ToString (PrimitiveType type, const Stringifier& stringifier = {});
313
332
NZSL_API std::string ToString (const PushConstantType& type, const Stringifier& stringifier = {});
@@ -320,9 +339,7 @@ namespace nzsl::Ast
320
339
NZSL_API std::string ToString (const VectorType& type, const Stringifier& stringifier = {});
321
340
}
322
341
323
- #ifdef NAZARA_COMPILER_GCC
324
- #pragma GCC diagnostic pop
325
- #endif
342
+ NAZARA_WARNING_POP ()
326
343
327
344
#include < NZSL/Ast/ExpressionType.inl>
328
345
0 commit comments