Chains of graphs¶
Requirements¶
The engine shall support an ordered chain of already compiled graphs. Each link shall see the results of the preceding links, without CPU submissions or waits between links. |
A chain shall support executing the same graph path more than once. Every occurrence shall execute, using the results of the preceding links. |
A chain shall be reusable after its previous submission has finished, using updated inputs without recompiling its graphs or recording new command buffers. |
Graphs in a chain shall be able to share buffers, so that a result produced by one graph can be used by a later graph without copying it through the CPU. Compiling a later graph shall preserve the shared buffers and their contents. |
Chains using different paths of the same graphs shall be able to have submissions in flight at the same time. Each path shall use its own per-path buffers without overwriting another path’s data. |
Specifications¶
|
A graph path that occurs more than once in a chain must have been compiled
after |
A |
Tests¶
Runs a graph on its own and then as a one-link chain, checking that both submissions apply the same computation to its buffer. |
Adding the same graph path twice throws unless the graph was compiled after
|
Runs a graph that doubles a buffer four times in one chain and checks that the result is sixteen times the input. |
Chains graphs that double a shared buffer or add one to it. Changing their order changes the result as expected. |
Submits the same chain for several frames, replacing its input between submissions, and checks the result of each frame. |
Compiles two graphs sharing a per-path |
Submits two chains over different paths of the same graphs before waiting for either chain. Both paths compute the expected result from their own input buffers. |