HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStShaderCode Class Referenceabstract

#include <shaderCode.h>

+ Inheritance diagram for HdStShaderCode:

Classes

struct  TextureDescriptor
 

Public Types

typedef size_t ID
 
typedef std::vector
< TextureDescriptor
TextureDescriptorVector
 

Public Member Functions

HDST_API HdStShaderCode ()
 
virtual HDST_API ~HdStShaderCode ()
 
virtual ID ComputeHash () const =0
 Returns the hash value of this shader. More...
 
virtual std::string GetSource (TfToken const &shaderStageKey) const =0
 
virtual HDST_API
HdMaterialParamVector const
GetParams () const
 Returns the shader parameters for this shader. More...
 
virtual HDST_API
TextureDescriptorVector 
GetTextures () const
 
virtual HDST_API
HdBufferArrayRangeSharedPtr
const
GetShaderData () const
 
virtual void BindResources (HdSt_ResourceBinder const &binder, int program)=0
 
virtual void UnbindResources (HdSt_ResourceBinder const &binder, int program)=0
 Unbinds shader-specific resources. More...
 
virtual void AddBindings (HdBindingRequestVector *customBindings)=0
 Add custom bindings (used by codegen) More...
 
virtual HDST_API TfToken GetMaterialTag () const
 

Static Public Member Functions

static HDST_API ID ComputeHash (HdStShaderCodeSharedPtrVector const &shaders)
 Returns the combined hash values of multiple shaders. More...
 
static HDST_API bool CanAggregate (HdStShaderCodeSharedPtr const &shaderA, HdStShaderCodeSharedPtr const &shaderB)
 Returns if the two shaders can be aggregated in a same drawbatch or not. More...
 

Detailed Description

A base class representing the implementation (code) of a shader, used in conjunction with HdRenderPass.

This interface provides a simple way for clients to affect the composition of shading programs used for a render pass.

Definition at line 59 of file shaderCode.h.

Member Typedef Documentation

typedef size_t HdStShaderCode::ID

Definition at line 61 of file shaderCode.h.

Definition at line 91 of file shaderCode.h.

Constructor & Destructor Documentation

HDST_API HdStShaderCode::HdStShaderCode ( )
virtual HDST_API HdStShaderCode::~HdStShaderCode ( )
virtual

Member Function Documentation

virtual void HdStShaderCode::AddBindings ( HdBindingRequestVector customBindings)
pure virtual
virtual void HdStShaderCode::BindResources ( HdSt_ResourceBinder const binder,
int  program 
)
pure virtual

Binds shader-specific resources to program XXX: this interface is meant to be used for bridging the GlfSimpleLightingContext mechanism, and not for generic use-cases.

Implemented in HdSt_GeometricShader, HdStSurfaceShader, HdStComputeShader, HdxSimpleLightingShader, HdStMixinShaderCode, HdStRenderPassShader, and HdSt_FallbackLightingShader.

static HDST_API bool HdStShaderCode::CanAggregate ( HdStShaderCodeSharedPtr const shaderA,
HdStShaderCodeSharedPtr const shaderB 
)
static

Returns if the two shaders can be aggregated in a same drawbatch or not.

virtual ID HdStShaderCode::ComputeHash ( ) const
pure virtual
static HDST_API ID HdStShaderCode::ComputeHash ( HdStShaderCodeSharedPtrVector const shaders)
static

Returns the combined hash values of multiple shaders.

virtual HDST_API TfToken HdStShaderCode::GetMaterialTag ( ) const
virtual

Material tags can be set in the meta-data of a glslfx file to control what rprim collection that prims using this shader should go into. E.g. We can use it to split opaque and translucent prims into different collections. When no material tags are specified in the shader, a empty token is returned.

Reimplemented in HdStSurfaceShader, and HdStMixinShaderCode.

virtual HDST_API HdMaterialParamVector const& HdStShaderCode::GetParams ( ) const
virtual

Returns the shader parameters for this shader.

Reimplemented in HdxSimpleLightingShader, HdStSurfaceShader, HdStComputeShader, and HdStMixinShaderCode.

virtual HDST_API HdBufferArrayRangeSharedPtr const& HdStShaderCode::GetShaderData ( ) const
virtual

Returns a buffer which stores parameter fallback values and texture handles.

Reimplemented in HdStSurfaceShader, HdStComputeShader, and HdStMixinShaderCode.

virtual std::string HdStShaderCode::GetSource ( TfToken const shaderStageKey) const
pure virtual

Returns the shader source provided by this shader for shaderStageKey

Implemented in HdSt_GeometricShader, HdStSurfaceShader, HdxSimpleLightingShader, HdStComputeShader, HdStRenderPassShader, HdSt_FallbackLightingShader, and HdStMixinShaderCode.

virtual HDST_API TextureDescriptorVector HdStShaderCode::GetTextures ( ) const
virtual
virtual void HdStShaderCode::UnbindResources ( HdSt_ResourceBinder const binder,
int  program 
)
pure virtual

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