feat(A.5 T7): LandblockStreamResult.Loaded.Tier+MeshData; Promoted variant
Extends the Loaded result record with a LandblockStreamTier discriminator and a LandblockMeshData payload (default! stub — T13 wires the real off-thread mesh build). Adds the Promoted variant for Far→Near upgrades that only need the entity layer, not a mesh rebuild. LandblockStreamer.HandleJob passes Tier.Near + default! MeshData at the existing synchronous load site; StreamingControllerTests updated to match the new positional signature. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1658882439
commit
295bce9bb2
3 changed files with 31 additions and 3 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using AcDream.Core.Terrain;
|
||||
using AcDream.Core.World;
|
||||
|
||||
namespace AcDream.App.Streaming;
|
||||
|
|
@ -22,7 +24,29 @@ public abstract record LandblockStreamJob(uint LandblockId)
|
|||
/// </summary>
|
||||
public abstract record LandblockStreamResult(uint LandblockId)
|
||||
{
|
||||
public sealed record Loaded(uint LandblockId, LoadedLandblock Landblock) : LandblockStreamResult(LandblockId);
|
||||
/// <summary>
|
||||
/// A landblock load completed. <see cref="Tier"/> distinguishes Far
|
||||
/// (terrain only) from Near (terrain + entities). <see cref="MeshData"/>
|
||||
/// is built off the render thread on the streaming worker.
|
||||
/// </summary>
|
||||
public sealed record Loaded(
|
||||
uint LandblockId,
|
||||
LandblockStreamTier Tier,
|
||||
LoadedLandblock Landblock,
|
||||
LandblockMeshData MeshData
|
||||
) : LandblockStreamResult(LandblockId);
|
||||
|
||||
/// <summary>
|
||||
/// A previously-Far-resident landblock was promoted to Near. Terrain
|
||||
/// mesh is already on the GPU; the result carries the entity layer
|
||||
/// (stabs, buildings, scenery) to merge into the existing GpuWorldState
|
||||
/// entry.
|
||||
/// </summary>
|
||||
public sealed record Promoted(
|
||||
uint LandblockId,
|
||||
IReadOnlyList<WorldEntity> Entities
|
||||
) : LandblockStreamResult(LandblockId);
|
||||
|
||||
public sealed record Failed(uint LandblockId, string Error) : LandblockStreamResult(LandblockId);
|
||||
public sealed record Unloaded(uint LandblockId) : LandblockStreamResult(LandblockId);
|
||||
|
||||
|
|
|
|||
|
|
@ -169,8 +169,12 @@ public sealed class LandblockStreamer : IDisposable
|
|||
_outbox.Writer.TryWrite(new LandblockStreamResult.Failed(
|
||||
load.LandblockId, "LandblockLoader.Load returned null"));
|
||||
else
|
||||
// TEMPORARY: passes default! for MeshData — Task 13 wires the real mesh build.
|
||||
_outbox.Writer.TryWrite(new LandblockStreamResult.Loaded(
|
||||
load.LandblockId, lb));
|
||||
load.LandblockId,
|
||||
LandblockStreamTier.Near,
|
||||
lb,
|
||||
MeshData: default! /* TODO(A.5 T13) */));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue