HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdSt_GeometricShader Class Reference

#include <geometricShader.h>

+ Inheritance diagram for HdSt_GeometricShader:

Public Types

enum  PrimitiveType {
  PrimitiveType::PRIM_POINTS, PrimitiveType::PRIM_BASIS_CURVES_LINES, PrimitiveType::PRIM_BASIS_CURVES_LINEAR_PATCHES, PrimitiveType::PRIM_BASIS_CURVES_CUBIC_PATCHES,
  PrimitiveType::PRIM_MESH_COARSE_TRIANGLES, PrimitiveType::PRIM_MESH_REFINED_TRIANGLES, PrimitiveType::PRIM_MESH_COARSE_QUADS, PrimitiveType::PRIM_MESH_REFINED_QUADS,
  PrimitiveType::PRIM_MESH_BSPLINE, PrimitiveType::PRIM_MESH_BOXSPLINETRIANGLE, PrimitiveType::PRIM_VOLUME
}
 Used in HdSt_CodeGen to generate the appropriate shader source. More...
 
- Public Types inherited from HdStShaderCode
typedef size_t ID
 
typedef std::vector
< TextureDescriptor
TextureDescriptorVector
 
using NamedTextureHandleVector = std::vector< NamedTextureHandle >
 

Public Member Functions

HDST_API HdSt_GeometricShader (std::string const &glslfxString, PrimitiveType primType, HdCullStyle cullStyle, HdPolygonMode polygonMode, bool cullingPass, SdfPath const &debugId=SdfPath(), float lineWidth=0)
 
virtual HDST_API ~HdSt_GeometricShader ()
 
virtual HDST_API ID ComputeHash () const
 
virtual HDST_API std::string GetSource (TfToken const &shaderStageKey) const
 
virtual HDST_API void BindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 
virtual HDST_API void UnbindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Unbinds shader-specific resources. More...
 
virtual HDST_API void AddBindings (HdBindingRequestVector *customBindings)
 Add custom bindings (used by codegen) More...
 
bool IsFrustumCullingPass () const
 Returns true if this geometric shader is used for GPU frustum culling. More...
 
PrimitiveType GetPrimitiveType () const
 
bool IsPrimTypePoints () const
 member query functions for PrimitiveType More...
 
bool IsPrimTypeBasisCurves () const
 
bool IsPrimTypeMesh () const
 
bool IsPrimTypeTriangles () const
 
bool IsPrimTypeQuads () const
 
bool IsPrimTypePatches () const
 
HDST_API GLenum GetPrimitiveMode () const
 Return the GL primitive type of the draw item based on _primType. More...
 
HDST_API int GetPrimitiveIndexSize () const
 
HDST_API int GetNumPrimitiveVertsForGeometryShader () const
 
- Public Member Functions inherited from HdStShaderCode
HDST_API HdStShaderCode ()
 
virtual HDST_API ~HdStShaderCode ()
 
virtual ID ComputeTextureSourceHash () const
 
virtual HDST_API
HdSt_MaterialParamVector const
GetParams () const
 Returns the shader parameters for this shader. More...
 
virtual HDST_API bool IsEnabledPrimvarFiltering () const
 Returns whether primvar filtering is enabled for this shader. More...
 
virtual HDST_API TfTokenVector
const
GetPrimvarNames () const
 Returns the names of primvar that are used by this shader. More...
 
virtual HDST_API
HdBufferArrayRangeSharedPtr
const
GetShaderData () const
 
virtual HDST_API TfToken GetMaterialTag () const
 
virtual HDST_API void AddResourcesFromTextures (ResourceContext &ctx) const
 
virtual HDST_API
TextureDescriptorVector 
GetTextures () const
 
virtual HDST_API
NamedTextureHandleVector const
GetNamedTextureHandles () const
 

Static Public Member Functions

static bool IsPrimTypePoints (PrimitiveType primType)
 static query functions for PrimitiveType More...
 
static bool IsPrimTypeBasisCurves (PrimitiveType primType)
 
static bool IsPrimTypeMesh (PrimitiveType primType)
 
static bool IsPrimTypeTriangles (PrimitiveType primType)
 
static bool IsPrimTypeQuads (PrimitiveType primType)
 
static bool IsPrimTypePatches (PrimitiveType primType)
 
static
HdSt_GeometricShaderSharedPtr 
Create (HdSt_ShaderKey const &shaderKey, HdStResourceRegistrySharedPtr const &resourceRegistry)
 
