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_COARSE_TRIQUADS, PrimitiveType::PRIM_MESH_REFINED_TRIQUADS, PrimitiveType::PRIM_MESH_BSPLINE, PrimitiveType::PRIM_MESH_BOXSPLINETRIANGLE,
  PrimitiveType::PRIM_VOLUME, PrimitiveType::PRIM_COMPUTE
}
 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, bool useMetalTessellation, 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) override
 
HDST_API void UnbindResources (int program, HdSt_ResourceBinder const &binder) override
 Unbinds shader-specific resources. More...
 
HDST_API void AddBindings (HdStBindingRequestVector *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 GetUseMetalTessellation () const
 
float GetLineWidth () const
 
HdPolygonMode GetPolygonMode () const
 
bool IsPrimTypePoints () const
 member query functions for PrimitiveType More...
 
bool IsPrimTypeBasisCurves () const
 
bool IsPrimTypeMesh () const
 
bool IsPrimTypeTriangles () const
 
bool IsPrimTypeQuads () const
 
bool IsPrimTypeTriQuads () const
 
bool IsPrimTypeRefinedMesh () const
 
bool IsPrimTypePatches () const
 
bool IsPrimTypeCompute () const
 
FvarPatchType GetFvarPatchType () const
 
HDST_API int GetPrimitiveIndexSize () const
 
HDST_API int GetNumPatchEvalVerts () const
 
HDST_API int GetNumPrimitiveVertsForGeometryShader () const
 
HDST_API HgiPrimitiveType GetHgiPrimitiveType () const
 
HDST_API HgiCullMode ResolveCullMode (HdCullStyle const renderStateCullStyle) const
 
- Public Member Functions inherited from HdStShaderCode
HDST_API HdStShaderCode ()
 
virtual HDST_API ~HdStShaderCode ()
 
virtual ID ComputeTextureSourceHash () const
 
HDST_API VtDictionary GetLayout (TfTokenVector const &shaderStageKeys) 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 IsPrimTypeTriQuads (PrimitiveType primType)
 
static bool IsPrimTypeRefinedMesh (PrimitiveType primType)
 
static bool IsPrimTypePatches (PrimitiveType primType)
 
static bool IsPrimTypeCompute (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 60 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 138 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_COARSE_TRIQUADS 
PRIM_MESH_REFINED_TRIQUADS 
PRIM_MESH_BSPLINE 
PRIM_MESH_BOXSPLINETRIANGLE 
PRIM_VOLUME 
PRIM_COMPUTE 

Definition at line 63 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,
bool  useMetalTessellation,
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 ( HdStBindingRequestVector customBindings)
overridevirtual

Add custom bindings (used by codegen)

Implements HdStShaderCode.

HDST_API void HdSt_GeometricShader::BindResources ( int  program,
HdSt_ResourceBinder const binder 
)
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 238 of file geometricShader.h.

HDST_API HgiPrimitiveType HdSt_GeometricShader::GetHgiPrimitiveType ( ) const
float HdSt_GeometricShader::GetLineWidth ( ) const
inline

Definition at line 193 of file geometricShader.h.

HDST_API int HdSt_GeometricShader::GetNumPatchEvalVerts ( ) const
HDST_API int HdSt_GeometricShader::GetNumPrimitiveVertsForGeometryShader ( ) const
HdPolygonMode HdSt_GeometricShader::GetPolygonMode ( ) const
inline

Definition at line 197 of file geometricShader.h.

HDST_API int HdSt_GeometricShader::GetPrimitiveIndexSize ( ) const
PrimitiveType HdSt_GeometricShader::GetPrimitiveType ( ) const
inline

Definition at line 185 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::GetUseMetalTessellation ( ) const
inline

Definition at line 189 of file geometricShader.h.

bool HdSt_GeometricShader::IsFrustumCullingPass ( ) const
inline

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

Definition at line 181 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeBasisCurves ( PrimitiveType  primType)
inlinestatic

Definition at line 85 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeBasisCurves ( ) const
inline

Definition at line 206 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeCompute ( PrimitiveType  primType)
inlinestatic

Definition at line 133 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeCompute ( ) const
inline

Definition at line 234 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeMesh ( PrimitiveType  primType)
inlinestatic

Definition at line 91 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeMesh ( ) const
inline

Definition at line 210 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypePatches ( PrimitiveType  primType)
inlinestatic

Definition at line 126 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypePatches ( ) const
inline

Definition at line 230 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypePoints ( PrimitiveType  primType)
inlinestatic

static query functions for PrimitiveType

Definition at line 81 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypePoints ( ) const
inline

member query functions for PrimitiveType

Definition at line 202 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeQuads ( PrimitiveType  primType)
inlinestatic

Definition at line 108 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeQuads ( ) const
inline

Definition at line 218 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeRefinedMesh ( PrimitiveType  primType)
inlinestatic

Definition at line 118 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeRefinedMesh ( ) const
inline

Definition at line 226 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeTriangles ( PrimitiveType  primType)
inlinestatic

Definition at line 102 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeTriangles ( ) const
inline

Definition at line 214 of file geometricShader.h.

static bool HdSt_GeometricShader::IsPrimTypeTriQuads ( PrimitiveType  primType)
inlinestatic

Definition at line 113 of file geometricShader.h.

bool HdSt_GeometricShader::IsPrimTypeTriQuads ( ) const
inline

Definition at line 222 of file geometricShader.h.

HDST_API HgiCullMode HdSt_GeometricShader::ResolveCullMode ( HdCullStyle const  renderStateCullStyle) const
HDST_API void HdSt_GeometricShader::UnbindResources ( int  program,
HdSt_ResourceBinder const binder 
)
overridevirtual

Unbinds shader-specific resources.

Implements HdStShaderCode.


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