2013-06-02 03:09:18 +02:00
|
|
|
/*
|
|
|
|
|
CalcPlanContinuation - closure for planning a chunk of jobs
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2013, 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/calc-plan-continuation.hpp"
|
2013-09-01 02:26:46 +02:00
|
|
|
#include "proc/engine/frame-coord.hpp"
|
|
|
|
|
#include "proc/engine/job-ticket.hpp"
|
|
|
|
|
#include "lib/time/timevalue.hpp"
|
2013-06-02 03:09:18 +02:00
|
|
|
//#include "lib/frameid.hpp"
|
|
|
|
|
//#include "proc/state.hpp"
|
|
|
|
|
|
2013-09-01 02:26:46 +02:00
|
|
|
#include <boost/functional/hash.hpp>
|
|
|
|
|
|
2013-06-02 03:09:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace proc {
|
|
|
|
|
namespace engine {
|
|
|
|
|
|
2013-09-01 02:26:46 +02:00
|
|
|
|
|
|
|
|
/** entry point (interface JobClosure): invoke the concrete job operation.
|
|
|
|
|
* In this case, the job operation is responsible for planning a chunk of actual render jobs.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
CalcPlanContinuation::invokeJobOperation (JobParameter parameter)
|
|
|
|
|
{
|
|
|
|
|
ASSERT (parameter.nominalTime == timings_.getFrameStartAt (parameter.invoKey.frameNumber));
|
|
|
|
|
|
|
|
|
|
this->performJobPlanningChunk (parameter.invoKey.frameNumber);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
CalcPlanContinuation::signalFailure (JobParameter parameter, JobFailureReason reason)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("what needs to be done when a planning continuation cant be invoked?");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
2013-09-02 00:26:04 +02:00
|
|
|
CalcPlanContinuation::verify (Time nominalTime, InvocationInstanceID invoKey) const
|
2013-09-01 02:26:46 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("verify the planning coordinates");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t
|
|
|
|
|
CalcPlanContinuation::hashOfInstance (InvocationInstanceID invoKey) const
|
|
|
|
|
{
|
|
|
|
|
return boost::hash_value (invoKey.frameNumber);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Job
|
|
|
|
|
CalcPlanContinuation::prepareRenderPlanningFrom (int64_t startFrame)
|
|
|
|
|
{
|
|
|
|
|
InvocationInstanceID invoKey;
|
|
|
|
|
invoKey.frameNumber = startFrame;
|
|
|
|
|
Time nominalPlanningStartTime = timings_.getFrameStartAt (startFrame);
|
|
|
|
|
|
|
|
|
|
return Job(*this, invoKey, nominalPlanningStartTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
CalcPlanContinuation::performJobPlanningChunk(int64_t nextStartFrame)
|
|
|
|
|
{
|
|
|
|
|
TimeAnchor refPoint(timings_, nextStartFrame);
|
|
|
|
|
JobPlanningSequence jobs = dispatcher_.onCalcStream(modelPort_, channel_)
|
|
|
|
|
.establishNextJobs(refPoint);
|
|
|
|
|
|
|
|
|
|
Job nextChunkOfPlanning = buildFollowUpJobFrom (refPoint);
|
|
|
|
|
|
|
|
|
|
UNIMPLEMENTED ("the actual meat: access the scheduler and fed those jobs");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Job
|
|
|
|
|
CalcPlanContinuation::buildFollowUpJobFrom (TimeAnchor const& refPoint)
|
|
|
|
|
{
|
|
|
|
|
return this->prepareRenderPlanningFrom(
|
|
|
|
|
refPoint.getNextAnchorPoint());
|
|
|
|
|
}
|
2013-06-02 03:09:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}} // namespace engine
|