- 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

Storm breaks down the concept of a shader program into distinct conceptual pieces that are then stitched together during code generation. The pieces are: (i) geometric shader (ii) material shader (iii) lighting shader (iv) render pass shader

The geometric shader contains the entry points for the relevant shader stages and uses geometry opinions (such as cullstyle, double sided, etc) to generate shader code variants via mixins.

Definition at line 59 of file geometricShader.h.

Member Enumeration Documentation

Used in HdSt_CodeGen to generate the appropriate shader source.

Enumerator
PRIM_POINTS 
PRIM_BASIS_CURVES_LINES 
PRIM_BASIS_CURVES_LINEAR_PATCHES 
PRIM_BASIS_CURVES_CUBIC_PATCHES 
PRIM_MESH_COARSE_TRIANGLES 
PRIM_MESH_REFINED_TRIANGLES 
PRIM_MESH_COARSE_QUADS 
PRIM_MESH_REFINED_QUADS 
PRIM_MESH_BSPLINE 
PRIM_MESH_BOXSPLINETRIANGLE 
PRIM_VOLUME 

Definition at line 62 of file geometricShader.h.

Constructor & Destructor Documentation

HDST_API HdSt_GeometricShader::HdSt_GeometricShader ( std::string const glslfxString,
PrimitiveType  primType,
HdCullStyle  cullStyle,
HdPolygonMode  polygonMode,
bool  cullingPass,
SdfPath const debugId = SdfPath(),
float  lineWidth = 0 
)
virtual HDST_API HdSt_GeometricShader::~HdSt_GeometricShader ( )
virtual

Member Function Documentation

virtual HDST_API void HdSt_GeometricShader::AddBindings ( HdBindingRequestVector customBindings)
virtual

Add custom bindings (used by codegen)

Implements HdStShaderCode.

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

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.

Implements HdStShaderCode.

virtual HDST_API ID HdSt_GeometricShader::ComputeHash ( ) const
virtual

Returns the hash value of the shader code and configuration.

It is computed from the the GLSL code as well as the resource signature of the shader (as determined from its parameters). If two shaders have the same hash, the GLSL code as expanded by codegen should also be the same.

Implements HdStShaderCode.

static HdSt_GeometricShaderSharedPtr HdSt_GeometricShader::Create ( HdSt_ShaderKey const shaderKey,
HdStResourceRegistrySharedPtr const resourceRegistry 
)
static
HDST_API int HdSt_GeometricShader::GetNumPrimitiveVertsForGeometryShader ( ) const
HDST_API int HdSt_GeometricShader::GetPrimitiveIndexSize ( ) const
HDST_API GLenum HdSt_GeometricShader::GetPrimitiveMode ( ) const

Return the GL primitive type of the draw item based on _primType.

PrimitiveType HdSt_GeometricShader::GetPrimitiveType ( ) const
inline

Definition at line 149 of file geometricShader.h.

virtual HDST_API std::string HdSt_GeometricShader::GetSource ( TfToken const shaderStageKey) const
virtual

Returns the shader source provided by this shader for shaderStageKey

Implements HdStShaderCode.

bool HdSt_GeometricShader::IsFrustumCullingPass ( ) const
inline

Returns true if this geometric shader is used for GPU frustum culling.

Definition at line 145 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeBasisCurves ( PrimitiveType  primType)
inlinestatic

Definition at line 82 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeBasisCurves ( ) const
inline

Definition at line 158 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeMesh ( PrimitiveType  primType)
inlinestatic

Definition at line 88 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeMesh ( ) const
inline

Definition at line 162 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypePatches ( PrimitiveType  primType)
inlinestatic

Definition at line 108 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypePatches ( ) const
inline

Definition at line 174 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypePoints ( PrimitiveType  primType)
inlinestatic

static query functions for PrimitiveType

Definition at line 78 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypePoints ( ) const
inline

member query functions for PrimitiveType

Definition at line 154 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeQuads ( PrimitiveType  primType)
inlinestatic

Definition at line 103 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeQuads ( ) const
inline

Definition at line 170 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeTriangles ( PrimitiveType  primType)
inlinestatic

Definition at line 97 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeTriangles ( ) const
inline

Definition at line 166 of file geometricShader.h.

virtual HDST_API void HdSt_GeometricShader::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: