core::meta::shader::vertex::binding class

generic shader binding descriptor. describes the type and location of a vertex binding resource.

shaders can have various bindings such as textures, UBO's, SSBO's, Dynamic UBO's, etc... this class describes the type and either the psl::UID, or the tag that points to a resource in the runtime.

static variables

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

member-functions

binding_slot
const public noexcept
size
const public noexcept
input_rate
const public noexcept
buffer
const public noexcept
attributes
const public noexcept
binding_slot
sets the binding slot to bind to in the shader.
public
size
sets the binding size in bytes.
public
input_rate
sets the expected input rate of the binding (i.e. should we offset per-vertex, or per-instance in the data)
public
buffer
sets the psl::UID, or TAG that will suggest where to find the data to bind.
public
attributes
sets the collection of attributes that make up this binding.
public
set
sets the attribute in case it is emplaced on an empty location.
deprecated public
erase
tries to find a matching attribute that is in the binding collection, and erases it if found
public
serialize<…>
method that will be invoked by the serialization system.
private

Function documentation

uint32_t core::meta::shader::vertex::binding::binding_slot() const noexcept

Returns the binding slot index of this binding

uint32_t core::meta::shader::vertex::binding::size() const noexcept

Returns the size in bytes of the binding

core::gfx::vertex_input_rate core::meta::shader::vertex::binding::input_rate() const noexcept

Returns the set input rate (per-vertex or per-instance) of this binding.

psl::string8_t core::meta::shader::vertex::binding::buffer() const noexcept

Details

Returns the buffer this binding is bound to.

const std::vector<attribute>& core::meta::shader::vertex::binding::attributes() const noexcept

Returns the attribute collection of this binding.

void core::meta::shader::vertex::binding::binding_slot(uint32_t value)

Brief

sets the binding slot to bind to in the shader.

Parameters
value in the new binding slot.

void core::meta::shader::vertex::binding::size(uint32_t value)

Brief

sets the binding size in bytes.

Parameters
value in the new accumulative size in bytes of this binding.

void core::meta::shader::vertex::binding::input_rate(core::gfx::vertex_input_rate value)

Brief

sets the expected input rate of the binding (i.e. should we offset per-vertex, or per-instance in the data)

Parameters
value in the new input rate.

void core::meta::shader::vertex::binding::buffer(psl::string8_t value)

Brief

sets the psl::UID, or TAG that will suggest where to find the data to bind.

Details

in core::data::geometry you will see some information about tags, these tags can be set here to identify the binding points of the geometry data in the shader i.e. what is the position binding, uv binding, etc..

Parameters
value in the new psl::UID or TAG

void core::meta::shader::vertex::binding::attributes(const std::vector<attribute>& value)

Brief

sets the collection of attributes that make up this binding.

Parameters
value in the attribute collection that will replace the current.

void core::meta::shader::vertex::binding::set(attribute value)

Brief

sets the attribute in case it is emplaced on an empty location.

Details

Parameters
value in the attribute to try and emplace

bool core::meta::shader::vertex::binding::erase(attribute value)

Brief

tries to find a matching attribute that is in the binding collection, and erases it if found

Parameters
value in the attribute to find.
Returns true if it found a match and erased it.

template<typename S>
void core::meta::shader::vertex::binding::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.