core::meta::shader class final

contains extensions for meta data when loading shader files.

shaders need various metadata that can describe the binding points and types of resources a SPIR-V might be expecting, as well as the pipeline stage it is assigned to. This extension to psl::meta::file contains that type of data.

base classes

psl::meta::file
disk-based representation of a runtime instance.
publicpublic

types

classes

instance
describes the instance-able data contained in the SPIR-V module.
vertex
contains data specific to vertex attributes.

static variables

char
polymorphic_name
the polymorphic serialization name for the psl::format::node that will be used to calculate the CRC64 ID of this type on.
constconstconstexprconstexprprivateprivatestaticstatic
uint64_t
polymorphic_identity
the associated unique ID (per type, not instance) for the polymorphic system.
constconstprivateprivatestaticstatic

member-functions

stage
const public noexcept
stage
sets the stage of this SPIR-V module to the given value.
public noexcept
vertex_bindings
const public noexcept
vertex_bindings
sets the expected set of vertex bindings of this SPIR-V module.
public
descriptors
const public noexcept
descriptors
sets the collection of descriptors that might be used by this shader.
public
set
tries to emplace, or overwrite (if sharing a binding location) a descriptor at the given binding slot.
deprecated public
set
tries to emplace, or overwrite (if sharing a binding location) a vertex binding at the given binding slot.
deprecated public
erase
tries to find, and erase a descriptor
public
erase
tries to find, and erase the vertex binding
public
serialize<…>
method that will be invoked by the serialization system.
private
polymorphic_id
returns the polymorphic ID at runtime, to resolve what type this is.
private override virtual

Function documentation

gfx::shader_stage core::meta::shader::stage() const noexcept

Returns the shader stage of this SPIR-V module (i.e. vertex, fragment, compute, etc..)

void core::meta::shader::stage(gfx::shader_stage value) noexcept

Brief

sets the stage of this SPIR-V module to the given value.

Details

Parameters
value in the stage to expect.

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

Returns the collection of vertex bindings that this shader might have.

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

Brief

sets the expected set of vertex bindings of this SPIR-V module.

Parameters
value in the expected sets of vertex bindings.

const std::vector<descriptor>& core::meta::shader::descriptors() const noexcept

Returns the set of descriptors that are used by this shader.

void core::meta::shader::descriptors(const std::vector<descriptor>& value)

Brief

sets the collection of descriptors that might be used by this shader.

Parameters
value in the new descriptors to expect bindings for.

void core::meta::shader::set(descriptor value)

Brief

tries to emplace, or overwrite (if sharing a binding location) a descriptor at the given binding slot.

Details

Parameters
value in the descriptor to try to emplace.

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

Brief

tries to emplace, or overwrite (if sharing a binding location) a vertex binding at the given binding slot.

Details

Parameters
value in the vertex binding to try and emplace.

bool core::meta::shader::erase(descriptor value)

Brief

tries to find, and erase a descriptor

Details

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

bool core::meta::shader::erase(vertex::binding element)

Brief

tries to find, and erase the vertex binding

Details

Parameters
element in the vertex binding to find and erase.
Returns true if the element has been found and erased.

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