Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Does Creating an EntityCommandBuffer Create a new SynchPoint?

Discussion in 'Data Oriented Technology Stack' started by RyancHaynes, Aug 13, 2020.

  1. RyancHaynes

    RyancHaynes

    Joined:
    Dec 8, 2018
    Posts:
    9
    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:
    159
    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. vestigial

    vestigial

    Joined:
    May 9, 2015
    Posts:
    174
    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:
    420
    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.
     
unityunity