HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EsslShaderGenerator.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_ESSLSHADERGENERATOR_H
7 #define MATERIALX_ESSLSHADERGENERATOR_H
8 
9 /// @file
10 /// ESSL shader generator
11 
13 
15 
16 using EsslShaderGeneratorPtr = shared_ptr<class EsslShaderGenerator>;
17 
18 /// @class EsslShaderGenerator
19 /// An ESSL (OpenGL ES Shading Language) shader generator
21 {
22  public:
24 
25  static ShaderGeneratorPtr create() { return std::make_shared<EsslShaderGenerator>(); }
26 
27  /// Return a unique identifier for the target this generator is for
28  const string& getTarget() const override { return TARGET; }
29 
30  /// Return the version string for the ESSL version this generator is for
31  const string& getVersion() const override { return VERSION; }
32 
33  string getVertexDataPrefix(const VariableBlock& vertexData) const override;
34 
35  /// Unique identifier for this generator target
36  static const string TARGET;
37  static const string VERSION;
38 
39  protected:
40  void emitDirectives(GenContext& context, ShaderStage& stage) const override;
41  void emitUniforms(GenContext& context, ShaderStage& stage) const override;
42  void emitInputs(GenContext& context, ShaderStage& stage) const override;
43  void emitOutputs(GenContext& context, ShaderStage& stage) const override;
45 };
46 
48 
49 #endif
static const string VERSION
virtual HwResourceBindingContextPtr getResourceBindingContext(GenContext &context) const
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
static const string TARGET
Unique identifier for this generator target.
const string & getVersion() const override
Return the version string for the ESSL version this generator is for.
static const string VERSION
Version string for the generator target.
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
virtual void emitDirectives(GenContext &context, ShaderStage &stage) const
virtual void emitUniforms(GenContext &context, ShaderStage &stage) const
static const string TARGET
Unique identifier for this generator target.
virtual void emitInputs(GenContext &context, ShaderStage &stage) const
virtual void emitOutputs(GenContext &context, ShaderStage &stage) const
virtual string getVertexDataPrefix(const VariableBlock &vertexData) const
Determine the prefix of vertex data variables.
static ShaderGeneratorPtr create()
shared_ptr< class EsslShaderGenerator > EsslShaderGeneratorPtr
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
shared_ptr< ShaderGenerator > ShaderGeneratorPtr
Shared pointer to a ShaderGenerator.
Definition: Library.h:38
const string & getTarget() const override
Return a unique identifier for the target this generator is for.
#define MX_GENGLSL_API
Definition: Export.h:18