Loading...
Searching...
No Matches
HioGlslfxResourceLayout Class Reference

The resource layout for stages in a shader pipeline. More...

#include <glslfxResourceLayout.h>

Classes

struct  Element
 Specifies a resource element. More...
 
struct  Member
 Specifies a member of an aggregate resource element. More...
 
struct  TextureElement
 Specifies a texture element. More...
 

Public Types

enum class  InOut { NONE , STAGE_IN , STAGE_OUT }
 Specifies whether a resource element is a shader input, a shader output (i.e. More...
 
enum class  Kind {
  NONE , VALUE , BLOCK , QUALIFIER ,
  UNIFORM_VALUE , UNIFORM_BLOCK , UNIFORM_BLOCK_CONSTANT_PARAMS , BUFFER_READ_ONLY ,
  BUFFER_READ_WRITE
}
 Specifies the kind of resource element. More...
 
enum class  TextureType { TEXTURE , SHADOW_TEXTURE , ARRAY_TEXTURE }
 Specifies the type of a texture element. More...
 
using MemberVector = std::vector< Member >
 
using ElementVector = std::vector< Element >
 
using TextureElementVector = std::vector< TextureElement >
 

Static Public Member Functions

static HIO_API void ParseLayout (ElementVector *result, TfToken const &shaderStage, VtDictionary const &layoutDict)
 Parses GLSLFX resource layout elements from the specified layoutDict and appends the parsed elements to result.
 

Detailed Description

The resource layout for stages in a shader pipeline.

The main geometric shader pipelines for meshes, curves, points, volumes, as well as compute shaders for subdivision refinement, etc. are expressed as GLSL source code and aspects of the main shader pipeline that are generated at runtime also are expressed as GLSL source code.

This class provides an intermediate representation for shader resources that are needed to provide access to external data like buffers and textures and also interstage data like input and output variables and input and output interface blocks.

A method is provided to parse resource data from HioGlslfx resource layout dictionaries so that resource layout definitions can continue to be authored alongside related GLSL shader source.

The dictionary layouts have been designed to match the concepts and syntax used by GLSL.

Definition at line 86 of file glslfxResourceLayout.h.

Member Typedef Documentation

◆ ElementVector

using ElementVector = std::vector<Element>

Definition at line 156 of file glslfxResourceLayout.h.

◆ MemberVector

using MemberVector = std::vector<Member>

Definition at line 126 of file glslfxResourceLayout.h.

◆ TextureElementVector

using TextureElementVector = std::vector<TextureElement>

Definition at line 187 of file glslfxResourceLayout.h.

Member Enumeration Documentation

◆ InOut

enum class InOut
strong

Specifies whether a resource element is a shader input, a shader output (i.e.

an input or output variable or input or output interface block), or neither (i.e. a buffer or texture).

Definition at line 92 of file glslfxResourceLayout.h.

◆ Kind

enum class Kind
strong

Specifies the kind of resource element.

Definition at line 99 of file glslfxResourceLayout.h.

◆ TextureType

enum class TextureType
strong

Specifies the type of a texture element.

Definition at line 159 of file glslfxResourceLayout.h.

Member Function Documentation

◆ ParseLayout()

static HIO_API void ParseLayout ( ElementVector *  result,
TfToken const &  shaderStage,
VtDictionary const &  layoutDict 
)
static

Parses GLSLFX resource layout elements from the specified layoutDict and appends the parsed elements to result.


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