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...
 
enum  FvarPatchType {
  FvarPatchType::PATCH_COARSE_TRIANGLES, FvarPatchType::PATCH_REFINED_TRIANGLES, FvarPatchType::PATCH_COARSE_QUADS, FvarPatchType::PATCH_REFINED_QUADS,
  FvarPatchType::PATCH_BSPLINE, FvarPatchType::PATCH_BOXSPLINETRIANGLE, FvarPatchType::PATCH_NONE
}
 
- Public Types inherited from HdStShaderCode
typedef size_t ID
 
using NamedTextureHandleVector = std::vector< NamedTextureHandle >
 

Public Member Functions

HDST_API HdSt_GeometricShader (std::string const &glslfxString, PrimitiveType primType, HdCullStyle cullStyle, bool useHardwareFaceCulling, bool hasMirroredTransform, bool doubleSided, HdPolygonMode polygonMode, bool cullingPass, FvarPatchType fvarPatchType, SdfPath const &debugId=SdfPath(), float lineWidth=0)
 
HDST_API ~HdSt_GeometricShader () override
 
HDST_API ID ComputeHash () const override
 
HDST_API std::string GetSource (TfToken const &shaderStageKey) const override
 
HDST_API void BindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 
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...
 
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
 
FvarPatchType GetFvarPatchType () 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 GetNumPatchEvalVerts () 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
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 IsPrimTypeRefinedMesh (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

Enumerator
PATCH_COARSE_TRIANGLES 
PATCH_REFINED_TRIANGLES 
PATCH_COARSE_QUADS 
PATCH_REFINED_QUADS 
PATCH_BSPLINE 
PATCH_BOXSPLINETRIANGLE 
PATCH_NONE 

Definition at line 123 of file geometricShader.h.

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,
bool  useHardwareFaceCulling,
bool  hasMirroredTransform,
bool  doubleSided,
HdPolygonMode  polygonMode,
bool  cullingPass,
FvarPatchType  fvarPatchType,
SdfPath const debugId = SdfPath(),
float  lineWidth = 0 
)
HDST_API HdSt_GeometricShader::~HdSt_GeometricShader ( )
override

Member Function Documentation

HDST_API void HdSt_GeometricShader::AddBindings ( HdBindingRequestVector customBindings)
overridevirtual

Add custom bindings (used by codegen)

Implements HdStShaderCode.

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.

HDST_API ID HdSt_GeometricShader::ComputeHash ( ) const
overridevirtual

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
FvarPatchType HdSt_GeometricShader::GetFvarPatchType ( ) const
inline

Definition at line 200 of file geometricShader.h.

HDST_API int HdSt_GeometricShader::GetNumPatchEvalVerts ( ) const
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 171 of file geometricShader.h.

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

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 167 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 180 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 184 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypePatches ( PrimitiveType  primType)
inlinestatic

Definition at line 115 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypePatches ( ) const
inline

Definition at line 196 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 176 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 192 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeRefinedMesh ( PrimitiveType  primType)
inlinestatic

Definition at line 108 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 188 of file geometricShader.h.

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: