Files
VoxelEngine/World/Streaming/ChunkJob.cs
MDietermann 34f923cbca refactor: store-owned diff snapshot and drop dead ChunkJob.ExistingChunk
TryGetDiff now returns an independent copy so callers can safely retain the
reference; removes the defensive copy from ChunkStreamer.DispatchLoad.
ChunkJob.ExistingChunk was never populated (DispatchRemesh uses closures
instead), so the field is removed along with its misleading record-level
comment.
2026-06-01 13:31:05 +02:00

22 lines
732 B
C#

using OpenTK.Mathematics;
using VoxelEngine.World.Chunk;
namespace VoxelEngine.World.Streaming;
// Job dispatched to an IJobExecutor for a fresh chunk load. The worker
// generates the chunk, applies any modification diff, and meshes the result.
// Remesh-only jobs are dispatched separately by DispatchRemesh and capture
// their state via closures, so they do not use this record.
internal sealed record ChunkJob(
Vector3i Pos,
NeighborSnapshots Neighbors,
IReadOnlyDictionary<int, ushort>? Diff);
// Posted by the worker back to the main thread via a ConcurrentQueue.
internal sealed record ChunkJobResult(
Vector3i Pos,
Chunk.Chunk? Chunk,
float[]? Mesh,
Exception? Error,
bool IsRemeshOnly);