Search Unity

net core standard new features and ECS/job

Discussion in 'Entity Component System' started by lobotomista, Nov 8, 2018.

  1. lobotomista

    lobotomista

    Joined:
    Jul 21, 2018
    Posts:
    39
    So reading on the new net core features, the span<t> type sounds a lot like the data management used in ECS. Is this gonna be able to be used in conjunction wit ECS?
     
  2. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Currently, burst does not support Span<T> but we might be able to provide a partial support for it in a future release (can't tell when this will happen exactly)

    A few notes:

    Span<T> can work with managed arrays while we cannot support this with burst.
    Span<T> is a stack only type while native containers in Unity can be passed to jobs so it is serving a different purpose. Mostly to abstract working on a slice of array of data whether it is coming from the stack, managed or unmanaged memory.
    But a nice feature of Span<T> is to safely wrap a stackalloc without unsafe code. That would be probably one interesting part of Span<T> for burst jobs. Another would be to be able to interact with a 3rd party .NET library accepting Span in its API.
     
    lobotomista likes this.
  3. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    @xoofx Alex, any progress on CoreCLR port since the spinning cube?
     
  4. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417