MaterialX 1.38.2
EsslShaderGenerator.h
Go to the documentation of this file.
1//
2// TM & (c) 2021 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3// All rights reserved. See LICENSE.txt for license.
4//
5
6#ifndef MATERIALX_ESSLSHADERGENERATOR_H
7#define MATERIALX_ESSLSHADERGENERATOR_H
8
11
13
14namespace MaterialX
15{
16
17using EsslShaderGeneratorPtr = shared_ptr<class EsslShaderGenerator>;
18
21class MX_GENGLSL_API EsslShaderGenerator : public GlslShaderGenerator
22{
23 public:
25
26 static ShaderGeneratorPtr create() { return std::make_shared<EsslShaderGenerator>(); }
27
29 const string& getTarget() const override { return TARGET; }
30
32 const string& getVersion() const override { return VERSION; }
33
34 const string getVertexDataPrefix(const VariableBlock& vertexData) const override;
35
37 static const string TARGET;
38 static const string VERSION;
39
40 protected:
41 void emitDirectives(GenContext& context, ShaderStage& stage) const override;
42 void emitUniforms(GenContext& context, ShaderStage& stage) const override;
43 void emitInputs(GenContext& context, ShaderStage& stage) const override;
44 void emitOutputs(GenContext& context, ShaderStage& stage) const override;
45 HwResourceBindingContextPtr getResourceBindingContext(GenContext& context) const override;
46};
47
48}
49
50#endif
GLSL shader generator.
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
Definition: HwShaderGenerator.h:235
shared_ptr< ShaderGenerator > ShaderGeneratorPtr
Shared pointer to a ShaderGenerator.
Definition: Library.h:38
An ESSL (OpenGL ES Shading Language) shader generator
Definition: EsslShaderGenerator.h:22
const string & getTarget() const override
Return a unique identifier for the target this generator is for.
Definition: EsslShaderGenerator.h:29
static const string TARGET
Unique identifier for this generator target.
Definition: EsslShaderGenerator.h:37
const string & getVersion() const override
Return the version string for the ESSL version this generator is for.
Definition: EsslShaderGenerator.h:32
A context class for shader generation.
Definition: GenContext.h:27
Base class for GLSL (OpenGL Shading Language) code generation.
Definition: GlslShaderGenerator.h:24
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:124
A block of variables in a shader stage.
Definition: ShaderStage.h:53