After updating to Burst 1.1.1 i started getting this error.
My specific struct is ValueTuple<int, int>
Error callstack
[spoiler]
*com.unity.collections@0.0.9-preview.20\Unity.Collections\NativeQueue.cs(406,4): error: Struct System.ValueTuple
2 with auto layout is not supported by burst** __at Unity.Collections.NativeQueue
1.Concurrent<System.ValueTuple2<System.Int32,System.Int32>>.Enqueue(Unity.Collections.NativeQueue
1.Concurrent<System.ValueTuple2<int,int>>* this, System.ValueTuple
2<int,int> entry)__
__at Stackray.Entities.ExtractChangedSlicesFromChunks.Execute(Stackray.Entities.ExtractChangedSlicesFromChunks this, int index)__
at Unity.Jobs.IJobParallelForExtensions.ParallelForJobStruct`1<Stackray.Entities.ExtractChangedSlicesFromChunks>.Execute(ref Stackray.Entities.ExtractChangedSlicesFromChunks jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) (at C:\buildslave\unity\build\Runtime\Jobs\Managed\IJobParallelFor.cs:43)
[/spoiler]
Anything on this?
Thanks
Right, we currently don’t support it. I don’t think it will be a problem to support it (even we don’t do anything special and it is not optimal)
We’ve looked into this. The reason we added validation in Burst 1.1 to prevent use of Auto
-layout structs is that the Mono runtime is free to reorder or move fields in these structs, and we aren’t able to generate native code that is guaranteed to match the Mono memory layout. For example, this ValueTuple:
ValueTuple<bool, int, bool>
might have its fields shifted at runtime to only take up 6 bytes, instead of the at-least-9 bytes that it would otherwise take up. If you are copying values between managed code and Burst-compiled code, it would fail at runtime in difficult-to-detect ways.
For this reason we aren’t able to add support for Auto
-layout structs in Burst.
Yeah that is what I thought regarding all the flexibility that comes with ValueTuple.
Anyway this is an easy one to fix by implementing it myself.
Again thanks for the wonderful job you guys been doing