Order top-level user render passes by nesting depth
Top-level user passes were ordered by a dependency index taken from
the QML parent node's DFS index, recomputed only when the node tree
was marked dirty. The DFS counter made the order depend on document
position in surprising ways (a pass under a later sibling subtree
outranked one under a deeper, earlier subtree), the recompute was
skipped when a pass was added or removed without a node-tree change,
and expressing an ordering required wrapping passes in Node items,
pulling transform semantics into a pure ordering concern.
Replace the mechanism with pass nesting. A pass's nesting depth is the
number of RenderPass ancestors it has, and nested passes render before
their parent, so a pass producing a texture consumed by another pass
is declared as a child of its consumer and results merge towards the
top of the pass hierarchy, mirroring how sub-passes already read in
QML. Other ancestors are transparent: a pass grouped under a Node
orders as if it were declared at the level of that Node, so existing
scenes with Node-parented passes keep rendering. Nesting affects
ordering only; a nested pass still renders into its own render target,
and rendering into the parent's target remains exclusive to
SubRenderPass commands. Passes at equal depth keep the same stable
registration-order tiebreak as before; their relative order is not a
documented guarantee. Since a deeper pass renders before all shallower
passes, a producer's output is available to every consumer in the same
frame, not only its parent, and ordering cycles cannot be expressed at
all.
Task-number: QTBUG-148554
Pick-to: 6.12 6.11
Change-Id: I94da888c0d5cf7de024a404227ee7b3a8e1ae24e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>