Skip to content

Game.CompleteRenderingSystem

Assembly: Assembly-CSharp (inferred)
Namespace: Game.Rendering

Type: public class

Base: GameSystemBase

Summary:
Coordinates the finalization of rendering-related subsystems at the end of a frame. This system completes pending jobs/updates (batch uploads, procedural skeleton/emissive uploads, wind texture updates, mesh completion, virtual texture requests), applies overlay infomode changes, and then advances the global UpdateSystem to the CompleteRendering phase. Methods are decorated with [Preserve] to avoid code stripping in builds.


Fields

  • private BatchManagerSystem m_BatchManagerSystem
    References the BatchManagerSystem used to access native and managed batch data and to drive batch uploads.

  • private ManagedBatchSystem m_ManagedBatchSystem
    Handles managed-batch-related work such as completing virtual texture (VT) requests.

  • private ProceduralSkeletonSystem m_ProceduralSkeletonSystem
    Used to finalize uploads for procedural skeleton data (e.g., GPU skinning or animated skeleton data).

  • private ProceduralEmissiveSystem m_ProceduralEmissiveSystem
    Used to finalize emissive texture or buffer uploads for procedural emissive elements.

  • private WindTextureSystem m_WindTextureSystem
    Completes wind texture updates (wind animation textures used by shaders).

  • private BatchMeshSystem m_BatchMeshSystem
    Finalizes mesh generation/processing for batched meshes.

  • private UpdateSystem m_UpdateSystem
    Global update manager; advanced to the CompleteRendering update phase by this system.

  • private OverlayInfomodeSystem m_OverlayInfomodeSystem
    Applies overlay infomode changes (e.g., render overlays for info views) at the end of rendering.

Properties

  • This class does not expose public properties.

Constructors

  • public CompleteRenderingSystem()
    Default public constructor. The system uses OnCreate to initialize required subsystem references; constructor itself contains no custom logic.

Methods

  • protected override void OnCreate()
    Initializes references to required managed systems by calling base.World.GetOrCreateSystemManaged() for each subsystem used during completion. Decorated with [Preserve] to prevent stripping. Typical subsystems acquired:
  • BatchManagerSystem
  • ManagedBatchSystem
  • ProceduralSkeletonSystem
  • ProceduralEmissiveSystem
  • WindTextureSystem
  • BatchMeshSystem
  • UpdateSystem
  • OverlayInfomodeSystem

  • protected override void OnUpdate()
    Performs end-of-frame completion steps in order:

  • Obtains native batch instances (NativeBatchInstances) from the BatchManagerSystem, receiving a JobHandle for dependencies.
  • Retrieves ManagedBatches and calls dependencies.Complete() to ensure jobs are finished.
  • Calls managedBatches.EndUpload(nativeBatchInstances) to finalize managed uploads that depend on the native batch data.
  • Calls CompleteUpload() on ProceduralSkeletonSystem and ProceduralEmissiveSystem.
  • Calls CompleteUpdate() on WindTextureSystem.
  • Calls CompleteVTRequests() on ManagedBatchSystem.
  • Calls CompleteMeshes() on BatchMeshSystem.
  • Calls ApplyOverlay() on OverlayInfomodeSystem to apply any overlay/information-mode rendering changes.
  • Advances the UpdateSystem to the SystemUpdatePhase.CompleteRendering phase via UpdateSystem.Update(SystemUpdatePhase.CompleteRendering). All of the above ensures GPU/CPU jobs and streaming operations required for rendering are finished before the frame finalization.

Usage Example

[Preserve]
protected override void OnCreate()
{
    base.OnCreate();
    // Acquire dependent systems used for end-of-frame rendering completion.
    m_BatchManagerSystem = base.World.GetOrCreateSystemManaged<BatchManagerSystem>();
    m_ManagedBatchSystem = base.World.GetOrCreateSystemManaged<ManagedBatchSystem>();
    m_ProceduralSkeletonSystem = base.World.GetOrCreateSystemManaged<ProceduralSkeletonSystem>();
    m_ProceduralEmissiveSystem = base.World.GetOrCreateSystemManaged<ProceduralEmissiveSystem>();
    m_WindTextureSystem = base.World.GetOrCreateSystemManaged<WindTextureSystem>();
    m_BatchMeshSystem = base.World.GetOrCreateSystemManaged<BatchMeshSystem>();
    m_UpdateSystem = base.World.GetOrCreateSystemManaged<UpdateSystem>();
    m_OverlayInfomodeSystem = base.World.GetOrCreateSystemManaged<OverlayInfomodeSystem>();
}

{{ Additional notes: - This system expects the various subsystems to be present in the world; GetOrCreateSystemManaged will create them if missing. - OnUpdate synchronously completes job handles (via dependencies.Complete()), so this system blocks until the relevant GPU/CPU tasks are finished. - The order of completion calls is important: managed uploads rely on native batch instance availability, and overlays should be applied before signaling the CompleteRendering update phase. }}