CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::TGPUResourceSetBindingSlot< Const > Class Template Referencefinal

A class that offers high-level access to a GPUResourceSetBindings slot. More...

#include <CeresEngine/RenderAPI/GPUResourceSet.hpp>

Public Member Functions

const GPUResourceBindingget (UInt32 index=0) const
 Gets a GPUResourceBinding at the given index.
 
GPUResourceBindingget (UInt32 index=0)
 Gets a GPUResourceBinding at the given index.
 
GPUResourceBindingset (UInt32 index, GPUResourceBinding binding)
 Sets the GPUResourceBinding for the given index.
 
GPUResourceBindingset (GPUResourceBinding binding)
 Sets the GPUResourceBinding for the given index.
 
const GPUResourceBindingoperator[] (const UInt32 index) const
 Gets a GPUResourceBinding at the given index.
 
GPUResourceBindingoperator[] (const UInt32 index)
 Gets a GPUResourceBinding at the given index.
 
TGPUResourceSetBindingSlotoperator= (GPUResourceBinding &&binding)
 Sets the GPUResourceBinding for the given index.
 
UInt32 add (GPUResourceBinding binding)
 Adds a new GPUResourceBinding.
 
UInt32 operator+= (GPUResourceBinding binding)
 Adds a new GPUResourceBinding.
 
void remove (UInt32 index)
 Removes a GPUResourceBinding for the given index.
 
void remove ()
 Removes a GPUResourceBinding for the slot.
 
UInt32 size () const
 Gets the number of GPUResourceBinding bound on the slot.
 
 operator bool () const noexcept
 

Public Attributes

GPUResourceSetBindingsTypebindings
 The bindings object that this TGPUResourceSetBindingSlot was created from.
 
UInt32 slot
 The slot the TGPUResourceSetBindingSlot object is representing.
 

Private Types

using GPUResourceSetBindingsType = std::conditional_t< Const, const GPUResourceSetBindings, GPUResourceSetBindings >
 

Private Member Functions

 TGPUResourceSetBindingSlot (GPUResourceSetBindingsType &bindings, const UInt32 slot)
 Creates a new TGPUResourceSetBindingSlot from an existing.
 

Friends

class GPUResourceSetBindings
 

Detailed Description

template<bool Const>
class CeresEngine::TGPUResourceSetBindingSlot< Const >

A class that offers high-level access to a GPUResourceSetBindings slot.

Member Typedef Documentation

◆ GPUResourceSetBindingsType

template<bool Const>
using CeresEngine::TGPUResourceSetBindingSlot< Const >::GPUResourceSetBindingsType = std::conditional_t<Const, const GPUResourceSetBindings, GPUResourceSetBindings>
private

Constructor & Destructor Documentation

◆ TGPUResourceSetBindingSlot()

template<bool Const>
CeresEngine::TGPUResourceSetBindingSlot< Const >::TGPUResourceSetBindingSlot ( GPUResourceSetBindingsType bindings,
const UInt32  slot 
)
inlineprivate

Creates a new TGPUResourceSetBindingSlot from an existing.

Parameters
bindingsThe bindings object to access values from.
slotThe slot index to be accessed.

Member Function Documentation

◆ add()

template<bool Const>
UInt32 CeresEngine::TGPUResourceSetBindingSlot< Const >::add ( GPUResourceBinding  binding)
inline

Adds a new GPUResourceBinding.

Note
This method will append a new entry to the end of the binding array.
Parameters
bindingThe value to set the binding to.
Returns
The index of the newly bound array entry.

◆ get() [1/2]

template<bool Const>
GPUResourceBinding * CeresEngine::TGPUResourceSetBindingSlot< Const >::get ( UInt32  index = 0)
inline

Gets a GPUResourceBinding at the given index.

Parameters
indexThe index of the binding to be retrieved.
Returns
A pointer to the binding if it exists or nullptr if it's not present on the resource binding set.

◆ get() [2/2]

template<bool Const>
const GPUResourceBinding * CeresEngine::TGPUResourceSetBindingSlot< Const >::get ( UInt32  index = 0) const
inline

Gets a GPUResourceBinding at the given index.

Parameters
indexThe index of the binding to be retrieved.
Returns
A pointer to the binding if it exists or nullptr if it's not present on the resource binding set.

◆ operator bool()

template<bool Const>
CeresEngine::TGPUResourceSetBindingSlot< Const >::operator bool ( ) const
inlineexplicitnoexcept

◆ operator+=()

template<bool Const>
UInt32 CeresEngine::TGPUResourceSetBindingSlot< Const >::operator+= ( GPUResourceBinding  binding)
inline

Adds a new GPUResourceBinding.

Note
This method will append a new entry to the end of the binding array.
Parameters
bindingThe value to set the binding to.
Returns
The index of the newly bound array entry.

◆ operator=()

Sets the GPUResourceBinding for the given index.

Note
If the binding already has one or more elements on it, they will all be replaced and set to binding.
Parameters
bindingThe value to set the binding to.

◆ operator[]() [1/2]

Gets a GPUResourceBinding at the given index.

Parameters
indexThe index of the binding to be retrieved.
Returns
A pointer to the binding if it exists or nullptr if it's not present on the resource binding set.

◆ operator[]() [2/2]

template<bool Const>
const GPUResourceBinding & CeresEngine::TGPUResourceSetBindingSlot< Const >::operator[] ( const UInt32  index) const
inline

Gets a GPUResourceBinding at the given index.

Parameters
indexThe index of the binding to be retrieved.
Returns
A pointer to the binding if it exists or nullptr if it's not present on the resource binding set.

◆ remove() [1/2]

template<bool Const>
void CeresEngine::TGPUResourceSetBindingSlot< Const >::remove ( )
inline

Removes a GPUResourceBinding for the slot.

Note
This method will remove all bound resources to the given slot.

◆ remove() [2/2]

template<bool Const>
void CeresEngine::TGPUResourceSetBindingSlot< Const >::remove ( UInt32  index)
inline

Removes a GPUResourceBinding for the given index.

Parameters
indexThe index of the binding to be removed.

◆ set() [1/2]

template<bool Const>
GPUResourceBinding & CeresEngine::TGPUResourceSetBindingSlot< Const >::set ( GPUResourceBinding  binding)
inline

Sets the GPUResourceBinding for the given index.

Note
If the binding already has one or more elements on it, they will all be replaced and set to binding.
Parameters
bindingThe value to set the binding to.

◆ set() [2/2]

template<bool Const>
GPUResourceBinding & CeresEngine::TGPUResourceSetBindingSlot< Const >::set ( UInt32  index,
GPUResourceBinding  binding 
)
inline

Sets the GPUResourceBinding for the given index.

Parameters
indexThe index of the binding to be set.
bindingThe value to set the binding to.

◆ size()

template<bool Const>
UInt32 CeresEngine::TGPUResourceSetBindingSlot< Const >::size ( ) const
inline

Gets the number of GPUResourceBinding bound on the slot.

Returns
The number of bindings in the given slot.

Friends And Related Symbol Documentation

◆ GPUResourceSetBindings

template<bool Const>
friend class GPUResourceSetBindings
friend

Member Data Documentation

◆ bindings

The bindings object that this TGPUResourceSetBindingSlot was created from.

◆ slot

template<bool Const>
UInt32 CeresEngine::TGPUResourceSetBindingSlot< Const >::slot

The slot the TGPUResourceSetBindingSlot object is representing.


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