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
|
|
@ -0,0 +1,361 @@
|
|||
using System.Collections.Concurrent;
|
||||
using System.Runtime.CompilerServices;
|
||||
using AcDream.App.Composition;
|
||||
using AcDream.App.Rendering;
|
||||
using AcDream.App.Rendering.Wb;
|
||||
using AcDream.App.World;
|
||||
using AcDream.Content;
|
||||
using AcDream.Core.Terrain;
|
||||
using AcDream.UI.Abstractions.Settings;
|
||||
using DatReaderWriter.DBObjs;
|
||||
using Silk.NET.Input;
|
||||
using Silk.NET.OpenGL;
|
||||
using Shader = AcDream.App.Rendering.Shader;
|
||||
|
||||
namespace AcDream.App.Tests.Composition;
|
||||
|
||||
public sealed class WorldRenderCompositionTests
|
||||
{
|
||||
[Fact]
|
||||
public void SuccessPublishesExactModernFoundationInFrozenOrder()
|
||||
{
|
||||
var fixture = new Fixture();
|
||||
|
||||
WorldRenderResult result = fixture.Compose();
|
||||
|
||||
Assert.Equal(Enum.GetValues<WorldRenderCompositionPoint>(), fixture.Points);
|
||||
Assert.Same(fixture.Publication.Terrain, result.Foundation.Terrain);
|
||||
Assert.Same(fixture.Publication.MeshAdapter, result.Foundation.MeshAdapter);
|
||||
Assert.Same(fixture.Publication.TextureCache, result.Foundation.TextureCache);
|
||||
Assert.Same(fixture.Lifetime.Atlas, result.Foundation.TerrainAtlas);
|
||||
Assert.Equal(QualitySettings.From(QualityPreset.High).AnisotropicLevel,
|
||||
fixture.Factory.AnisotropicLevel);
|
||||
Assert.Equal(1, fixture.Lifetime.AcquireCalls);
|
||||
Assert.Empty(fixture.Factory.Releases);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MissingDebugFontSkipsOnlyTheOptionalHudPrefix()
|
||||
{
|
||||
var fixture = new Fixture(hasFont: false);
|
||||
|
||||
WorldRenderResult result = fixture.Compose();
|
||||
|
||||
Assert.Null(result.Foundation.DebugFont);
|
||||
Assert.Null(result.Foundation.TextRenderer);
|
||||
Assert.DoesNotContain(WorldRenderCompositionPoint.DebugFontCreated, fixture.Points);
|
||||
Assert.DoesNotContain(WorldRenderCompositionPoint.TextRendererCreated, fixture.Points);
|
||||
Assert.DoesNotContain(WorldRenderCompositionPoint.HudResourcesPublished, fixture.Points);
|
||||
Assert.Contains(WorldRenderCompositionPoint.HudResourcesCompleted, fixture.Points);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(FailurePoints))]
|
||||
public void FaultAfterEachBoundaryStopsTheExactSuffix(int pointValue)
|
||||
{
|
||||
var point = (WorldRenderCompositionPoint)pointValue;
|
||||
var fixture = new Fixture(failurePoint: point);
|
||||
|
||||
Assert.Throws<InvalidOperationException>(fixture.Compose);
|
||||
|
||||
Assert.Equal(
|
||||
Enum.GetValues<WorldRenderCompositionPoint>()
|
||||
.TakeWhile(candidate => candidate <= point),
|
||||
fixture.Points);
|
||||
}
|
||||
|
||||
public static TheoryData<int> FailurePoints()
|
||||
{
|
||||
var data = new TheoryData<int>();
|
||||
foreach (WorldRenderCompositionPoint point in
|
||||
Enum.GetValues<WorldRenderCompositionPoint>())
|
||||
{
|
||||
data.Add((int)point);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("terrain shader", "terrain shader")]
|
||||
[InlineData("scene lighting", "scene lighting")]
|
||||
[InlineData("debug lines", "debug lines")]
|
||||
[InlineData("HUD", "text renderer|debug font")]
|
||||
[InlineData("terrain", "terrain")]
|
||||
[InlineData("mesh shader", "mesh shader")]
|
||||
[InlineData("WB mesh adapter", "WB mesh adapter")]
|
||||
[InlineData("texture cache", "texture cache")]
|
||||
[InlineData("sampler cache", "sampler cache")]
|
||||
public void FailedPublicationRollsBackOnlyItsUnpublishedResourcePrefix(
|
||||
string publication,
|
||||
string expectedReleaseOrder)
|
||||
{
|
||||
var fixture = new Fixture(publicationFailure: publication);
|
||||
|
||||
Assert.Throws<InvalidOperationException>(fixture.Compose);
|
||||
|
||||
Assert.Equal(
|
||||
expectedReleaseOrder.Split('|'),
|
||||
fixture.Factory.Releases);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PartialHudConstructionRollsBackFontWhenTextCreationFails()
|
||||
{
|
||||
var fixture = new Fixture(
|
||||
failurePoint: WorldRenderCompositionPoint.DebugFontCreated);
|
||||
|
||||
Assert.Throws<InvalidOperationException>(fixture.Compose);
|
||||
|
||||
Assert.Equal(["debug font"], fixture.Factory.Releases);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GameWindowUsesPhaseAndNoLongerBuildsWorldFoundationInline()
|
||||
{
|
||||
string source = File.ReadAllText(Path.Combine(
|
||||
FindRepoRoot(),
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Rendering",
|
||||
"GameWindow.cs"));
|
||||
|
||||
Assert.Contains("new WorldRenderCompositionPhase(", source,
|
||||
StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("BindlessSupport.TryCreate(_gl", source,
|
||||
StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("_terrainModernShader = new Shader", source,
|
||||
StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("_wbMeshAdapter = new", source,
|
||||
StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("_textureCache = new TextureCache", source,
|
||||
StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private sealed class Fixture
|
||||
{
|
||||
private readonly WorldRenderCompositionPoint? _failurePoint;
|
||||
|
||||
public Fixture(
|
||||
bool hasFont = true,
|
||||
WorldRenderCompositionPoint? failurePoint = null,
|
||||
string? publicationFailure = null)
|
||||
{
|
||||
_failurePoint = failurePoint;
|
||||
Factory = new Factory(hasFont);
|
||||
Publication = new Publication(publicationFailure);
|
||||
Lifetime = new RenderLifetime(Factory.Atlas);
|
||||
var content = (ContentEffectsAudioResult)
|
||||
RuntimeHelpers.GetUninitializedObject(typeof(ContentEffectsAudioResult));
|
||||
Content = content;
|
||||
}
|
||||
|
||||
public Factory Factory { get; }
|
||||
public Publication Publication { get; }
|
||||
public RenderLifetime Lifetime { get; }
|
||||
public List<WorldRenderCompositionPoint> Points { get; } = [];
|
||||
public ContentEffectsAudioResult Content { get; }
|
||||
|
||||
public WorldRenderResult Compose() =>
|
||||
new WorldRenderCompositionPhase(
|
||||
new WorldRenderDependencies(
|
||||
new WorldEnvironmentController(),
|
||||
Lifetime,
|
||||
ImmediateGpuResourceRetirementQueue.Instance,
|
||||
0xA9B4FFFFu,
|
||||
_ => { }),
|
||||
Publication,
|
||||
Factory,
|
||||
point =>
|
||||
{
|
||||
Points.Add(point);
|
||||
if (point == _failurePoint)
|
||||
throw new InvalidOperationException($"fault at {point}");
|
||||
}).Compose(
|
||||
new GameWindowPlatformResult<GL, IInputContext>(null!, null!),
|
||||
Content,
|
||||
new SettingsDevToolsResult(
|
||||
QualitySettings.From(QualityPreset.High),
|
||||
null));
|
||||
}
|
||||
|
||||
private sealed class RenderLifetime(TerrainAtlas atlas)
|
||||
: IGameRenderResourceLifetime
|
||||
{
|
||||
public TerrainAtlas Atlas { get; } = atlas;
|
||||
public int AcquireCalls { get; private set; }
|
||||
|
||||
public TerrainAtlas AcquireTerrainAtlas(Func<TerrainAtlas> factory)
|
||||
{
|
||||
AcquireCalls++;
|
||||
return Atlas;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Factory(bool hasFont) : IWorldRenderCompositionFactory
|
||||
{
|
||||
private readonly Dictionary<IDisposable, string> _names =
|
||||
new(ReferenceEqualityComparer.Instance);
|
||||
|
||||
public TerrainAtlas Atlas { get; } = Stub<TerrainAtlas>();
|
||||
public int AnisotropicLevel { get; private set; }
|
||||
public List<string> Releases { get; } = [];
|
||||
|
||||
public void InitializeGlState(GL gl) { }
|
||||
|
||||
public WorldRegionData LoadRegion(IDatReaderWriter dats) =>
|
||||
new(Stub<Region>(), new float[256]);
|
||||
|
||||
public void InitializeEnvironment(
|
||||
WorldEnvironmentController environment,
|
||||
Region region) { }
|
||||
|
||||
public BindlessSupport RequireBindless(GL gl, Action<string> log) =>
|
||||
Stub<BindlessSupport>();
|
||||
|
||||
public TerrainAtlas AcquireTerrainAtlas(
|
||||
IGameRenderResourceLifetime lifetime,
|
||||
GL gl,
|
||||
IDatReaderWriter dats,
|
||||
BindlessSupport bindless) =>
|
||||
lifetime.AcquireTerrainAtlas(() => Atlas);
|
||||
|
||||
public void SetTerrainAnisotropic(TerrainAtlas atlas, int level) =>
|
||||
AnisotropicLevel = level;
|
||||
|
||||
public Shader CreateTerrainShader(GL gl, string shadersDirectory) =>
|
||||
Resource<Shader>("terrain shader");
|
||||
|
||||
public SceneLightingUboBinding CreateSceneLighting(GL gl) =>
|
||||
Resource<SceneLightingUboBinding>("scene lighting");
|
||||
|
||||
public DebugLineRenderer CreateDebugLines(GL gl, string shadersDirectory) =>
|
||||
Resource<DebugLineRenderer>("debug lines");
|
||||
|
||||
public byte[]? TryLoadDebugFont() => hasFont ? [1] : null;
|
||||
|
||||
public BitmapFont CreateDebugFont(GL gl, byte[] bytes) =>
|
||||
Resource<BitmapFont>("debug font");
|
||||
|
||||
public TextRenderer CreateTextRenderer(GL gl, string shadersDirectory) =>
|
||||
Resource<TextRenderer>("text renderer");
|
||||
|
||||
public TerrainModernRenderer CreateTerrain(
|
||||
GL gl,
|
||||
BindlessSupport bindless,
|
||||
Shader shader,
|
||||
TerrainAtlas atlas,
|
||||
IGpuResourceRetirementQueue retirement) =>
|
||||
Resource<TerrainModernRenderer>("terrain");
|
||||
|
||||
public WorldTerrainBuildContext CreateTerrainBuildContext(
|
||||
uint initialCenterLandblockId,
|
||||
float[] heightTable,
|
||||
TerrainAtlas atlas) =>
|
||||
new(
|
||||
initialCenterLandblockId,
|
||||
0xA9,
|
||||
0xB4,
|
||||
heightTable,
|
||||
Stub<TerrainBlendingContext>(),
|
||||
new ConcurrentDictionary<uint, SurfaceInfo>());
|
||||
|
||||
public Shader CreateMeshShader(GL gl, string shadersDirectory) =>
|
||||
Resource<Shader>("mesh shader");
|
||||
|
||||
public WbMeshAdapter CreateMeshAdapter(
|
||||
GL gl,
|
||||
IDatReaderWriter dats,
|
||||
IGpuResourceRetirementQueue retirement) =>
|
||||
Resource<WbMeshAdapter>("WB mesh adapter");
|
||||
|
||||
public TextureCache CreateTextureCache(
|
||||
GL gl,
|
||||
IDatReaderWriter dats,
|
||||
BindlessSupport bindless,
|
||||
IGpuResourceRetirementQueue retirement) =>
|
||||
Resource<TextureCache>("texture cache");
|
||||
|
||||
public SamplerCache CreateSamplerCache(GL gl) =>
|
||||
Resource<SamplerCache>("sampler cache");
|
||||
|
||||
public void Release(IDisposable resource)
|
||||
{
|
||||
Releases.Add(_names[resource]);
|
||||
}
|
||||
|
||||
private T Resource<T>(string name)
|
||||
where T : class, IDisposable
|
||||
{
|
||||
T value = Stub<T>();
|
||||
_names.Add(value, name);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Publication(string? failure) : IGameWindowWorldRenderPublication
|
||||
{
|
||||
public TerrainModernRenderer? Terrain { get; private set; }
|
||||
public WbMeshAdapter? MeshAdapter { get; private set; }
|
||||
public TextureCache? TextureCache { get; private set; }
|
||||
|
||||
public void PublishBindlessSupport(BindlessSupport value) =>
|
||||
Fail("bindless");
|
||||
public void PublishTerrainShader(Shader value) =>
|
||||
Fail("terrain shader");
|
||||
public void PublishSceneLighting(SceneLightingUboBinding value) =>
|
||||
Fail("scene lighting");
|
||||
public void PublishDebugLines(DebugLineRenderer value) =>
|
||||
Fail("debug lines");
|
||||
public void PublishHudResources(BitmapFont font, TextRenderer text) =>
|
||||
Fail("HUD");
|
||||
|
||||
public void PublishTerrain(TerrainModernRenderer value)
|
||||
{
|
||||
Fail("terrain");
|
||||
Terrain = value;
|
||||
}
|
||||
|
||||
public void PublishTerrainBuildState(
|
||||
float[] heightTable,
|
||||
TerrainBlendingContext blending,
|
||||
ConcurrentDictionary<uint, SurfaceInfo> surfaceCache) =>
|
||||
Fail("terrain build state");
|
||||
public void PublishMeshShader(Shader value) => Fail("mesh shader");
|
||||
|
||||
public void PublishWbMeshAdapter(WbMeshAdapter value)
|
||||
{
|
||||
Fail("WB mesh adapter");
|
||||
MeshAdapter = value;
|
||||
}
|
||||
|
||||
public void PublishTextureCache(TextureCache value)
|
||||
{
|
||||
Fail("texture cache");
|
||||
TextureCache = value;
|
||||
}
|
||||
|
||||
public void PublishSamplerCache(SamplerCache value) =>
|
||||
Fail("sampler cache");
|
||||
|
||||
private void Fail(string point)
|
||||
{
|
||||
if (string.Equals(failure, point, StringComparison.Ordinal))
|
||||
throw new InvalidOperationException($"publication failed at {point}");
|
||||
}
|
||||
}
|
||||
|
||||
private static T Stub<T>() where T : class =>
|
||||
(T)RuntimeHelpers.GetUninitializedObject(typeof(T));
|
||||
|
||||
private static string FindRepoRoot()
|
||||
{
|
||||
DirectoryInfo? directory = new(AppContext.BaseDirectory);
|
||||
while (directory is not null)
|
||||
{
|
||||
if (File.Exists(Path.Combine(directory.FullName, "AcDream.slnx")))
|
||||
return directory.FullName;
|
||||
directory = directory.Parent;
|
||||
}
|
||||
throw new DirectoryNotFoundException("Could not find AcDream.slnx.");
|
||||
}
|
||||
}
|
||||
|
|
@ -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();",
|
||||
|
|
|
|||
|
|
@ -29,6 +29,107 @@ public sealed class ResourceCleanupGroupTests
|
|||
Assert.Equal(["last", "middle", "first", "middle"], calls);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TransferAllLeavesPublishedResourcesUntouched()
|
||||
{
|
||||
int releaseCalls = 0;
|
||||
var resources = new ResourceCleanupGroup();
|
||||
resources.Add("published", () => releaseCalls++);
|
||||
|
||||
resources.TransferAll();
|
||||
resources.RetryCleanup();
|
||||
|
||||
Assert.True(resources.IsCleanupComplete);
|
||||
Assert.Equal(0, releaseCalls);
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
resources.Add("late", () => { }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FailedConstructionRollbackRetainsOnlyUnreleasedOwnership()
|
||||
{
|
||||
int releases = 0;
|
||||
bool releaseFails = true;
|
||||
var resources = new ResourceCleanupGroup();
|
||||
resources.Add("retryable", () =>
|
||||
{
|
||||
releases++;
|
||||
if (releaseFails)
|
||||
throw new InvalidOperationException("release failed");
|
||||
});
|
||||
|
||||
GlResourceConstructionException failure =
|
||||
Assert.Throws<GlResourceConstructionException>(() =>
|
||||
resources.RollbackConstructionAndThrow(
|
||||
"construction failed",
|
||||
new InvalidOperationException("original failure")));
|
||||
|
||||
Assert.False(failure.IsCleanupComplete);
|
||||
Assert.Equal(1, releases);
|
||||
releaseFails = false;
|
||||
failure.RetryCleanup();
|
||||
failure.RetryCleanup();
|
||||
|
||||
Assert.True(failure.IsCleanupComplete);
|
||||
Assert.Equal(2, releases);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WorldRenderFoundationConstructorsPublishEveryOwnedPrefix()
|
||||
{
|
||||
string root = FindRepoRoot();
|
||||
string graphicsDevice = File.ReadAllText(Path.Combine(
|
||||
root,
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Rendering",
|
||||
"Wb",
|
||||
"OpenGLGraphicsDevice.cs"));
|
||||
string shader = File.ReadAllText(Path.Combine(
|
||||
root,
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Rendering",
|
||||
"Wb",
|
||||
"GLSLShader.cs"));
|
||||
string uniformBuffer = File.ReadAllText(Path.Combine(
|
||||
root,
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Rendering",
|
||||
"Wb",
|
||||
"ManagedGLUniformBuffer.cs"));
|
||||
|
||||
AssertAppearsInOrder(
|
||||
graphicsDevice,
|
||||
"var resources = new ResourceCleanupGroup();",
|
||||
"InstanceVBO = CreateConstructionBuffer(resources",
|
||||
"WrapSampler = CreateConstructionSampler(",
|
||||
"ClampSampler = CreateConstructionSampler(",
|
||||
"_sceneDataBuffer = new ManagedGLUniformBuffer(",
|
||||
"resources.Add(",
|
||||
"\"WB scene-data uniform buffer\"",
|
||||
"InitializeSharedDebugResources(resources);",
|
||||
"resources.TransferAll();",
|
||||
"resources.RollbackConstructionAndThrow(");
|
||||
AssertAppearsInOrder(
|
||||
shader,
|
||||
"ShaderProgramConstruction.Build(",
|
||||
"resources.Add(\"WB shader program\"",
|
||||
"configure shader {Name} SceneData binding",
|
||||
"resources.TransferAll();",
|
||||
"resources.RollbackConstructionAndThrow(");
|
||||
AssertAppearsInOrder(
|
||||
uniformBuffer,
|
||||
"TrackedGlResource.CreateBuffer(",
|
||||
"resources.Add(",
|
||||
"TrackedGlResource.AllocateBufferStorage(",
|
||||
"resources.TransferAll();",
|
||||
"resources.RollbackConstructionAndThrow(");
|
||||
Assert.Contains("internal void DisposeImmediately()", uniformBuffer,
|
||||
StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TextRendererPublishesEveryConstructorResourceBeforeLaterGlWork()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue