core::meta::shader::instance class

describes the instance-able data contained in the SPIR-V module.

shaders can have many parameters that can be tweaked 'per-material instance' such as colors, or other values. This class describes those types of resources to make it easier and safer to dynamically bind data to instances of materials, and to give hints to the user of what can all be tweaked. A good example of "instance-able" data is object matrix data for instanced rendering. So that you can have many of the same objects rendered in "one call" through instanced rendering. you can view it as the finer detailed level core::meta::shader::descriptor

types

classes

element
Describes an element of a data container.

static variables

char
serialization_name
the serialization name for the psl::format::node
constconstconstexprconstexprprivateprivatestaticstatic

member-functions

elements
const public noexcept
size
const public noexcept
default_value
const public noexcept
elements
overrides the elements that have been set with a new set.
public
size
sets a new size of this structure (in bytes)
public
set
tries to emplace this element in the structure definition, if the position is empty.
deprecated public
erase
tries to find the given element in this structure and erase it.
public
erase
tries to find the given element, by name, in this structure and erase it.
public
serialize<…>
method that will be invoked by the serialization system.
private

Function documentation

const std::vector<element>& core::meta::shader::instance::elements() const noexcept

Returns the collection of elements this isntance structure exists out of.

uint32_t core::meta::shader::instance::size() const noexcept

Returns the accumulative size in bytes of elements().

std::vector<uint8_t> core::meta::shader::instance::default_value() const noexcept

Returns a vector containing the "default" value state for this entire structure.

void core::meta::shader::instance::elements(const std::vector<element>& value)

Brief

overrides the elements that have been set with a new set.

Parameters
value in the new set of elements.

void core::meta::shader::instance::size(uint32_t value)

Brief

sets a new size of this structure (in bytes)

Parameters
value in the new accumulative size in bytes of all elements.

void core::meta::shader::instance::set(element value)

Brief

tries to emplace this element in the structure definition, if the position is empty.

Details

Parameters
value in the value to try emplace

bool core::meta::shader::instance::erase(element value)

Brief

tries to find the given element in this structure and erase it.

Parameters
value in the element to find and erase.
Returns true if found and erased.

bool core::meta::shader::instance::erase(psl::string8::view element_name)

Brief

tries to find the given element, by name, in this structure and erase it.

Parameters
element_name in the element's name that will be used to find and erase a matching element.
Returns true if found and erased.

template<typename S>
void core::meta::shader::instance::serialize(S& s) private

Brief

method that will be invoked by the serialization system.

Template parameters
S the type of the serializer/deserializer
Parameters
in instance of a serializer that you can read from, or write to.