HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
9 /// @file
10 /// Vulkan GLSL shader generator
11 
14 
16 
17 using VkShaderGeneratorPtr = shared_ptr<class VkShaderGenerator>;
18 
19 /// @class VkShaderGenerator
20 /// A Vulkan GLSL shader generator
22 {
23  public:
25 
26  static ShaderGeneratorPtr create() { return std::make_shared<VkShaderGenerator>(); }
27 
28  /// Return a unique identifier for the target this generator is for
29  const string& getTarget() const override { return TARGET; }
30 
31  /// Return the version string for the GLSL version this generator is for
32  const string& getVersion() const override { return VERSION; }
33 
34  string getVertexDataPrefix(const VariableBlock& vertexData) const override;
35 
36  /// Unique identifier for this generator target
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:
49 
50  VkResourceBindingContextPtr _resourceBindingCtx = nullptr;
51 };
52 
54 
55 #endif
virtual HwResourceBindingContextPtr getResourceBindingContext(GenContext &context) const
shared_ptr< class VkShaderGenerator > VkShaderGeneratorPtr
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
static const string TARGET
Unique identifier for this generator target.
static const string VERSION
static const string VERSION
Version string for the generator target.
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
static ShaderGeneratorPtr create()
virtual void emitDirectives(GenContext &context, ShaderStage &stage) const
virtual void emitInputs(GenContext &context, ShaderStage &stage) const
const string & getVersion() const override
Return the version string for the GLSL version this generator is for.
const string & getTarget() const override
Return a unique identifier for the target this generator is for.
shared_ptr< class VkResourceBindingContext > VkResourceBindingContextPtr
Shared pointer to a VkResourceBindingContext.
virtual void emitOutputs(GenContext &context, ShaderStage &stage) const
string getVertexDataPrefix(const VariableBlock &vertexData) const override
Determine the prefix of vertex data variables.
static const string TARGET
Unique identifier for this generator target.
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
shared_ptr< ShaderGenerator > ShaderGeneratorPtr
Shared pointer to a ShaderGenerator.
Definition: Library.h:38
#define MX_GENGLSL_API
Definition: Export.h:18