GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::BufferLayoutReference Struct Reference

Generic type-erased read-only reference to a buffer or buffer set layout. More...

#include <GREM/graphics/buffer_layouts.hpp>

Inheritance diagram for grem::graphics::BufferLayoutReference:

Public Member Functions

constexpr BufferLayoutReference (UniformBufferLayoutReference uniformBufferLayout) noexcept
 Construct a reference to a uniform buffer layout.
constexpr BufferLayoutReference (StorageBufferLayoutReference storageBufferLayout) noexcept
 Construct a reference to a storage buffer layout.
constexpr BufferLayoutReference (BufferSetLayoutReference bufferSetLayout) noexcept
 Construct a reference to a buffer set layout.
constexpr bool operator== (const BufferLayoutReference &other) const noexcept
 Compare this buffer layout reference to another for equality.
constexpr std::strong_ordering operator<=> (const BufferLayoutReference &other) const noexcept
 Compare this buffer layout reference to another.
Public Member Functions inherited from grem::Variant< UniformBufferLayoutReference, StorageBufferLayoutReference, BufferSetLayoutReference >
constexpr ~Variant ()
 Destructor.
constexpr Variant & operator= (const Variant &other)=delete
 Deleted copy assignment.
constexpr T & emplace (Args &&... args)
 Construct an alternative given its type, destroying the old value.
constexpr void swap (Variant &other) noexcept(((std::is_nothrow_move_constructible_v< Ts > &&std::is_nothrow_swappable_v< Ts >) &&...))
 Swap this variant's value with that of another.
constexpr index_type index () const noexcept
 Get the alternative index of the currently active value held by the variant.
constexpr bool valueless_by_exception () const noexcept
 Check if the variant is in the valueless by exception state.
constexpr bool is () const noexcept
 Check if the variant currently holds the alternative with the given type.
constexpr T & as () &noexcept
 Access the underlying value with the given type without a safety check.
constexpr T & get () &
 Access the underlying value with the given type.
constexpr T * get_if () noexcept
 Access the underlying value with the given type if it is the currently active alternative.

Public Attributes

CRC32 nameCRC32
 CRC32 of the buffer name, used as a unique ID for the buffer type.

Additional Inherited Members

Public Types inherited from grem::Variant< UniformBufferLayoutReference, StorageBufferLayoutReference, BufferSetLayoutReference >
using index_type
 Index type used to encode the active alternative type.
Static Public Member Functions inherited from grem::Variant< UniformBufferLayoutReference, StorageBufferLayoutReference, BufferSetLayoutReference >
static constexpr decltype(auto) visit (Visitor &&visitor, V &&variant)
 Call a visitor functor with the currently active underlying value of a variant.
static constexpr decltype(auto) visitIndex (index_type index, Visitor &&visitor)
 Call a visitor functor with the type corresponding to a variant index.
static constexpr decltype(auto) apply (Function &&function)
 Call a functor with all alternative types.
Static Public Attributes inherited from grem::Variant< UniformBufferLayoutReference, StorageBufferLayoutReference, BufferSetLayoutReference >
static constexpr index_type npos
 Invalid alternative index, representing the valueless by exception state.

Detailed Description

Generic type-erased read-only reference to a buffer or buffer set layout.

Constructor & Destructor Documentation

◆ BufferLayoutReference() [1/3]

grem::graphics::BufferLayoutReference::BufferLayoutReference ( UniformBufferLayoutReference uniformBufferLayout)
inlineconstexprnoexcept

Construct a reference to a uniform buffer layout.

Parameters
uniformBufferLayoutuniform buffer layout to reference.

◆ BufferLayoutReference() [2/3]

grem::graphics::BufferLayoutReference::BufferLayoutReference ( StorageBufferLayoutReference storageBufferLayout)
inlineconstexprnoexcept

Construct a reference to a storage buffer layout.

Parameters
storageBufferLayoutstorage buffer layout to reference.

◆ BufferLayoutReference() [3/3]

grem::graphics::BufferLayoutReference::BufferLayoutReference ( BufferSetLayoutReference bufferSetLayout)
inlineconstexprnoexcept

Construct a reference to a buffer set layout.

Parameters
bufferSetLayoutbuffer set layout to reference.

Member Function Documentation

◆ operator==()

bool grem::graphics::BufferLayoutReference::operator== ( const BufferLayoutReference & other) const
inlinenodiscardconstexprnoexcept

Compare this buffer layout reference to another for equality.

Parameters
otherbuffer layout reference to compare this one to.
Returns
true if the buffer layout references refer to the same buffer type, false otherwise.

◆ operator<=>()

std::strong_ordering grem::graphics::BufferLayoutReference::operator<=> ( const BufferLayoutReference & other) const
inlinenodiscardconstexprnoexcept

Compare this buffer layout reference to another.

Parameters
otherthe buffer layout reference to compare this one to.
Returns
a strong ordering between the two buffer types.

Member Data Documentation

◆ nameCRC32

CRC32 grem::graphics::BufferLayoutReference::nameCRC32

CRC32 of the buffer name, used as a unique ID for the buffer type.


The documentation for this struct was generated from the following file: