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

Bug [Burst] Aliasing error on NativeSlices which aren't aliasing

Discussion in 'Burst' started by manutoo, Sep 29, 2020.

  1. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    Hello,

    I got this error :
    Despite what the error says, m_DstPixel& m_SrcPixel are NativeSlice and not NativeArray.

    And I'm relatively confident that these 2 NativeSlices don't overlap, and thus this error shouldn't trigger.

    My Setup = Unity 2019.4.1 + Burst 1.3.6 .
     
  2. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Looks like they are slice from the same array. try pass 2 range and the array in and make slice in the job.
    The two slice has the same SaftyHanle (from the array) that should be the reason for the Exception.
     
  3. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    @Lieene-Guo,
    yes, they are from the same array, but it shouldn't trigger an aliasing error if they don't overlap.

    The job can be done on the same array or 2 different arrays, so the setup shouldn't be done in it.

    So I just flagged the NativeSlice declaration with [NativeDisableContainerSafetyRestriction] ; it works well enough for my needs. :)