MaterialX 1.39.5
Loading...
Searching...
No Matches
WgslShaderGenerator Class Reference

WGSL Flavor of Vulkan GLSL shader generator. More...

#include <WgslShaderGenerator.h>

Inheritance diagram for WgslShaderGenerator:
VkShaderGenerator GlslShaderGenerator

Public Member Functions

 WgslShaderGenerator (TypeSystemPtr typeSystem)
 Constructor.
 
void emitDirectives (GenContext &context, ShaderStage &stage) const override
 
const string & getLightDataTypevarString () const override
 
void emitFunctionDefinitionParameter (const ShaderPort *shaderPort, bool isOutput, GenContext &context, ShaderStage &stage) const override
 
void emitInput (const ShaderInput *input, GenContext &context, ShaderStage &stage) const override
 
- Public Member Functions inherited from VkShaderGenerator
 VkShaderGenerator (TypeSystemPtr typeSystem)
 Constructor.
 
const string & getTarget () const override
 Return a unique identifier for the target this generator is for.
 
const string & getVersion () const override
 Return the version string for the GLSL version this generator is for.
 
string getVertexDataPrefix (const VariableBlock &vertexData) const override
 
void emitInputs (GenContext &context, ShaderStage &stage) const override
 
void emitOutputs (GenContext &context, ShaderStage &stage) const override
 
- Public Member Functions inherited from GlslShaderGenerator
 GlslShaderGenerator (TypeSystemPtr typeSystem)
 Constructor.
 
ShaderPtr generate (const string &name, ElementPtr element, GenContext &context) const override
 Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
 
const string & getTarget () const override
 Return a unique identifier for the target this generator is for.
 
void emitVariableDeclaration (const ShaderPort *variable, const string &qualifier, GenContext &context, ShaderStage &stage, bool assignValue=true) const override
 Emit a shader variable.
 
string getVertexDataPrefix (const VariableBlock &vertexData) const override
 Determine the prefix of vertex data variables.
 

Static Public Member Functions

static ShaderGeneratorPtr create (TypeSystemPtr typeSystem=nullptr)
 Creator function.
 
- Static Public Member Functions inherited from VkShaderGenerator
static ShaderGeneratorPtr create (TypeSystemPtr typeSystem=nullptr)
 Creator function.
 
- Static Public Member Functions inherited from GlslShaderGenerator
static ShaderGeneratorPtr create (TypeSystemPtr typeSystem=nullptr)
 Creator function.
 

Static Protected Attributes

static const string LIGHTDATA_TYPEVAR_STRING
 

Additional Inherited Members

- Static Public Attributes inherited from VkShaderGenerator
static const string TARGET
 Unique identifier for this generator target.
 
static const string VERSION
 
- Static Public Attributes inherited from GlslShaderGenerator
static const string TARGET
 Unique identifier for this generator target.
 
static const string VERSION
 Version string for the generator target.
 
- Protected Member Functions inherited from VkShaderGenerator
HwResourceBindingContextPtr getResourceBindingContext (GenContext &) const override
 
- Protected Member Functions inherited from GlslShaderGenerator
virtual void emitVertexStage (const ShaderGraph &graph, GenContext &context, ShaderStage &stage) const
 
virtual void emitPixelStage (const ShaderGraph &graph, GenContext &context, ShaderStage &stage) const
 
virtual void emitConstants (GenContext &context, ShaderStage &stage) const
 
virtual void emitUniforms (GenContext &context, ShaderStage &stage) const
 
virtual void emitLightData (GenContext &context, ShaderStage &stage) const
 
virtual void emitSpecularEnvironment (GenContext &context, ShaderStage &stage) const
 Emit specular environment lookup code.
 
virtual void emitTransmissionRender (GenContext &context, ShaderStage &stage) const
 Emit transmission rendering code.
 
virtual void emitLightFunctionDefinitions (const ShaderGraph &graph, GenContext &context, ShaderStage &stage) const
 Emit function definitions for lighting code.
 
- Protected Attributes inherited from VkShaderGenerator
HwResourceBindingContextPtr _resourceBindingCtx
 
int vertexDataLocation = 0
 
- Protected Attributes inherited from GlslShaderGenerator
vector< ShaderNodePtr_lightSamplingNodes
 Nodes used internally for light sampling.
 

Detailed Description

WGSL Flavor of Vulkan GLSL shader generator.

Member Function Documentation

◆ create()

static ShaderGeneratorPtr create ( TypeSystemPtr typeSystem = nullptr)
inlinestatic

Creator function.

If a TypeSystem is not provided it will be created internally. Optionally pass in an externally created TypeSystem here, if you want to keep type descriptions alive after the lifetime of the shader generator.

◆ emitDirectives()

void emitDirectives ( GenContext & context,
ShaderStage & stage ) const
overridevirtual

Reimplemented from VkShaderGenerator.


The documentation for this class was generated from the following file: