Hi All, We have just published the final version of burst 1.0, more than 90 releases since the first package published last year, that's quite a milestone! The compiler is able to generate, from a subset of C#, highly optimized native code, sometimes faster than their C++ equivalent, and an order of magnitude faster than regular C# code. In practice, this should give more creative opportunities in your games, which is awesome. We have been improving the quality of the compiler over the previous months and fixing any bugs as quickly - and correctly as possible. The overall quality has been improved thanks to all your feedback here and we appreciate. This is really just the beginning of our journey with burst, we plan to bring more performance and user oriented features in the coming months and years. Stay tuned! In case you are having an issue with this latest version let us know via a new forum message and a submit of your issue with Unity bug report system. Best regards
private static readonly int3[] Corners = { int3(0,0,0), int3(0,0,1), int3(0,1,0), int3(0,1,1), int3(1,0,0), int3(1,0,1), int3(1,1,0), int3(1,1,1) }; error: Creating a managed array `Unity.Mathematics.int3[]` is not supported by burst Is that a bug or in the todo list, or I should just use a static NativeArray ?
It should work (but the error printed doesn't say if it is really on the declaration of the array or not), but it depends how it is used. You cannot for example pass this array around, you can only access it directly in a method... but we might a particular bug with int3 in your case, we will double check this. So this is something that we haven't communicated yet broadly, but burst has been supporting for a few release now constant managed arrays. You need to declare a static readonly field with the managed array, and you need to make sure that no C# code will modify the array outside of a burst job (C# doesn't support deep const/readonly unfortunately, you need to enforce it through a container). They can be used as constant lookup tables for example. They should work with primitive types as well as vector types and plain struct types (e.g no exceptions in their constructors).
More context for your investigations : Errors : first an exception when accessing the array in a job and then, lower in the console, this "error: Creating a managed array `Unity.Mathematics.int3[]` " is not supported by burst I had those errors for int3[] float3[] int2[] and double3[], all static readonly Usage : My arrays are private readonly, initialized in a static class 'C' These private arrays are referenced in public static methods of this static class 'C' I call these static methods in a foreach job the job is in a JobComponentSystem class, private struct MyJob : IJobForEachWithEntity<X> both the static class and the system are in the same namespace and lastly, I'm using static Unity.Mathematics.math;
Congratulations! we have seen 10-100x performance improvements with burst, making our old code obsolete, thanks!