All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStGLSLProgram Class Referencefinal

An instance of a glsl program. More...

Public Types

typedef size_t ID
 
using PopulateDescriptorCallback = std::function< void(HgiShaderFunctionDesc &computeDesc)>
 

Public Member Functions

HDST_API HdStGLSLProgram (TfToken const &role, HdStResourceRegistry *const registry)
 
HDST_API bool CompileShader (HgiShaderStage stage, std::string const &source)
 Compile shader source for a shader stage. More...
 
HDST_API bool Link ()
 Link the compiled shaders together. More...
 
HDST_API bool Validate () const
 Validate if this program is a valid progam in the current context. More...
 
HgiShaderProgramHandle const & GetProgram () const
 Returns HdResource of the program object. More...
 
TfToken const & GetRole () const
 Returns the role of the GPU data in this resource. More...
 

Static Public Member Functions

static HDST_API
HdStGLSLProgramSharedPtr 
GetComputeProgram (TfToken const &shaderToken, HdStResourceRegistry *resourceRegistry)
 Convenience method to get a shared compute shader program. More...
 
static HDST_API
HdStGLSLProgramSharedPtr 
GetComputeProgram (TfToken const &shaderFileName, TfToken const &shaderToken, HdStResourceRegistry *resourceRegistry)
 
static HDST_API
HdStGLSLProgramSharedPtr 
GetComputeProgram (TfToken const &shaderToken, HdStResourceRegistry *resourceRegistry, PopulateDescriptorCallback populateDescriptor)
 
static HDST_API
HdStGLSLProgramSharedPtr 
GetComputeProgram (TfToken const &shaderToken, std::string const &defines, HdStResourceRegistry *resourceRegistry, PopulateDescriptorCallback populateDescriptor)
 

Detailed Description

An instance of a glsl program.

Definition at line 45 of file glslProgram.h.

Member Function Documentation

HDST_API bool CompileShader ( HgiShaderStage  stage,
std::string const &  source 
)

Compile shader source for a shader stage.

static HDST_API HdStGLSLProgramSharedPtr GetComputeProgram ( TfToken const &  shaderToken,
HdStResourceRegistry resourceRegistry 
)
static

Convenience method to get a shared compute shader program.

HgiShaderProgramHandle const& GetProgram ( ) const
inline

Returns HdResource of the program object.

Definition at line 68 of file glslProgram.h.

TfToken const& GetRole ( ) const
inline

Returns the role of the GPU data in this resource.

Definition at line 99 of file glslProgram.h.

HDST_API bool Link ( )

Link the compiled shaders together.

HDST_API bool Validate ( ) const

Validate if this program is a valid progam in the current context.


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