This class provides a solution for overriding the final render target / view rect in a chain of render graph passes. RDG pass setup is immediate, which makes it difficult to determine the final pass in a chain in order to swap a final texture target (e.g. the view family target). This class helps by providing some utilities to mark passes as enabled prior to setup, then seamlessly assign the override texture to the correct last pass. It assumes that all passes adhere to the pattern of using an input struct that derives from FScreenPassRenderTarget (though this is not strictly required).
The user provides a custom enum class that is the set of ordered passes. The user can enable them in any order, but all passes must be assigned (i.e. have SetEnabled called on them). After enabling / disabling all passes. Call Finalize to compute internal state. You cannot enable / disable passes after finalizing. Each pass must be accepted in order, and all passes marked as enabled must be accepted. The helper, AcceptOverrideIfLastPass, will check and override if the pass is the last one, and then accept the pass.