Lumiera  0.pre.03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
buffhandle.hpp File Reference

Go to the source code of this file.


A front-end to support the buffer management within the render nodes.

When pulling data from predecessor nodes and calculating new data, each render node needs several input and output buffers. These may be allocated and provided by various different "buffer providers" (for example the frame cache). Typically, the real buffers will be passed as parameters to the actual job instance when scheduled, drawing on the results of prerequisite jobs. Yet the actual job implementation remains agnostic with respect to the way actual buffers are provided; the invocation just pushes BuffHandle objects around. The actual render function gets an array of C-pointers to the actual buffers, and for accessing those buffers, the node needs to keep a table of buffer pointers, and for releasing the buffers later on, we utilise the buffer handles.

These buffer handles are based on a buffer descriptor record, which is opaque as far as the client is concerned. BufferDescriptor acts as a representation of the type or kind of buffer. The only way to obtain such a BufferDescriptor is from a concrete BufferProvider implementation. A back-link to this owning and managing provider is embedded into the BufferDescriptor, allowing to retrieve an buffer handle, corresponding to an actual buffer provided and managed behind the scenes. There is no automatic resource management; clients are responsible to invoke BuffHandle::release when done.

See also
BufferProviderProtocol_test usage demonstration
bufftable.hpp storage for the buffer table

Definition in file buffhandle.hpp.

#include "lib/error.hpp"
#include "lib/hash-value.h"
#include "proc/streamtype.hpp"


class  BufferDescriptor
 An opaque descriptor to identify the type and further properties of a data buffer. More...
class  BuffHandle
 Handle for a buffer for processing data, abstracting away the actual implementation. More...


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