Job structs can’t contain managed types like string
, class
instances, or delegates. This is currently a pain as a lot of the Unity API relies on these and so we’re forced to deal with them. Today we’ll talk about how we can use managed types in our jobs to bridge the gap.
Posts Tagged burst
A couple years ago, I wrote an article showing how to empower game designers with the ability to write simple formulas like PlayerLevel*100+100
. These are much more useful than just constants and don’t require any of the complexity of a real programming language. Today we’ll bring it into the Burst-compatible world and also improve its ability to handle more complex formulas.
Many algorithms get used over and over: searching, sorting, filtering, etc. C# makes these available with LINQ and functions like Array.Sort
, but these can’t be compiled by Burst because interfaces and delegates aren’t supported. So how do we implement these generic algorithms to avoid re-writing them over and over? Today we’ll explore one technique to solve this problem. Read on to learn how!
A reader recently asked what the fastest way to take an absolute value was. It occurred to me that there are a lot of ways to do this in Unity! So today we’ll try them all out and see which is best.
Calling into native code like C++ from C# is a powerful interoperability tool in Unity. As we move more and more code out of Mono and IL2CPP and into Burst, will we still have this tool available? Today we’ll find out!
Tuples are a new feature in C# 7 and they’re backed by the ValueTuple
struct, not class. Hopefully they’ll be supported by Burst, so let’s try them out!
Today we go back to basics and see how Burst compiles some fundamental language features: switch
statements and ref
parameters… with surprising results!
Burst 1.0.1 is a patch-level update to the original 1.0.0 release, but it actually contains a useful new feature: we’re now able to force methods to be inlined. Read on to see how!
We’ve seen how to add unions to C#, but does this work with the new Burst compiler? Today we’ll put it to the test and see if it can handle some of the more advanced struct customization features in C#!
Assertions are an incredibly handy tool, but do they work in Burst-compiled jobs? Today we’ll find out!