Search Unity

make ComputeBuffer job friendly

Discussion in 'Entity Component System' started by laurentlavigne, Jan 21, 2018.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    at this time, SetData takes an array, jobs only output NativeArray, which then need to be ToArray-ified first, but ToArray and CopyTo allocates an array internally, and this makes the GC sad.

    I think the Job team will take the minimalist route and add a non alloc CopyTo, but in case they don't, it would help a lot to have SetData (NativeArray).
     
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Joachim confirmed that this will all happen, but it is early in beta. Officially they did not add the job system yet...
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    good to let me know, I'll stop chasing the windmills
    I missed that, was it in the mailing list?
     
  4. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    One of the other forum threads...

    Lennart