Search Issue Tracker
Fixed
Fixed in 1.8.17
Votes
0
Found in [Package]
1.8.10
1.8.13
1.8.16
Issue ID
BUR-2718
Regression
No
"Burst error BC1042: The managed class type `System.IntPtr` is not supported" error is thrown when calling OverlapSphereCommand.ScheduleBatch
Reproduction steps:
1. Open the “ReproProject“ project
2. Observe the Console window
Expected result: No errors are thrown in the Console window
Actual result: “(0,0): Burst error BC1042: The managed class type `System.IntPtr` is not supported.“ error is thrown in the Console window
Reproducible with: 1.8.10, 1.8.13, 1.8.16 (2022.3.35f1, 6000.0.8f1)
Reproducible on: Windows 11 Pro (22H2)
Not reproducible on: No other environment tested
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [SpeedTree] Wireframe mode not rendering correctly ST assets
- Light2D affecting only the Default Sorting Layer will also affect any Custom Lit Sprite not on that Layer when using Render Graph
- Decals do not get projected onto a GameObject draw with the Render Objects Renderer Feature when according to Event it should be projected
- The Depth value is not being written correctly in the Scene view when the Full Screen Pass Renderer Feature is applied on a GameObject with the Render Object Feature
- [Quest] Materials are not rendering in Player when "Single Pass Instanced \ Multi-View" is selected and "Surface Type" is set to "Transparent"
Resolution Note (fix version 1.8.17):
The code in the repro project calls {{OverlapSphereCommand.ScheduleBatch}}, which contains some code that is incompatible with Burst. Specifically, there is code that loads from a non-readonly static field. That's why Burst emits a compilation error... however, the specific compilation error emitted was incorrect.
The error was:
Burst error BC1042: The managed class type `System.IntPtr` is not supported. Loading from a non-readonly static field `Unity.Jobs.LowLevel.Unsafe.BatchQueryJobStruct`1<Unity.Jobs.LowLevel.Unsafe.BatchQueryJob`2<UnityEngine.OverlapSphereCommand,UnityEngine.ColliderHit>>.jobReflectionData` is not supported
The first part is incorrect (managed class type...). The second part is the "correct" error message (non-readonly static field is not supported). So we've improved the error message to be more correct and less misleading. It's now:
Burst error BC1040: Loading from a non-readonly static field `Unity.Jobs.LowLevel.Unsafe.BatchQueryJobStruct`1<Unity.Jobs.LowLevel.Unsafe.BatchQueryJob`2<UnityEngine.OverlapSphereCommand,UnityEngine.ColliderHit>>.jobReflectionData` is not supported