WIP: ...to do so, some considerations regarding the entrance point..

This commit is contained in:
Fischlurch 2009-08-31 12:16:47 +02:00
parent ddb8805a73
commit 83067aa318
7 changed files with 114 additions and 12 deletions

View file

@ -125,7 +125,7 @@ namespace lumiera {
/**
* Special case of an implementation type being only partialiy specified
* Special case of an implementation type being only partially specified
* Besides requiring some aspect of the implementation type, there is the
* promise to fill in defaults to build a complete implementation type
* if necessary.

View file

@ -77,6 +77,7 @@ liblumiprocengine_la_SOURCES = \
$(liblumiprocengine_la_srcdir)/renderengine.cpp \
$(liblumiprocengine_la_srcdir)/source.cpp \
$(liblumiprocengine_la_srcdir)/stateproxy.cpp \
$(liblumiprocengine_la_srcdir)/render-invocation.cpp \
$(liblumiprocengine_la_srcdir)/trafo.cpp

View file

@ -68,7 +68,7 @@ namespace engine {
return *pBuffer_;
}
protected:
private:
PBuff pBuffer_;
long sourceID_;
};

View file

@ -88,7 +88,7 @@ namespace engine {
public: /* === proxying the State interface === */
private: /* === proxying the State interface === */
virtual void releaseBuffer (BuffHandle& bh) { current_.releaseBuffer (bh); }
@ -176,7 +176,7 @@ namespace engine {
: Invocation(sta, w, outCh) {}
virtual BuffHandle
allocateBuffer (BufferDescriptor const& bd) { return parent_.allocateBuffer(bd); }
allocateBuffer (BufferDescriptor const& bd) { return parent_.allocateBuffer(bd); } ////////////TODO: actually implement the "allocate from parent" logic!
};
struct AllocBufferFromCache ///< using the global current State, which will delegate to Cache

View file

@ -0,0 +1,86 @@
/*
RenderInvocation - Interface for creating processing nodes of various kinds
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "proc/engine/render-invocation.hpp"
namespace engine {
namespace { // Details...
} // (END) Details...
// using mobject::Placement;
// using mobject::session::Effect;
/** @internal */
BuffHandle
RenderInvocation::allocateBuffer (BufferDescriptor const&)
{
UNIMPLEMENTED ("allocate a suitable buffer to hold a frame of the denoted type");
}
void
RenderInvocation::releaseBuffer (BuffHandle& bh)
{
UNIMPLEMENTED ("free a buffer");
}
BuffHandle
RenderInvocation::fetch (FrameID const& fID)
{
UNIMPLEMENTED ("fetch a buffer with input data");
}
void
RenderInvocation::is_calculated (BuffHandle const& bh)
{
UNIMPLEMENTED ("declare a buffer as fully calculated and done");
}
FrameID const&
RenderInvocation::genFrameID (NodeID const&, uint chanNo)
{
UNIMPLEMENTED ("derive/generate an ID to denote this specific fame+Node position in the graph");
}
BuffTableStorage&
RenderInvocation::getBuffTableStorage() /////////////TODO need somehow to denote the specific storage requirements
{
UNIMPLEMENTED ("allocate a chunk of storage suitable for holding the buffer pointer tables");
}
} // namespace engine

View file

@ -58,19 +58,24 @@ namespace engine {
RenderInvocation()
{ }
virtual State& getCurrentImplementation () { return current_; }
private: /* === top-level implementation of the State interface === */
public: /* === proxying the State interface === */
BuffHandle allocateBuffer (BufferDescriptor const&);
// virtual void releaseBuffer (BuffHandle& bh) { current_.releaseBuffer (bh); }
void releaseBuffer (BuffHandle& bh);
// virtual void is_calculated (BuffHandle const& bh) { current_.is_calculated (bh); }
BuffHandle fetch (FrameID const& fID);
// virtual BuffHandle fetch (FrameID const& fID) { return current_.fetch (fID); }
void is_calculated (BuffHandle const& bh);
// note: allocateBuffer() is chosen specifically based on the actual node wiring
FrameID const& genFrameID (NodeID const&, uint chanNo);
BuffTableStorage& getBuffTableStorage();
virtual State& getCurrentImplementation () { return *this; }
};

View file

@ -42,6 +42,16 @@ namespace engine {
class StateAdapter;
class BuffTableStorage;
/**
* Abstraction denoting the state of a currently ongoing render/calculation
* process, as it is tied to the supporting facilities of the backend.
* An State (subclass) instance is the sole connection for the render node
* to invoke services of the backend needed to carry out the calculations.
*
* @see engine::RenderInvocation top-level entrance point
* @see nodeinvocation.hpp impl. used from \em within the nodes
*/
class State
{
public:
@ -75,8 +85,8 @@ namespace engine {
*/
virtual FrameID const& genFrameID (NodeID const&, uint chanNo) =0;
/** try to fetch an existing buffer containing the denoted frame from
* a cache or similar backing system (e.g. peer over the network).
/** try to fetch an existing buffer containing the denoted frame
* from a cache or similar backing system (e.g. network peer).
* @return either a handle to a readonly buffer, or a null handle
* @note the client is responsible for not modifying the provided data
*/