MaterialX 1.39.1
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, TypeDesc type, const string& enumNames, std::pair<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:55
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:27
Syntax class for GLSL (OpenGL Shading Language)
Definition: GlslSyntax.h:20
bool remapEnumeration(const string &value, TypeDesc type, const string &enumNames, std::pair< TypeDesc, ValuePtr > &result) const override
Given an input specification attempt to remap this to an enumeration which is accepted by the shader ...
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
bool typeSupported(const TypeDesc *type) const override
Query if given type is suppored in the syntax.
Base class for syntax objects used by shader generators to emit code with correct syntax for each lan...
Definition: Syntax.h:41
A type descriptor for MaterialX data types.
Definition: TypeDesc.h:35