Simplify user render pass scheduling


The scheduling of top-level user passes re-scheduled every pass each
sync by first unscheduling all of them and then re-adding them in list
order, purely so that a later scheduling call from a RenderOutputProvider
could not change the render order. This left two code paths mutating the
scheduled list and reconciling the result through the order in which
passes happened to be inserted.

Give each top-level pass a stable declaration order, taken from its
position in the scene manager's userRenderPasses list, and sort the
scheduled passes by dependency index and then by that declaration order.
The render order is now intrinsic to the passes, so the sync no longer
needs to unschedule and re-add anything; it hands the manager the current
set of top-level passes in one call.

Reject sub-passes in scheduleUserPass so a pass invoked through a
SubRenderPass command can never enter the scheduled list, even when a
RenderOutputProvider requests its result. This keeps the manager as the
single point that enforces the top-level and sub-pass distinction.

The classification of a pass as top-level or sub-pass is derived from
who references it: each SubRenderPass command references a counter on
the pass assigned to its renderPass property, a pass with at least one
referent is a sub-pass, and the pass mirrors its role to the backend
node when it syncs. This avoids rescanning every pass's command list
during synchronization, handles a pass that is referenced from several
parents naturally, and classifies correctly before the first
synchronization since the references are tracked on the frontend
objects. A dirty flag on the scene manager tracks when the declaration
order needs to be re-derived. A sub-pass keeps its order from its
command index, so it needs nothing from the top-level declaration
order.

Task-number: QTBUG-148554
Pick-to: 6.12 6.11
Change-Id: I9ee781e6601f57d961827d82b81f5ccdc714a730
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
commit4863c6682e286ae4ece77ee779238753d80b43b8
parent2cccf6ce84144679d74c94c7dbfc4fef788e50a9
authorChristian Strømme <christian.stromme@qt.io>
committerChristian Strømme <christian.stromme@qt.io>
commit timeWed, 9 Sep 2026 06:02:44 +0000