HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GlslSyntax.h
Go to the documentation of this file.
1 //
2 // Copyright Contributors to the MaterialX Project
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 
6 #ifndef MATERIALX_GLSL_SYNTAX_H
7 #define MATERIALX_GLSL_SYNTAX_H
8 
9 /// @file
10 /// GLSL syntax class
11 
13 
15 
17 
18 /// Syntax class for GLSL (OpenGL Shading Language)
20 {
21  public:
22  GlslSyntax();
23 
24  static SyntaxPtr create() { return std::make_shared<GlslSyntax>(); }
25 
26  const string& getInputQualifier() const override { return INPUT_QUALIFIER; }
27  const string& getOutputQualifier() const override { return OUTPUT_QUALIFIER; }
28  const string& getConstantQualifier() const override { return CONSTANT_QUALIFIER; };
29  const string& getUniformQualifier() const override { return UNIFORM_QUALIFIER; };
30  const string& getSourceFileExtension() const override { return SOURCE_FILE_EXTENSION; };
31 
32  bool typeSupported(const TypeDesc* type) const override;
33 
34  /// Given an input specification attempt to remap this to an enumeration which is accepted by
35  /// the shader generator. The enumeration may be converted to a different type than the input.
36  bool remapEnumeration(const string& value, const TypeDesc* type, const string& enumNames, std::pair<const TypeDesc*, ValuePtr>& result) const override;
37 
38  static const string INPUT_QUALIFIER;
39  static const string OUTPUT_QUALIFIER;
40  static const string UNIFORM_QUALIFIER;
41  static const string CONSTANT_QUALIFIER;
42  static const string FLAT_QUALIFIER;
43  static const string SOURCE_FILE_EXTENSION;
44 
45  static const StringVec VEC2_MEMBERS;
46  static const StringVec VEC3_MEMBERS;
47  static const StringVec VEC4_MEMBERS;
48 };
49 
51 
52 #endif
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
vector< string > StringVec
A vector of strings.
Definition: Library.h:57
virtual bool typeSupported(const TypeDesc *type) const
shared_ptr< Syntax > SyntaxPtr
Shared pointer to a Syntax.
Definition: Syntax.h:26
static const string INPUT_QUALIFIER
Definition: GlslSyntax.h:38
**But if you need a result
Definition: thread.h:613
static const StringVec VEC3_MEMBERS
Definition: GlslSyntax.h:46
static const StringVec VEC2_MEMBERS
Definition: GlslSyntax.h:45
Syntax class for GLSL (OpenGL Shading Language)
Definition: GlslSyntax.h:19
static const string FLAT_QUALIFIER
Definition: GlslSyntax.h:42
const string & getOutputQualifier() const override
Definition: GlslSyntax.h:27
const string & getConstantQualifier() const override
Definition: GlslSyntax.h:28
virtual bool remapEnumeration(const string &value, const TypeDesc *type, const string &enumNames, std::pair< const TypeDesc *, ValuePtr > &result) const
static const string OUTPUT_QUALIFIER
Definition: GlslSyntax.h:39
static SyntaxPtr create()
Definition: GlslSyntax.h:24
const string & getInputQualifier() const override
Definition: GlslSyntax.h:26
static const string SOURCE_FILE_EXTENSION
Definition: GlslSyntax.h:43
static const StringVec VEC4_MEMBERS
Definition: GlslSyntax.h:47
static const string UNIFORM_QUALIFIER
Definition: GlslSyntax.h:40
const string & getSourceFileExtension() const override
Return the file extension used for source code files in this language.
Definition: GlslSyntax.h:30
static const string CONSTANT_QUALIFIER
Definition: GlslSyntax.h:41
const string & getUniformQualifier() const override
Definition: GlslSyntax.h:29
Definition: core.h:1131
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
Definition: Syntax.h:39
type
Definition: core.h:1059
#define MX_GENGLSL_API
Definition: Export.h:18