Class Struct

Nested Relationships

Nested Types

Class Documentation

class Struct

Class describing layout of a struct declaration in a shader stage.

A struct is an aggregate of individual Declarations, that are considered parts of a larger whole object. Structs have names themselves (similar to structs in other programming languages); this is considered the name of the "type" in the context of the shader.

Public Functions

Struct(char const *name)

Constructor.

name would be given 'Vert' and not 'vert'.

Parameters

name -- This parameter is required; it corresponds to the name of the struct as declared in code. For example, given the following shader code example uniform Vert { vec3 pos; vec3 norm; } vert;

Struct(Struct &&other)
Struct(Struct const &other)
Struct &operator=(Struct const &other)
~Struct()
Struct &operator=(Struct &&other)
void AddMember(introspection::Declaration &&declaration)

Add a new member to to struct.

Note

This class will make a full COPY of the declaration so it is not required to keep this Declaration instance around for the lifetime of this Struct

Parameters

declaration -- Pointer to a valid Declaration instance that describes the member being added to the struct

char const *Name() const

Getters.

uint64_t MemberCount() const
introspection::Declaration const *Member(uint64_t index) const
introspection::Declaration const *Member(uint64_t index, uint64_t *offset) const
uint64_t Size() const