refactor(app): compose world rendering startup
Move Region/environment, mandatory modern rendering, terrain, WB, texture, and sampler construction behind the typed Phase-4 composition boundary. Give every fallible GL constructor prefix retryable ownership so partial startup failure cannot leak or replay resource deletion while preserving the accepted render path and DAT inputs. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
cd7b519f78
commit
6a2fe98cc4
22 changed files with 1983 additions and 634 deletions
|
|
@ -120,12 +120,30 @@ public sealed class GameWindowSlice8BoundaryTests
|
|||
string sessionFactory = MethodBody(
|
||||
"private AcDream.App.Net.LiveSessionEventRouter CreateLiveSessionEventRouter(",
|
||||
"private AcDream.App.Net.LiveInventorySessionBindings");
|
||||
string worldPhase = File.ReadAllText(Path.Combine(
|
||||
FindRepoRoot(),
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Composition",
|
||||
"WorldRenderComposition.cs"));
|
||||
|
||||
Assert.Contains(
|
||||
"private readonly AcDream.App.World.WorldEnvironmentController _worldEnvironment =",
|
||||
source,
|
||||
StringComparison.Ordinal);
|
||||
Assert.Contains("_worldEnvironment.Initialize(region!);", load, StringComparison.Ordinal);
|
||||
Assert.Contains(
|
||||
"new WorldRenderDependencies(\n _worldEnvironment,",
|
||||
load.Replace("\r\n", "\n", StringComparison.Ordinal),
|
||||
StringComparison.Ordinal);
|
||||
string worldCompose = Slice(
|
||||
worldPhase,
|
||||
"public WorldRenderResult Compose(",
|
||||
"private (BitmapFont? Font, TextRenderer? Text) ComposeOptionalHudResources(");
|
||||
AssertAppearsInOrder(
|
||||
worldCompose,
|
||||
"WorldRegionData region = _factory.LoadRegion(content.Dats);",
|
||||
"_factory.InitializeEnvironment(_dependencies.Environment, region.Region);");
|
||||
Assert.Contains("environment.Initialize(region);", worldPhase, StringComparison.Ordinal);
|
||||
AssertAppearsInOrder(
|
||||
sessionFactory,
|
||||
"new AcDream.App.Net.LiveEnvironmentSessionSink(",
|
||||
|
|
@ -278,7 +296,7 @@ public sealed class GameWindowSlice8BoundaryTests
|
|||
load,
|
||||
"new SettingsDevToolsCompositionPhase(",
|
||||
"this).Compose(platform, hostInputCamera, contentEffectsAudio);",
|
||||
"TerrainAtlas.Build(",
|
||||
"new WorldRenderCompositionPhase(",
|
||||
"_runtimeSettings.BindRuntimeTargets(",
|
||||
"_liveSessionHost.Start(_options)");
|
||||
string settingsPhase = File.ReadAllText(Path.Combine(
|
||||
|
|
@ -291,6 +309,17 @@ public sealed class GameWindowSlice8BoundaryTests
|
|||
settingsPhase,
|
||||
"_dependencies.Settings.ApplyStartup(_dependencies.StartupTarget);",
|
||||
"_dependencies.DevTools is { } optional");
|
||||
string worldPhase = File.ReadAllText(Path.Combine(
|
||||
FindRepoRoot(),
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Composition",
|
||||
"WorldRenderComposition.cs"));
|
||||
AssertAppearsInOrder(
|
||||
worldPhase,
|
||||
"TerrainAtlas.Build(gl, dats, bindless)",
|
||||
"settings.ResolvedQuality.AnisotropicLevel",
|
||||
"_factory.CreateTerrain(");
|
||||
AssertAppearsInOrder(
|
||||
shutdown,
|
||||
"_runtimeSettings.UnbindViewModel()",
|
||||
|
|
@ -440,17 +469,28 @@ public sealed class GameWindowSlice8BoundaryTests
|
|||
"AcDream.App",
|
||||
"Rendering",
|
||||
"TerrainAtlas.cs"));
|
||||
string worldPhase = File.ReadAllText(Path.Combine(
|
||||
FindRepoRoot(),
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Composition",
|
||||
"WorldRenderComposition.cs"));
|
||||
|
||||
AssertAppearsInOrder(
|
||||
load,
|
||||
"_renderResourceLifetime.AcquireTerrainAtlas(",
|
||||
"_terrain = new TerrainModernRenderer(",
|
||||
"new WorldRenderCompositionPhase(",
|
||||
"_portalTunnelFallback.AcquirePrepared(",
|
||||
"static portalTunnel => portalTunnel.PrepareResources());",
|
||||
"_renderResourceLifetime.AcquireSkyShader(",
|
||||
"_skyRenderer = new AcDream.App.Rendering.Sky.SkyRenderer(",
|
||||
"_portalTunnelFallback.Transfer(",
|
||||
"_frameGraphs.Publish(updateFrameOrchestrator, renderFrameOrchestrator);");
|
||||
AssertAppearsInOrder(
|
||||
worldPhase,
|
||||
"lifetime.AcquireTerrainAtlas(",
|
||||
"TerrainAtlas.Build(gl, dats, bindless)",
|
||||
"TerrainModernRenderer CreateTerrain(",
|
||||
"TerrainModernRenderer terrain = AcquireAndPublish(");
|
||||
AssertAppearsInOrder(
|
||||
shutdown,
|
||||
"_frameGraphs.Withdraw();",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue