XII Release 0.1.0
Loading...
Searching...
No Matches
xiiRenderGraphBlackboard Class Reference

Copyright (c) Theophilus Eriata. All Rights Reserved. More...

#include <RenderGraphBlackboard.h>

Public Member Functions

template<typename T>
void Set (xiiStringView sKey, const T &value)
 Stores a typed value under the given key. Replaces any previously stored value. Not thread-safe, must be called before Execute().
template<typename T>
void Set (xiiStringView sKey, T &&value)
 Stores a typed value by move. Not thread-safe, must be called before Execute().
template<typename T>
void SetGraph (xiiStringView sKey, const T &value)
 Stores data that survives ClearFrame() and is shared by all frames of this graph.
template<typename T>
bool TryGet (xiiStringView sKey, T &out_value) const
template<typename T>
bool TryGetScoped (xiiStringView sKey, T &out_value) const
 Looks in frame scope first, then graph scope.
template<typename T>
const T & GetRef (xiiStringView sKey) const
 Returns a typed reference to the stored value. Thread-safe, safe to call from parallel execute threads.
bool Contains (xiiStringView sKey) const
 Returns true if the given key is present. Thread-safe, safe to call from parallel execute threads.
void Remove (xiiStringView sKey)
 Removes the entry for the given key. Not thread-safe.
void Clear ()
 Clears all entries. Not thread-safe.
void ClearFrame ()
 Clears only per-frame entries. Graph-scoped entries remain available.
void ClearGraph ()
 Clears only graph-scoped entries.
xiiResult BeginFrameFrom (const xiiRenderGraphBlackboard &parent)
template<typename T>
XII_ALWAYS_INLINE void Set (xiiStringView sKey, const T &value)
 Copyright (c) Theophilus Eriata. All Rights Reserved.
template<typename T>
XII_ALWAYS_INLINE void Set (xiiStringView sKey, T &&value)
template<typename T>
XII_ALWAYS_INLINE void SetGraph (xiiStringView sKey, const T &value)
template<typename T>
XII_ALWAYS_INLINE bool TryGet (xiiStringView sKey, T &out_value) const
template<typename T>
XII_ALWAYS_INLINE bool TryGetScoped (xiiStringView sKey, T &out_value) const
template<typename T>
XII_ALWAYS_INLINE const T & GetRef (xiiStringView sKey) const

Detailed Description

Copyright (c) Theophilus Eriata. All Rights Reserved.

Thread-safe per-frame key-value store for inter-pass data exchange in the render graph.

Passes and external systems write typed values during graph setup or before Execute(). During Execute(), all parallel pass threads may safely read concurrently via TryGet() and Contains().

Threading contract:

  • Writes (Set, Remove, Clear) are NOT thread-safe and must complete before Execute().
  • Reads (TryGet, Contains) ARE thread-safe and may be called concurrently from multiple threads.
Note
Values are stored as xiiVariant. Type mismatches on TryGet return false without asserting.

Member Function Documentation

◆ BeginFrameFrom()

xiiResult xiiRenderGraphBlackboard::BeginFrameFrom ( const xiiRenderGraphBlackboard & parent)
inline

Begin an occurrence-local frame with read-only parent inputs. Writes stay local. The parent must outlive this frame and remain immutable during execution.

◆ TryGet()

template<typename T>
bool xiiRenderGraphBlackboard::TryGet ( xiiStringView sKey,
T & out_value ) const
nodiscard

Attempts to retrieve and cast a value to type T. Thread-safe, safe to call from parallel execute threads.

Returns
True if the key exists and the stored value is of type T, false otherwise.

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