Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Does Creating an EntityCommandBuffer Create a new SynchPoint?

Discussion in 'Entity Component System' started by RyancHaynes, Aug 13, 2020.

  1. RyancHaynes

    RyancHaynes

    Joined:
    Dec 8, 2018
    Posts:
    11
    If that's the case, does that mean for every system I have that needs to send commands to the EntityManager I will be creating a new Synch point?

    I'm asking because I'm upgrading some of my code to use SystemBase rather than the soon to be depreciated ComponentSystem Class and I lost references to an ECB.
     
  2. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    AFAIK, your understanding is correct. The sync point is the existing system (eg EndSimulationGroupEntityCommanfBufferSystem). You can also create an ECB yourself and Playback, and that would be a sync point.
     
    RyancHaynes likes this.
  3. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    216
    Sorry, this is probably in response to my deleted post, not the OP.
    I deleted it because it referenced PostUpdateCommands which I guess doesn't exist in SystemBase
     
  4. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    Answering directly the OP just for accuracy: no, creating an EntityCommandBuffer doesn't create a sync point, it will only create a sync point when/if you playback the created EntityCommandBuffer.

    This is why this is recommended to use one of the existing EntityCommandBufferSystem to create and schedule command buffer playbacks when you want to avoid extra sync points.