Lumiera  0.pre.03
»edit your freedom«
render-drive.hpp
Go to the documentation of this file.
1 /*
2  RENDER-DRIVE.hpp - repetitively advancing a render calculation stream
3 
4  Copyright (C) Lumiera.org
5  2023, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
39 #ifndef STEAM_ENGINE_RENDER_DRIVE_H
40 #define STEAM_ENGINE_RENDER_DRIVE_H
41 
42 #include "steam/common.hpp"
45 #include "steam/play/timings.hpp"
46 #include "vault/gear/job.h"
47 //#include "lib/nocopy.hpp"
48 
49 
50 namespace steam {
51 namespace engine {
52 
53 // using std::function;
54  using vault::gear::JobParameter;
56  using mobject::ModelPort;
57 // using lib::time::TimeSpan;
58 // using lib::time::FSecs;
59 // using lib::time::Time;
60  using lib::time::FrameCnt;
61  using lib::HashVal;
62 
63 
74  {
75  public:
76  virtual ~RenderEnvironment() { }
77 
78  virtual play::Timings& effectiveTimings() =0;
79  virtual Dispatcher& getDispatcher() =0;
80  };
81 
82 
92  : public JobClosure
93  {
94 
95  RenderEnvironment& engine_;
96 
97 // const ModelPort modelPort_;
98 // const uint channel_;
99 
100 
101  /* === JobClosure Interface === */
102 
103  JobKind
104  getJobKind() const
105  {
106  return META_JOB;
107  }
108 
109  size_t hashOfInstance (InvocationInstanceID) const override;
110  InvocationInstanceID buildInstanceID(HashVal) const override;
111 
112  void invokeJobOperation (JobParameter) override;
113 
114 
115 
116 
117  public:
121  RenderDrive (RenderEnvironment& renderEnvironment
122  ,ModelPort port, uint chan)
123  : engine_{renderEnvironment}
124  { }
125 
126 
127  play::Timings const&
128  getTimings() const
129  {
130  return engine_.effectiveTimings();
131  }
132 
142  Job prepareRenderPlanningFrom (FrameCnt startFrame);
143 
144 
145  private:
146  void performJobPlanningChunk(FrameCnt nextStartFrame);
147  Job buildFollowUpJobFrom (Time refPoint);
148  };
149 
150 
151 
152 }} // namespace steam::engine
153 #endif /*STEAM_ENGINE_RENDER_DRIVE_H*/
Organising the output data calculation possibilities.
Basic set of definitions and includes commonly used together.
Generic frame timing specification.
Definition: timings.hpp:95
Service abstraction within the render engine for generating render jobs.
Internal abstraction: a service within the engine for translating a logical calculation stream (corre...
Definition: dispatcher.hpp:90
Steam-Layer implementation namespace root.
The active drive to keep the render process going – implemented as a job planning job...
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:308
JobKind
Definition: job.h:71
virtual ~RenderEnvironment()
this is an interface
RenderDrive(RenderEnvironment &renderEnvironment, ModelPort port, uint chan)
Definition of a render job.
Handle designating a point within the model, where actually output data can be pulled.
Definition: model-port.hpp:104
opaque ID attached to each individual job invocation.
Definition: job.h:112
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:56
Interface of the closure for frame rendering jobs.
Definition: job.h:244
How to define a timing specification or constraint.
int64_t FrameCnt
relative framecount or frame number.
Definition: digxel.hpp:321
render process self organisation
Definition: job.h:75
Individual frame rendering task, forwarding to a closure.
Definition: job.h:277
Abstract definition of the environment hosting a given render activity (CalcStream).