MaterialX 1.38.9
Loading...
Searching...
No Matches
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
11
13
15
16MATERIALX_NAMESPACE_BEGIN
17
19class MX_GENGLSL_API GlslSyntax : public Syntax
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
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
50MATERIALX_NAMESPACE_END
51
52#endif
vector< string > StringVec
A vector of strings.
Definition: Library.h:57
Macros for declaring imported and exported symbols.
Base class for syntax handling for shader generators.
shared_ptr< Syntax > SyntaxPtr
Shared pointer to a Syntax.
Definition: Syntax.h:26
Syntax class for GLSL (OpenGL Shading Language)
Definition: GlslSyntax.h:20
const string & getInputQualifier() const override
Returns a type qualifier to be used when declaring types for input variables.
Definition: GlslSyntax.h:26
const string & getConstantQualifier() const override
Get the qualifier used when declaring constant variables.
Definition: GlslSyntax.h:28
const string & getOutputQualifier() const override
Returns a type qualifier to be used when declaring types for output variables.
Definition: GlslSyntax.h:27
const string & getUniformQualifier() const override
Get the qualifier used when declaring uniform variables.
Definition: GlslSyntax.h:29
const string & getSourceFileExtension() const override
Return the file extension used for source code files in this language.
Definition: GlslSyntax.h:30
Base class for syntax objects used by shader generators to emit code with correct syntax for each lan...
Definition: Syntax.h:40
virtual bool remapEnumeration(const string &value, const TypeDesc *type, const string &enumNames, std::pair< const TypeDesc *, ValuePtr > &result) const
Given an input specification attempt to remap this to an enumeration which is accepted by the shader ...
Definition: Syntax.cpp:335
virtual bool typeSupported(const TypeDesc *type) const
Query if given type is suppored in the syntax.
Definition: Syntax.cpp:270
A type descriptor for MaterialX data types.
Definition: TypeDesc.h:28