22 lines
708 B
C#
22 lines
708 B
C#
using OpenTK.Mathematics;
|
|
using VoxelEngine.World.Chunk;
|
|
|
|
namespace VoxelEngine.World.Streaming;
|
|
|
|
// Job dispatched to an IJobExecutor. For a fresh load, ExistingChunk is null
|
|
// and the worker generates + applies diff + meshes. For a remesh-only job,
|
|
// ExistingChunk holds the chunk and the worker only meshes (no generation).
|
|
internal sealed record ChunkJob(
|
|
Vector3i Pos,
|
|
Chunk.Chunk? ExistingChunk,
|
|
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);
|