feat: add streaming primitives (IChunkRenderer, IJobExecutor, NeighborSnapshots, ChunkJob)
This commit is contained in:
21
World/Streaming/ChunkJob.cs
Normal file
21
World/Streaming/ChunkJob.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user