Invocation: release buffer after completed calculation
Not entirely sure how to use the `emit()` call properly, assuming that it means that data is complete in buffer, but can still be read after that point
This commit is contained in:
parent
133dd9e8ce
commit
95046489d2
4 changed files with 121 additions and 46 deletions
|
|
@ -161,7 +161,7 @@ namespace engine {
|
|||
* may be emitted, and at most once.
|
||||
* @warning by convention, emitting a buffer implies that the contained data is ready and
|
||||
* might be used by other parts of the application.
|
||||
* An emitted buffer should not be modified anymore.
|
||||
* While an emitted buffer should not be modified anymore, it can still be accessed.
|
||||
*/
|
||||
void
|
||||
BufferProvider::emitBuffer (BuffHandle const& handle)
|
||||
|
|
|
|||
|
|
@ -373,9 +373,9 @@ namespace engine {
|
|||
{
|
||||
REQUIRE (fanIn >= FAN_I and fanOut >= FAN_O);
|
||||
for (uint i=0; i<FAN_I; ++i)
|
||||
inParam[i] = MAN::inBuff[i].template accessAs<BuffI*>();
|
||||
inParam[i] = & MAN::inBuff[i].template accessAs<BuffI>();
|
||||
for (uint i=0; i<FAN_O; ++i)
|
||||
outParam[i] = MAN::outBuff[i].template accessAs<BuffO*>();
|
||||
outParam[i] = & MAN::outBuff[i].template accessAs<BuffO>();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -452,13 +452,22 @@ namespace engine {
|
|||
void
|
||||
weft (Feed& feed)
|
||||
{
|
||||
/* NOP */
|
||||
feed.invoke();
|
||||
}
|
||||
|
||||
void
|
||||
fix (Feed& feed)
|
||||
{
|
||||
/* NOP */
|
||||
for (uint i=0; i<fanIn; ++i)
|
||||
{
|
||||
feed.inBuff[i].release();
|
||||
}
|
||||
for (uint i=0; i<fanOut; ++i)
|
||||
{
|
||||
feed.outBuff[i].emit();
|
||||
if (i != feed.resultSlot)
|
||||
feed.outBuff[i].release();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,7 @@ Beyond that, it can be necessary to associate at least a state flag with //indiv
|
|||
__Note__: while the API to access this service is uniform, conceptually there is a difference between just using the (shared) type information and associating individual metadata, like the buffer state. Type-~IDs, once allocated, will never be discarded (within the lifetime of an Lumiera application instance -- buffer associations aren't persistent). To the contrary, individual metadata //will be discarded,// when releasing the corresponding buffer. According to the ''prototype pattern'', individual metadata is treated as a one-way-off specialisation.
|
||||
</pre>
|
||||
</div>
|
||||
<div title="BufferProvider" modifier="Ichthyostega" created="201107082330" modified="202406282147" tags="Rendering spec draft" changecount="6">
|
||||
<div title="BufferProvider" modifier="Ichthyostega" created="201107082330" modified="202407142212" tags="Rendering spec draft" changecount="7">
|
||||
<pre>It turns out that -- throughout the render engine implementation -- we never need direct access to the buffers holding actual media data. Buffers are just some entity to be //managed,// i.e. "allocated", "locked" and "released"; the //actual meaning of these operations can be left to the implementation.// The code within the render engine just pushes around ''smart-prt like handles''. These [[buffer handles|BuffHandle]] act as a front-end, being created by and linked to a buffer provider implementation. There is no need to manage the lifecycle of buffers automatically, because the use of buffers is embedded into the render calculation cycle, which follows a rather strict protocol anyway. Relying on the [[capabilities of the scheduler|SchedulerRequirements]], the sequence of individual jobs in the engine ensures...
|
||||
* that the availability of a buffer was ensured prior to planning a job ("buffer allocation")
|
||||
* that a buffer handle was obtained ("locked") prior to any operation requiring a buffer
|
||||
|
|
@ -1265,7 +1265,7 @@ While BufferProvider is an interface meant to be backed by various and diverse k
|
|||
;attaching
|
||||
:optionally the client may attach an object to a locked buffer. This object is placement-constructed into the buffer and will be destroyed automatically when releasing the buffer. Alternatively, the client may provide a pair of constructor- / destructor-functors, to be invoked in a similar way. This allows e.g. to install descriptor structures within the buffer, as required by an external media handling library.
|
||||
;emitting
|
||||
:the client //may optionally mark a state transition// -- whose precise meaning remains implicit and implementation dependent. From the client's perspective, emitting and releasing may seem equivalent, since the buffer should not be touched after that point. However, conceivably there are usages where it matters for //the consumer// to be sure an expected result was actually achieved, since the producer may well acquire the buffer and then fail to complete the required work, prompting some clean-up safety mechanism to merely release the resources.
|
||||
:the client //may optionally mark a state transition// -- whose precise meaning remains implicit and implementation dependent. From the client's perspective, emitting and releasing may seem equivalent, since the buffer content should not be altered after that point. However, conceivably there are usages where it matters for //the consumer// to be sure an expected result was actually achieved, since the producer may well acquire the buffer and then fail to complete the required work, prompting some clean-up safety mechanism to merely release the resources.
|
||||
;releasing
|
||||
:buffers need to be released explicitly by the client code. This renders the corresponding BuffHandle invalid, (optionally) invokes a destructor function of an attached object and maybe reclaims the buffer memory
|
||||
|
||||
|
|
|
|||
|
|
@ -1500,9 +1500,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1502375312469" ID="ID_1075926054" MODIFIED="1576282358153" TEXT="ironischerweise...">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...könnte das am Ende nicht sinnvoll sein,
|
||||
|
|
@ -1535,9 +1533,7 @@
|
|||
</node>
|
||||
<node CREATED="1502390402273" ID="ID_929098721" MODIFIED="1518487921054">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
wenn UI-Thread blockt/verhungert,
|
||||
|
|
@ -1661,9 +1657,7 @@
|
|||
<node CREATED="1534026768353" ID="ID_38337485" MODIFIED="1534026773780" TEXT="statisch extern"/>
|
||||
<node CREATED="1534026775080" ID="ID_875112330" MODIFIED="1534026808983">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
in proc::asset::meta::<b><font color="#c01a1a">theErrorLog_ID</font></b>
|
||||
|
|
@ -1709,9 +1703,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1522936169270" FOLDED="true" ID="ID_1991244597" MODIFIED="1561827469123" TEXT="vorläufig eingehängt...">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...in den eigentlich kaputten DockManager
|
||||
|
|
@ -1832,9 +1824,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1537754684692" FOLDED="true" HGAP="65" ID="ID_494305022" MODIFIED="1561827464612" TEXT="Rolle im API klären" VSHIFT="-12">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
brauchen wir diese zwischengeschaltete Methode <b>showMsg()</b>?
|
||||
|
|
@ -2168,9 +2158,7 @@
|
|||
</node>
|
||||
<node COLOR="#338800" CREATED="1538581570783" FOLDED="true" ID="ID_1599117331" MODIFIED="1561827464614" TEXT="Problem: Ende wandert mit...">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...das liegt vermutlich daran, daß ich die zweite Marke mit "right gravity" einfüge,
|
||||
|
|
@ -2990,9 +2978,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1534120150465" ID="ID_222097969" MODIFIED="1538263469673">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
"If widget exists: expand it, trigger its flash function (paint with timeout).
|
||||
|
|
@ -4502,9 +4488,7 @@
|
|||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1482464377831" ID="ID_1028012453" MODIFIED="1482464390602">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<i>ist nicht</i> "die Session
|
||||
|
|
@ -6477,9 +6461,7 @@
|
|||
<node CREATED="1493768625564" ID="ID_1620270152" MODIFIED="1557498707220" TEXT="Verdacht: stattdessen Gtk::Application"/>
|
||||
<node CREATED="1495218227391" ID="ID_1156276489" MODIFIED="1576282358135" TEXT="Beschluß: vorerst Gtk::Action / ActionGroup weiter verwenden">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<u>Begründung</u>:
|
||||
|
|
@ -8864,9 +8846,7 @@
|
|||
<node CREATED="1510939856845" ID="ID_1492383135" MODIFIED="1512797263192" TEXT="Erweiterungs-Mechanismus im Baum-Explorer implementiert"/>
|
||||
<node CREATED="1510939940275" ID="ID_767766017" MODIFIED="1512797263192">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
expand() ruft eine vorbereitete Parametrisierung
|
||||
|
|
@ -14436,9 +14416,7 @@
|
|||
</node>
|
||||
<node COLOR="#338800" CREATED="1518055400412" ID="ID_1517580371" MODIFIED="1518487921069">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Komponente <i>falls nötig</i> anhängen
|
||||
|
|
@ -88056,8 +88034,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
 <font size="5">☹</font>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="smiley-oh"/>
|
||||
</node>
|
||||
<node CREATED="1720744374507" ID="ID_1809381526" MODIFIED="1720744406234" TEXT="den BufferDescriptor hätte man in einen Builder für die BuffTable geben sollen....">
|
||||
|
|
@ -88072,8 +88049,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
der Turnout ist ein Level-1-Builder....
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1720744464053" ID="ID_399616777" MODIFIED="1720745760878" TEXT="man könnte nun das Design etwas »aufbohren«">
|
||||
|
|
@ -88100,8 +88076,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
mit der offensichtlichen <i>forwarding-Impl</i>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -88117,6 +88092,36 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720995636884" ID="ID_200677331" MODIFIED="1720995641668" TEXT="Buffer freigeben">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1720995644299" ID="ID_9394759" MODIFIED="1720995662347" TEXT="BufferProvider-Protokoll anwenden... (wie?)">
|
||||
<node CREATED="1720995434251" ID="ID_686121956" MODIFIED="1720995711865">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
gehe mal davon aus,
|
||||
</p>
|
||||
<p>
|
||||
daß nach kompletter Berechnung
|
||||
</p>
|
||||
<p>
|
||||
ein <font face="Monospaced" color="#8a0606">emitBuffer()</font> erfolgen soll
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<arrowlink COLOR="#3c3267" DESTINATION="ID_861820571" ENDARROW="Default" ENDINCLINATION="65;-527;" ID="Arrow_ID_1939934739" STARTARROW="None" STARTINCLINATION="1714;371;"/>
|
||||
<node CREATED="1720995730036" ID="ID_578172689" MODIFIED="1720995740742" TEXT="bedeutet: nur für die Ausgabeseite"/>
|
||||
</node>
|
||||
<node CREATED="1720995744334" ID="ID_1219900691" MODIFIED="1720995772028" TEXT="danach: releaseBuffer()">
|
||||
<node CREATED="1720995762230" ID="ID_773368753" MODIFIED="1720995768989" TEXT="auf beiden Seiten"/>
|
||||
<node CREATED="1720995776062" ID="ID_371443411" MODIFIED="1720995785812" TEXT="aber NICHT für den Ergebnis-Buffer">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720620607691" ID="ID_1114186515" MODIFIED="1720620622602" TEXT="diese Invocation nun konfigurierbar machen">
|
||||
|
|
@ -127503,6 +127508,22 @@ std::cout << tmpl.render({"what", "World"}) << s
|
|||
<icon BUILTIN="info"/>
|
||||
<node CREATED="1719248935388" ID="ID_617181865" MODIFIED="1719268724291" TEXT="Buffer-Management ≙ Output-Management">
|
||||
<linktarget COLOR="#494b7a" DESTINATION="ID_617181865" ENDARROW="Default" ENDINCLINATION="-882;-55;" ID="Arrow_ID_987434698" SOURCE="ID_1877886821" STARTARROW="None" STARTINCLINATION="-1297;72;"/>
|
||||
<node CREATED="1720994361669" ID="ID_1003140786" MODIFIED="1720994484336" TEXT="allerdings sind das zwei verschiedene Sichten">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<ul>
|
||||
<li>
|
||||
BufferProvider: Zugang zu Arbeits-Speicherblöcken
|
||||
</li>
|
||||
<li>
|
||||
OutputManagement: verwalten von Datenströmen
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1719248978957" ID="ID_1526659438" MODIFIED="1719248990921" TEXT="BufferProvider">
|
||||
<node CREATED="1719248991858" ID="ID_1208921811" MODIFIED="1719249009087" TEXT="generische Schnittstelle als Zugang zu abstrahierten Buffern"/>
|
||||
|
|
@ -127512,6 +127533,45 @@ std::cout << tmpl.render({"what", "World"}) << s
|
|||
<arrowlink COLOR="#6b5acb" DESTINATION="ID_530710667" ENDARROW="Default" ENDINCLINATION="1768;327;" ID="Arrow_ID_24508834" STARTARROW="None" STARTINCLINATION="673;-23;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
</node>
|
||||
<node CREATED="1720994579979" ID="ID_944320596" MODIFIED="1720994589719" TEXT="definiert ein Nutzungs-Protokoll">
|
||||
<node CREATED="1720994592579" ID="ID_1773641994" MODIFIED="1720994594358" TEXT="Schritte">
|
||||
<node CREATED="1720994595210" ID="ID_983801480" MODIFIED="1720994597773" TEXT="announce">
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1720994891272" ID="ID_8181934" MODIFIED="1720994897422" TEXT="Relevanz nicht klar">
|
||||
<icon BUILTIN="help"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1720994598433" ID="ID_398873507" MODIFIED="1720994600241" TEXT="lock"/>
|
||||
<node CREATED="1720994600873" ID="ID_1936046577" MODIFIED="1720994602301" TEXT="emit">
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1720994846469" ID="ID_861820571" MODIFIED="1720995711866" TEXT="Semantik noch nicht klar">
|
||||
<linktarget COLOR="#3c3267" DESTINATION="ID_861820571" ENDARROW="Default" ENDINCLINATION="65;-527;" ID="Arrow_ID_1939934739" SOURCE="ID_686121956" STARTARROW="None" STARTINCLINATION="1714;371;"/>
|
||||
<font NAME="SansSerif" SIZE="12"/>
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1720994865067" ID="ID_347998785" MODIFIED="1720995165926" TEXT="wird er dadurch read-only?"/>
|
||||
<node CREATED="1720994881137" ID="ID_1953607616" MODIFIED="1720995181108" TEXT="klar ist nur: der Inhalt soll nicht mehr geändert werden"/>
|
||||
<node CREATED="1720995191815" ID="ID_1402712993" MODIFIED="1720995208942">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<u>Achtung</u>: <b>nicht</b> idempotent
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1720994602913" ID="ID_891897804" MODIFIED="1720994604293" TEXT="release"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1720994663330" ID="ID_735498857" MODIFIED="1720994796501" TEXT="konkrete Implementierungen">
|
||||
<arrowlink COLOR="#522544" DESTINATION="ID_1402038286" ENDARROW="Default" ENDINCLINATION="-657;-39;" ID="Arrow_ID_1160732485" STARTARROW="None" STARTINCLINATION="-609;54;"/>
|
||||
<icon BUILTIN="forward"/>
|
||||
<node CREATED="1720994805867" ID="ID_1693627566" MODIFIED="1720994833139" TEXT="Puffer"/>
|
||||
<node CREATED="1720994809770" ID="ID_1844451507" MODIFIED="1720994813237" TEXT="Cache"/>
|
||||
<node CREATED="1720994813884" ID="ID_1368231699" MODIFIED="1720994819892" TEXT="Output"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1719249067047" ID="ID_860520674" MODIFIED="1719249077469" TEXT="OutputManager">
|
||||
<node CREATED="1719249078625" ID="ID_1793577189" MODIFIED="1719269049808" TEXT="Definition: ein konkreter Service zur Verwaltung externer Ausgaben">
|
||||
|
|
@ -129020,12 +129080,18 @@ std::cout << tmpl.render({"what", "World"}) << s
|
|||
<node CREATED="1715624289964" ID="ID_1595450559" MODIFIED="1715624384997" TEXT="Speicher mit Fixture-Struktur verbunden">
|
||||
<linktarget COLOR="#454059" DESTINATION="ID_1595450559" ENDARROW="Default" ENDINCLINATION="-1036;-77;" ID="Arrow_ID_1704085390" SOURCE="ID_127710483" STARTARROW="None" STARTINCLINATION="-161;430;"/>
|
||||
</node>
|
||||
<node CREATED="1720994208167" ID="ID_985068668" MODIFIED="1720994229990" TEXT="BufferProvider">
|
||||
<node CREATED="1720994687447" ID="ID_1402038286" MODIFIED="1720994796501" TEXT="für die RenderEngine relevante BufferProvider">
|
||||
<linktarget COLOR="#522544" DESTINATION="ID_1402038286" ENDARROW="Default" ENDINCLINATION="-657;-39;" ID="Arrow_ID_1160732485" SOURCE="ID_735498857" STARTARROW="None" STARTINCLINATION="-609;54;"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1681085780230" ID="ID_667166448" MODIFIED="1681085784377" TEXT="Render Toolkit">
|
||||
<node CREATED="1681085789797" ID="ID_435519695" MODIFIED="1681085821901" TEXT="Abstraktionsschicht über Low-Level-Funktionalität"/>
|
||||
<node CREATED="1681085863204" ID="ID_136936235" MODIFIED="1681085881132" TEXT="isoliert system-Level Services und externe Library-Erweiterungen"/>
|
||||
</node>
|
||||
<node CREATED="1720994187035" ID="ID_1817562586" MODIFIED="1720994190143" TEXT="Basis-Dienste"/>
|
||||
</node>
|
||||
<node CREATED="1720131181173" ID="ID_792463857" MODIFIED="1720131194751" TEXT="Extern">
|
||||
<node CREATED="1720131209154" ID="ID_218200346" MODIFIED="1720131229705" TEXT="Integration"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue