Class Instance

Class Documentation

class Instance

Class describing an instance of a declared type.

A type is previously declared via Declaration; an instance of that type depends on the declaration, and implies storage required for the type instance. If additional modifiers (access, direction, etc.) or cardinality (for example, an array of instances) are present on the instance, those are also described on the Instance

Public Functions

Instance()

Default constructor; initializes all class members to known, reasonable default values.

Instance(Instance &&other)
Instance(Instance const &other)
Instance &operator=(Instance const &other)
Instance(introspection::Struct &&structDeclaration, char const *instanceName)

Construct a scalar Instance named 'instanceName' referencing an existing Struct definition.

Note

structDeclaration does not need to be fully populated prior to calling this constructor; changes to structDeclaration after the fact will be reflected in the Instance state.

Parameters
  • structDeclaration -- Definition of the referenced struct.

  • instanceName -- Name of this instance as referenced by the program or shader.

Instance(introspection::Struct &&structDeclaration, char const *instanceName, uint64_t cardinality)

As above, but represents a contiguous array of the defined Struct instances.

Parameters
  • structDeclaration -- Definition of the referenced struct.

  • instanceName -- Name of this instance as referenced by the program or shader.

  • cardinality -- The number of elements in the Struct array

Instance(introspection::Type instanceType, char const *instanceName)

Construct an Instance representing a single, scalar value of type instanceType.

Parameters
  • instanceType -- Basic type of the represented object.

  • instanceName -- Name of this instance as referenced by the program or shader.

Instance(introspection::Type instanceType, char const *instanceName, uint64_t cardinality)

As above, but represents a contiguous array of objects of the referenced type.

Parameters
  • instanceType -- Basic type of the represented object.

  • instanceName -- Name of this instance as referenced by the program or shader.

  • cardinality -- The number of elements in the array

~Instance()
void SetShaderBlockModifier(introspection::ShaderBlockModifier modifier)

Set any modifier required for the instance.

See also

ShaderBlockModifier)

Note

This is typically used to markup blocks or instances in shaders.

Note

default is kNone (

Parameters

modifier -- Needs documentation

void SetBinding(uint64_t location)

Set the binding index or location for the object.

Whether this number represents a binding index or location depends on the context; for uniform blocks (of type kUniform

See also

ShaderBlockModifier) this will be a binding index into a descriptor; for in/out objects (

See also

ShaderBlockModifier) this will be the location index or slot in the data passed between shader stages.

Note

This is not used if the shader block modifier is kNone

Parameters

location -- Binding index or location index.

void SetBinding(uint64_t index, uint64_t binding)
void SetRowCount(uint32_t rows)
void SetColumnCount(uint32_t columns)
void SetInputAttachmentIndex(uint32_t inputAttachmentIndex)
void SetColumnMajorMatrixLayout(bool columnMajor)
void GetArraySizes(uint64_t *pArraySizeCount, uint32_t *pArraySizes) const
void SetArraySizes(uint64_t arraySizeCount, uint32_t const *pArraySizes)
void SetActivelyUsed(bool activelyUsed)
void SetDimension(introspection::Dim const dim)
void SetSemantic(introspection::Semantic semantic)
void SetStructDeclaration(introspection::Struct &&declaration)
introspection::Type Type() const

Getters.

char const *Name() const
uint64_t Cardinality() const
introspection::Struct const *StructDeclaration() const
introspection::ShaderBlockModifier ShaderBlockModifier() const
uint64_t BindingGroupIndex() const
uint64_t BindingWithinIndex() const
uint64_t Location() const
uint64_t Size() const
uint32_t RowCount() const
uint32_t ColumnCount() const
uint32_t InputAttachmentIndex() const
introspection::Dim Dimension() const
introspection::Semantic Semantic() const
bool IsStruct() const
bool ColumnMajor() const
bool ActivelyUsed() const