MaterialX 1.38.9
Loading...
Searching...
No Matches
VkShaderGenerator.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_VKSHADERGENERATOR_H
7#define MATERIALX_VKSHADERGENERATOR_H
8
11
14
15MATERIALX_NAMESPACE_BEGIN
16
17using VkShaderGeneratorPtr = shared_ptr<class VkShaderGenerator>;
18
21class MX_GENGLSL_API VkShaderGenerator : public GlslShaderGenerator
22{
23 public:
25
26 static ShaderGeneratorPtr create() { return std::make_shared<VkShaderGenerator>(); }
27
29 const string& getTarget() const override { return TARGET; }
30
32 const string& getVersion() const override { return VERSION; }
33
34 string getVertexDataPrefix(const VariableBlock& vertexData) const override;
35
37 static const string TARGET;
38 static const string VERSION;
39
40 // Emit directives for stage
41 void emitDirectives(GenContext& context, ShaderStage& stage) const override;
42
43 void emitInputs(GenContext& context, ShaderStage& stage) const override;
44
45 void emitOutputs(GenContext& context, ShaderStage& stage) const override;
46
47 protected:
48 HwResourceBindingContextPtr getResourceBindingContext(GenContext&) const override;
49
50 VkResourceBindingContextPtr _resourceBindingCtx = nullptr;
51};
52
53MATERIALX_NAMESPACE_END
54
55#endif
GLSL shader generator.
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
Definition: HwShaderGenerator.h:236
shared_ptr< ShaderGenerator > ShaderGeneratorPtr
Shared pointer to a ShaderGenerator.
Definition: Library.h:38
Vulkan GLSL resource binding context.
shared_ptr< class VkResourceBindingContext > VkResourceBindingContextPtr
Shared pointer to a VkResourceBindingContext.
Definition: VkResourceBindingContext.h:19
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
A Vulkan GLSL shader generator.
Definition: VkShaderGenerator.h:22
const string & getTarget() const override
Return a unique identifier for the target this generator is for.
Definition: VkShaderGenerator.h:29
static const string TARGET
Unique identifier for this generator target.
Definition: VkShaderGenerator.h:37
const string & getVersion() const override
Return the version string for the GLSL version this generator is for.
Definition: VkShaderGenerator.h:32