Vixen
dd8b0a81
csharp
public sealed class Chunk

One block of entities that all have exactly the same components, stored column by column.

Read the guide page for this →

Remarks

Sixteen kilobytes by default, which is what fits comfortably in L1 on every target after the entity column is accounted for, and what Arch and DOTS both converged on. A system that reads two of an archetype's eight components touches only those two columns, so the bytes the cache pulls in are bytes the loop uses — which is the entire reason this layout exists.

The whole chunk is one byte[]: the entity column first, then one column per non-tag component, each aligned. Tags occupy no column, only a bit in the archetype's mask.

Fields and properties (5)

  • public Archetype Archetype

    The archetype every entity in here belongs to.

  • public int Count

    How many entities are in the chunk.

  • public int Capacity

    How many it has room for.

  • public bool IsFull

    Whether there is no room for another entity.

  • public ReadOnlySpan<Entity> Entities

    The entities in the chunk, in row order.

Methods (3)

  • public Span<T> Values<T>()

    One component's values for every entity in this chunk, for writing. Marks the column changed at the world's current version.

  • public ReadOnlySpan<T> ReadValues<T>()

    One component's values for every entity in this chunk, for reading.

  • public uint VersionOf(int column)

    The version at which a column was last handed out for writing.

Used by (102, showing 40)

  • ArenaThirdPersonShooter
  • GameClientMultiplayer
  • OrbitSystemEcsStressTest
  • SliceResolverNetworkSoak
  • ThirdPersonShooterGameThirdPersonShooter
  • ConstraintStageBenchmarksVixen.Benchmarks.Animation
  • WorldBenchmarksVixen.Benchmarks.Ecs
  • AiGameplayDebuggerVixen.Ai.Diagnostics
  • AiSchedulingTestsVixen.Ai.Tests
  • AiSystemVixen.Ai
  • AllNetworkedSourceVixen.Net
  • AnimationSystemVixen.Animation
  • ArchetypeVixen.Ecs
  • AudioSystemVixen.Audio
  • BlendShapeAnimationSystemVixen.Animation
  • BuoyancyDebugDrawVixen.Water.Physics
  • BuoyancySystemVixen.Water.Physics
  • CameraDirectorSystemVixen.Engine
  • CameraExtractionSystemVixen.Rendering
  • CentreSensorVixen.Ai.Nodes
  • ClientPredictionVixen.Net
  • CommandBufferTestsVixen.Ecs.Tests
  • ConstraintGizmoSystemVixen.Animation
  • CountSensorVixen.Ai.Nodes
  • EntityGeneratorVixen.Ai.Nodes
  • EntityInfoVixen.Ecs
  • EnumeratorVixen.Ecs
  • FleetVixen.Ai.Tests
  • FoliageBlockersVixen.Rendering.Terrain
  • InferredChunkSystemVixen.Engine.Tests
  • InferredFilteredSystemVixen.Engine.Tests
  • InterestGridVixen.Net
  • LagCompensationSystemVixen.Net.Physics
  • LightExtractionSystemVixen.Rendering
  • LocalPlayerSystemVixen.Net.Engine
  • LodExtractionSystemVixen.Engine.Renderer
  • MeshExtractionSystemVixen.Rendering
  • MorphWeightSystemVixen.Rendering
  • NavigationSystemVixen.Navigation
  • NearestSensorVixen.Ai.Nodes