From the workgraph spec:
The graph is acyclic, with one exception: a node can output to itself. There is a depth limit of 32 including recursion.
When writing a path tracer for example in a workgraph, these limitations quickly turn into a substantial issue as it now forces the user to immediately worry about how to get around these limitations.
Consider the following simple pattern:
Primary rays origins and directions are generated from broadcast node A
Rays are traced in thread node B
Results are shaded, and new ray origins and directions are generated in thread node C
Next event estimation is traced in thread node D
New rays are traced in thread node B
repeat steps 3 to 5 for every bounce
In this simple case, doing multiple bounces in a single workgraph requires the user to manually write out or generate a lot of duplicate code.
For example just generating the hit shaders for every bounce with a macro results in something along the lines of this;
You can quickly see how this is not elegant at all, generating the code externally isn't really ideal either as it feels like there should be something possible here in order to reuse nodes / allow recursion from node C > B for example.
Additionally writing a path tracer this way also quickly hits the current limit of 32, as each bounce already visits a minimum of 3 nodes, which quickly limits how many bounces a path can do, especially when additional logic is inserted between stages.
So to summerize;
We'd like the ability to do recursion to different nodes
From the workgraph spec:
The graph is acyclic, with one exception: a node can output to itself. There is a depth limit of 32 including recursion.
When writing a path tracer for example in a workgraph, these limitations quickly turn into a substantial issue as it now forces the user to immediately worry about how to get around these limitations.
Consider the following simple pattern:
A
B
C
D
B
In this simple case, doing multiple bounces in a single workgraph requires the user to manually write out or generate a lot of duplicate code. For example just generating the hit shaders for every bounce with a macro results in something along the lines of this;
You can quickly see how this is not elegant at all, generating the code externally isn't really ideal either as it feels like there should be something possible here in order to reuse nodes / allow recursion from node
C
>B
for example.Additionally writing a path tracer this way also quickly hits the current limit of 32, as each bounce already visits a minimum of 3 nodes, which quickly limits how many bounces a path can do, especially when additional logic is inserted between stages.
So to summerize;