#Entities.Graphics Skinned jobs missing [BurstCompile]

1 messages · Page 1 of 1 (latest)

full path
#

PushSkinMatrixSystem seems to be missing [BurstCompile] on it's jobs?

#
        [WithAll(typeof(SharedMeshTracker))]
        partial struct ConstructHashMapJob : IJobEntity
        {
            public NativeParallelMultiHashMap<Entity, int>.ParallelWriter DeformedEntityToComputeIndexParallel;

            private void Execute(in SkinMatrixBufferIndex index, in DeformedEntity deformedEntity)
            {
                // Skip if we have an invalid index.
                if (index.Value == SkinMatrixBufferIndex.Null)
                    return;

                DeformedEntityToComputeIndexParallel.Add(deformedEntity.Value, index.Value);
            }
        }

        partial struct CopySkinMatricesToGPUJob : IJobEntity
        {
            [ReadOnly] public NativeParallelMultiHashMap<Entity, int> DeformedEntityToComputeIndex;
            [NativeDisableContainerSafetyRestriction] public NativeArray<float3x4> SkinMatricesBuffer;

            private void Execute(in DynamicBuffer<SkinMatrix> skinMatrices, in Entity entity)
            {
                // Not all deformed entities in the world will have a renderer attached to them.
                if (!DeformedEntityToComputeIndex.ContainsKey(entity))
                    return;

                long length = (long)skinMatrices.Length * UnsafeUtility.SizeOf<float3x4>();
                var indices = DeformedEntityToComputeIndex.GetValuesForKey(entity);

                foreach (var index in indices)
                {
                    unsafe
                    {
                        UnsafeUtility.MemCpy(
                            (float3x4*)SkinMatricesBuffer.GetUnsafePtr() + index,
                            skinMatrices.GetUnsafeReadOnlyPtr(),
                            length
                        );
                    }
                }
            }
        }```
#

i don't see anything in here that would stop this burst compiling

#

yeah burst compiles fine (improvement but still pretty slow)

compact cloud
#

It is "experimental". Skinned mesh renderer system has several flaws currently:

  • All skinned mesh vertices reside in separate big compute buffer. And when this buffer size comes to its hardware limit you will have driver crashes, slowdowns, visual glitches, other funny things.
  • Burst occlustion culling is not supported (experimental not supported in experimental :))
full path
#

Oh I totally get it's experimental etc, but it just seems to miss the attribute 🙃

compact cloud
#

Just to compare. 50000 skinned mesh renderers:

torn iron
#

I see the [BurstCompile] attribute on these jobs in our Entities 1.1 branch; maybe it was missing in 1.0.x, but it should be fixed going forward.