feat(rendering): pack scene dispatcher inputs
Capture immutable presentation payloads in the render scene, flatten unique entity and mesh-part records into the borrowed frame arena, and compare every routed dispatcher input tuple without changing the production draw source.
This commit is contained in:
parent
720578592b
commit
d8d9897376
13 changed files with 593 additions and 24 deletions
|
|
@ -2,6 +2,7 @@ using System.Numerics;
|
|||
using AcDream.App.Rendering;
|
||||
using AcDream.App.Rendering.Scene;
|
||||
using AcDream.Core.Selection;
|
||||
using AcDream.Core.World;
|
||||
|
||||
namespace AcDream.App.Tests.Rendering;
|
||||
|
||||
|
|
@ -26,6 +27,7 @@ public sealed class RenderFrameProductTests
|
|||
dynamic.Id,
|
||||
0,
|
||||
Matrix4x4.CreateTranslation(1, 2, 3)));
|
||||
writer.AddEntityCandidate(in dynamic, animated: true);
|
||||
writer.AddClassification(new RenderFrameClassificationRecord(
|
||||
outdoor.Id,
|
||||
0,
|
||||
|
|
@ -85,8 +87,16 @@ public sealed class RenderFrameProductTests
|
|||
1),
|
||||
view.RouteRanges[0]);
|
||||
Assert.Equal(
|
||||
new RenderFrameDiagnosticCounts(1, 2, 1, 1, 1, 1, 1, 1, 1),
|
||||
new RenderFrameDiagnosticCounts(
|
||||
1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||
view.DiagnosticCounts);
|
||||
RenderFrameEntityCandidate packed = Assert.Single(
|
||||
view.EntityCandidates.ToArray());
|
||||
Assert.Equal(dynamic.Id, packed.Projection.Id);
|
||||
Assert.True(packed.Animated);
|
||||
RenderFrameMeshPart part = Assert.Single(view.MeshParts.ToArray());
|
||||
Assert.Equal(dynamic.Id, part.ProjectionId);
|
||||
Assert.Equal(0, part.PartIndex);
|
||||
Assert.Equal(digest, view.SourceDigest);
|
||||
|
||||
exchange.Release(in view);
|
||||
|
|
@ -231,6 +241,7 @@ public sealed class RenderFrameProductTests
|
|||
record.Id,
|
||||
0,
|
||||
Matrix4x4.Identity));
|
||||
writer.AddEntityCandidate(in record, animated: false);
|
||||
writer.AddClassification(new RenderFrameClassificationRecord(
|
||||
record.Id,
|
||||
0,
|
||||
|
|
@ -277,6 +288,10 @@ public sealed class RenderFrameProductTests
|
|||
Transform = new RenderTransform(Matrix4x4.Identity),
|
||||
PreviousTransform = new PreviousRenderTransform(Matrix4x4.Identity),
|
||||
Flags = RenderProjectionFlags.Draw,
|
||||
EntityPayload = new RenderEntityPayload(
|
||||
[new MeshRef((uint)value, Matrix4x4.Identity)],
|
||||
PaletteOverride: null,
|
||||
IsBuildingShell: false),
|
||||
};
|
||||
|
||||
private static RetailSelectionMesh SelectionMesh() =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue