MaterialX 1.38.10
Loading...
Searching...
No Matches
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
11
13
14MATERIALX_NAMESPACE_BEGIN
15
16using EsslShaderGeneratorPtr = shared_ptr<class EsslShaderGenerator>;
17
20class MX_GENGLSL_API EsslShaderGenerator : public GlslShaderGenerator
21{
22 public:
24
25 static ShaderGeneratorPtr create() { return std::make_shared<EsslShaderGenerator>(); }
26
28 const string& getTarget() const override { return TARGET; }
29
31 const string& getVersion() const override { return VERSION; }
32
33 string getVertexDataPrefix(const VariableBlock& vertexData) const override;
34
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;
44 HwResourceBindingContextPtr getResourceBindingContext(GenContext& context) const override;
45};
46
47MATERIALX_NAMESPACE_END
48
49#endif
GLSL shader generator.
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
Definition: HwShaderGenerator.h:239
shared_ptr< ShaderGenerator > ShaderGeneratorPtr
Shared pointer to a ShaderGenerator.
Definition: Library.h:38
An ESSL (OpenGL ES Shading Language) shader generator.
Definition: EsslShaderGenerator.h:21
const string & getTarget() const override
Return a unique identifier for the target this generator is for.
Definition: EsslShaderGenerator.h:28
static const string TARGET
Unique identifier for this generator target.
Definition: EsslShaderGenerator.h:36
const string & getVersion() const override
Return the version string for the ESSL version this generator is for.
Definition: EsslShaderGenerator.h:31
A context class for shader generation.
Definition: GenContext.h:31
Base class for GLSL (OpenGL Shading Language) code generation.
Definition: GlslShaderGenerator.h:23
static const string TARGET
Unique identifier for this generator target.
Definition: GlslShaderGenerator.h:52
string getVertexDataPrefix(const VariableBlock &vertexData) const override
Determine the prefix of vertex data variables.
Definition: GlslShaderGenerator.cpp:509
static const string VERSION
Version string for the generator target.
Definition: GlslShaderGenerator.h:55
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:139
A block of variables in a shader stage.
Definition: ShaderStage.h:61