Burst error adding component FrozenRenderSceneTag

I’m seeing the burst error: ```Unable to access the managed method object.Equals(object) from type `Unity.Rendering.FrozenRenderSceneTag````

In a job, I’m running: commandBuffer.AddSharedComponent<FrozenRenderSceneTag>(entityInQueryIndex, entity, frozenTag);

frozenTag is a local variable. If I add .WithoutBurst() to the Entities.ForEach, then it doesn’t give an error.

Is this a known issue or something I’m not doing correctly?

Complete error message:
Error Message

E:\data\UnityProjects\TestECS\Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities\Types\TypeManager.cs(1000,17): Burst error BC1001: Unable to access the managed method object.Equals(object) from type Unity.Rendering.FrozenRenderSceneTag

at Unity.Entities.TypeManager.Equals(ref Unity.Rendering.FrozenRenderSceneTag left, ref Unity.Rendering.FrozenRenderSceneTag right) (at E:\data\UnityProjects\TestECS\Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities\Types\TypeManager.cs:996)
at Unity.Entities.EntityCommandBuffer.IsDefaultObject(ref Unity.Rendering.FrozenRenderSceneTag component, ref int hashCode) (at E:\data\UnityProjects\TestECS\Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities\EntityCommandBuffer.cs:1055)
at Unity.Entities.EntityCommandBuffer.Concurrent.AddSharedComponent(Unity.Entities.EntityCommandBuffer.Concurrent* this, int jobIndex, Unity.Entities.Entity e, Unity.Rendering.FrozenRenderSceneTag component) (at E:\data\UnityProjects\TestECS\Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities\EntityCommandBuffer.cs:1813)
at AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0.OriginalLambdaBody(AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0* this, Unity.Entities.Entity entity, int entityInQueryIndex, ref Unity.Transforms.Translation pos) (at E:\data\UnityProjects\TestECS\Assets\TestReZeroing\Scripts\AvoiderSystem.cs:44)
at AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0.IterateEntities(AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0* this, ref Unity.Entities.ArchetypeChunk chunk, ref AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0.LambdaParameterValueProviders.Runtimes runtimes)
at AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0.Execute(AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0* this, Unity.Entities.ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
at Unity.Entities.JobChunkExtensions.JobChunk_Process1<AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0>.ExecuteInternal(ref Unity.Entities.JobChunkExtensions.JobChunkData1<AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0> jobData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) (at E:\data\UnityProjects\TestECS\Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities\IJobChunk.cs:203)
at Unity.Entities.JobChunkExtensions.JobChunk_Process1<AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0>.Execute(ref Unity.Entities.JobChunkExtensions.JobChunkData1<AvoiderSystem.<>c__DisplayClass_OnUpdate_LambdaJob0> jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) (at E:\data\UnityProjects\TestECS\Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities\IJobChunk.cs:193)

While compiling job: System.Void Unity.Entities.JobChunkExtensions/JobChunk_Process1<AvoiderSystem/<>c__DisplayClass_OnUpdate_LambdaJob0>::Execute(Unity.Entities.JobChunkExtensions/JobChunkData1&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)

1 Like

Getting the same :frowning: I was trying to use it to make a primitive render culling system but since it cant be burstable its basically useless as it takes too much time, i wonder if anyone was able to make a render culling system

Same here. I’ve been using FrozenSceneRenderTag to tag procgen RenderMesh entities as “static”.

var id = new uint4(1, 0, 0, 0);
ecb.AddSharedComponent<FrozenRenderSceneTag>(entityInQueryIndex, meshEntity, new FrozenRenderSceneTag() { SceneGUID = new Hash128 { Value = id } });
ecb.AddComponent<PerInstanceCullingTag>(entityInQueryIndex, meshEntity);
client/Library/PackageCache/com.unity.entities@0.10.0-preview.6/Unity.Entities/Types/TypeManager.cs(627,17): Burst error BC1001: Unable to access the managed method `object.Equals(object)` from type `Unity.Rendering.FrozenRenderSceneTag`

Hybrid Renderer 0.5.0-preview6 and entities 0.10.0-preview.6.

This is a problem in entities/AddSharedCompponent that does not support Burst currently. The underlying code is relying on Equals(object) while it should rely on IEquatable<T>.Equals(T) in order to be compatible with Burst.

6 Likes

Does that mean we can expect a future Entities package update will change this as you suggest, and in the meantime, we should use .WithoutBurst() for the jobs using AddSharedComponent? Thank you.

Running in this issue as well. A fix would be nice.

Yes. We’ll ping this thread again when the fix has been merged.

6 Likes

Given I just ran into this same bug month later, I’m guessing it’s still not fixed?

i’m also encountering this issue

Same issue here in 0.16

Has a fix been merged?