Inside a burst job, drawing a WireCylinder results in an error:
(0,0): Burst error BC1015: Attempting to call a [BurstDiscard] method that returns a value
Drawing.CommandBuilder.WithMatrix(Drawing.CommandBuilder* this, UnityEngine.Matrix4x4 matrix)` is not supported
Other primitives can be drawn without issue (WireSphere, WireBox etc.)
Oops, sorry. That was my fault. I used a using statement in the code which is not supported by burst.
A fix will be included in the next version. It was a quick fix of just replacing the WithMatrix call with PushMatrix and PopMatrix.
I tried to replace those calls, and use the math libraries float4x4 matrices.
Now the drawing works correctly, but other parts of the builder are throwing exceptions:
CommandBuilder.cs(2307,3): Burst error BC1360: A static constructor on type `Drawing.CommandBuilder` is mixing managed and unmanaged code which is not supported. In order to solve this, please move the managed code or unmanaged code to a different class/struct
I think there are coming from the strings used on the following static variables:
I just update my projects to the latest 1.0.0-pre.15 releases of ECS and dots, and the burst compile error is back.
Burst error BC1015: Attempting to call a [BurstDiscard] method that returns a value `Drawing.CommandBuilder.WithLineWidth(Drawing.CommandBuilder* this, float pixels, bool automaticJoins)` is not supported
I tried to use the builder in both an ISystem and SystemBase but it leads to the same burst compile error.
It’s most likely due to the [BurstDiscard] call on the WithLineWidth method, is there a burst-compatible version of it?
Ok just needed to replace the WithLineWidth call with PushLineWidth and it working now.