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)
5  2023, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
30 #ifndef STEAM_ENGINE_RENDER_DRIVE_H
31 #define STEAM_ENGINE_RENDER_DRIVE_H
32 
33 #include "steam/common.hpp"
36 #include "steam/play/timings.hpp"
37 #include "vault/gear/job.h"
38 //#include "lib/nocopy.hpp"
39 
40 
41 namespace steam {
42 namespace engine {
43 
44 // using std::function;
45  using vault::gear::JobParameter;
47  using mobject::ModelPort;
48 // using lib::time::TimeSpan;
49 // using lib::time::FSecs;
50 // using lib::time::Time;
51  using lib::time::FrameCnt;
52  using lib::HashVal;
53 
54 
65  {
66  public:
67  virtual ~RenderEnvironment() { }
68 
69  virtual play::Timings& effectiveTimings() =0;
70  virtual Dispatcher& getDispatcher() =0;
71  };
72 
73 
83  : public JobClosure
84  {
85 
86  RenderEnvironment& engine_;
87 
88 // const ModelPort modelPort_;
89 // const uint channel_;
90 
91 
92  /* === JobClosure Interface === */
93 
94  JobKind
95  getJobKind() const
96  {
97  return META_JOB;
98  }
99 
100  size_t hashOfInstance (InvocationInstanceID) const override;
101  InvocationInstanceID buildInstanceID(HashVal) const override;
102 
103  void invokeJobOperation (JobParameter) override;
104 
105 
106 
107 
108  public:
112  RenderDrive (RenderEnvironment& renderEnvironment
113  ,ModelPort port, uint chan)
114  : engine_{renderEnvironment}
115  { }
116 
117 
118  play::Timings const&
119  getTimings() const
120  {
121  return engine_.effectiveTimings();
122  }
123 
133  Job prepareRenderPlanningFrom (FrameCnt startFrame);
134 
135 
136  private:
137  void performJobPlanningChunk(FrameCnt nextStartFrame);
138  Job buildFollowUpJobFrom (Time refPoint);
139  };
140 
141 
142 
143 }} // namespace steam::engine
144 #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:86
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:81
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:299
JobKind
Definition: job.h:62
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:95
opaque ID attached to each individual job invocation.
Definition: job.h:103
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:52
Interface of the closure for frame rendering jobs.
Definition: job.h:235
How to define a timing specification or constraint.
int64_t FrameCnt
relative framecount or frame number.
Definition: digxel.hpp:312
render process self organisation
Definition: job.h:66
Individual frame rendering task, forwarding to a closure.
Definition: job.h:268
Abstract definition of the environment hosting a given render activity (CalcStream).