Lumiera  0.pre.03
buffer-metadata.hpp File Reference

Go to the source code of this file.


Metadata for managing and accessing buffers.

The Lumiera Engine uses the Abstraction of an BufferProvider to handle various kinds of buffer organisation and access in a uniform way. Actually, buffers can be exposed and provided by several facilities, which might even be implemented through an external library. Thus the engine and the abstraction placed in between needs a common set of control data, to be able to expose the correct buffer for each request. Typically – and independent of the actual implementation – the following properties need to be tracked

  • that overall storage size available within the buffer
  • a pair of custom creator and destructor functions to use together with this buffer
  • an additional client key to distinguish otherwise otherwise identical client requests These three distinctions are applied in sequence, thus forming a type tree with 3 levels. Only the first distinguishing level (the size) is mandatory. The others are provided, because some of the foreseeable buffer providers allow to re-access the data placed into the buffer, by assigning an internally managed ID to the buffer. The most prominent example is the frame cache, which obviously needs to keep track of the buffers after the render engine is finished, while the engine code just accesses yet another buffer to place the results of calculations.

These additional distinctions and properties are associated with the help of the BufferDescriptor, embedded into each BuffHandle. While the engine just uses these handles in the way of a pointer, the buffer descriptor acts as an additional tag attached to the buffer access, allowing to re-access a context within the buffer provider implementation.

See also

Definition in file buffer-metadata.hpp.

#include "lib/error.hpp"
#include "lib/symbol.hpp"
#include "lib/hash-value.h"
#include "lib/util-foreach.hpp"
#include "include/logging.h"
#include "proc/engine/type-handler.hpp"
#include "proc/engine/buffer-local-key.hpp"
#include "lib/nocopy.hpp"
#include <unordered_map>


class  BufferMetadata
 Registry for managing buffer metadata. More...
class  Entry
 A complete metadata Entry, based on a Key. More...
class  Key
 Description of a Buffer-"type". More...
class  Table
 (Hash)Table to store and manage buffer metadata. More...


enum  BufferState {
 Buffer states usable within BufferProvider and stored within the metadata. More...


 Proc-Layer implementation namespace root.
 Render engine code as part of the Proc-Layer.