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

#include <mixinShader.h>

+ Inheritance diagram for HdStMixinShader:

Public Member Functions

HDST_API HdStMixinShader (std::string mixinSource, HdStShaderCodeSharedPtr baseShader)
 
HDST_API ~HdStMixinShader () override
 
HDST_API HdStShaderCode::ID ComputeHash () const override
 Returns the hash value of this shader. More...
 
HDST_API ID ComputeTextureSourceHash () const override
 
HDST_API std::string GetSource (TfToken const &shaderStageKey) const override
 
HDST_API
HdSt_MaterialParamVector const
GetParams () const override
 Returns the shader parameters for this shader. More...
 
HDST_API bool IsEnabledPrimvarFiltering () const override
 Returns whether primvar filtering is enabled for this shader. More...
 
HDST_API TfTokenVector constGetPrimvarNames () const override
 Returns the names of primvar that are used by this shader. More...
 
HDST_API
HdStShaderCode::TextureDescriptorVector 
GetTextures () const override
 
HDST_API
HdBufferArrayRangeSharedPtr
const
GetShaderData () const override
 
HDST_API void BindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Binds shader-specific resources to program. More...
 
HDST_API void UnbindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Unbinds shader-specific resources. More...
 
HDST_API void AddBindings (HdBindingRequestVector *customBindings) override
 Add custom bindings (used by codegen) More...
 
HDST_API TfToken GetMaterialTag () const override
 Returns the render pass tag of this shader. More...
 
- Public Member Functions inherited from HdStShaderCode
HDST_API HdStShaderCode ()
 
virtual HDST_API ~HdStShaderCode ()
 
virtual HDST_API void AddResourcesFromTextures (ResourceContext &ctx) const
 
virtual HDST_API
NamedTextureHandleVector const
GetNamedTextureHandles () const
 

Additional Inherited Members

- Public Types inherited from HdStShaderCode
typedef size_t ID
 
typedef std::vector
< TextureDescriptor
TextureDescriptorVector
 
using NamedTextureHandleVector = std::vector< NamedTextureHandle >
 
- Static Public Member Functions inherited from HdStShaderCode
static HDST_API ID ComputeHash (HdStShaderCodeSharedPtrVector const &shaders)
 Returns the combined hash values of multiple shaders. More...
 

Detailed Description

Definition at line 40 of file mixinShader.h.

Constructor & Destructor Documentation

HDST_API HdStMixinShader::HdStMixinShader ( std::string  mixinSource,
HdStShaderCodeSharedPtr  baseShader 
)
HDST_API HdStMixinShader::~HdStMixinShader ( )
override

Member Function Documentation

HDST_API void HdStMixinShader::AddBindings ( HdBindingRequestVector customBindings)
overridevirtual

Add custom bindings (used by codegen)

Implements HdStShaderCode.

HDST_API void HdStMixinShader::BindResources ( int  program,
HdSt_ResourceBinder const binder,
HdRenderPassState const state 
)
overridevirtual

Binds shader-specific resources to program.

Implements HdStShaderCode.

HDST_API HdStShaderCode::ID HdStMixinShader::ComputeHash ( ) const
overridevirtual

Returns the hash value of this shader.

Implements HdStShaderCode.

HDST_API ID HdStMixinShader::ComputeTextureSourceHash ( ) const
overridevirtual

Returns the hash value of the paths of the texture prims consumed by this shader.

Unless textures are bindless, shaders using different textures cannot be used in the same draw batch. Since textures can be animated, it can happen that two texture prims use the same texture at some time but different textures at other times. To avoid re-computing the draw batches over time, we use the this hash when grouping the draw batches.

Reimplemented from HdStShaderCode.

HDST_API TfToken HdStMixinShader::GetMaterialTag ( ) const
overridevirtual

Returns the render pass tag of this shader.

Reimplemented from HdStShaderCode.

HDST_API HdSt_MaterialParamVector const& HdStMixinShader::GetParams ( ) const
overridevirtual

Returns the shader parameters for this shader.

Reimplemented from HdStShaderCode.

HDST_API TfTokenVector const& HdStMixinShader::GetPrimvarNames ( ) const
overridevirtual

Returns the names of primvar that are used by this shader.

Reimplemented from HdStShaderCode.

HDST_API HdBufferArrayRangeSharedPtr const& HdStMixinShader::GetShaderData ( ) const
overridevirtual

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

Reimplemented from HdStShaderCode.

HDST_API std::string HdStMixinShader::GetSource ( TfToken const shaderStageKey) const
overridevirtual

Returns the shader source provided by this shader for shaderStageKey

Implements HdStShaderCode.

HDST_API HdStShaderCode::TextureDescriptorVector HdStMixinShader::GetTextures ( ) const
overridevirtual

Reimplemented from HdStShaderCode.

HDST_API bool HdStMixinShader::IsEnabledPrimvarFiltering ( ) const
overridevirtual

Returns whether primvar filtering is enabled for this shader.

Reimplemented from HdStShaderCode.

HDST_API void HdStMixinShader::UnbindResources ( int  program,
HdSt_ResourceBinder const binder,
HdRenderPassState const state 
)
overridevirtual

Unbinds shader-specific resources.

Implements HdStShaderCode.


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