From cb4ce0276e6d25cd787fcec52fcbd93914a809bf Mon Sep 17 00:00:00 2001 From: routersys Date: Sat, 3 Oct 2026 17:05:35 +0900 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=AD=90=E3=81=AE=E8=B3=87=E6=BA=90?= =?UTF-8?q?=E3=81=8C=E5=9B=9E=E5=8F=8E=E3=81=95=E3=82=8C=E3=81=9F=E5=BE=8C?= =?UTF-8?q?=E3=81=AB=E8=A8=88=E7=AE=97=E3=81=97=E7=9B=B4=E3=81=99=E8=A9=A6?= =?UTF-8?q?=E9=A8=93=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CrystallineGrowthPipelineTests.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CrystallineGrowth.Tests/CrystallineGrowthPipelineTests.cs b/CrystallineGrowth.Tests/CrystallineGrowthPipelineTests.cs index 146ebeb..cc15baf 100644 --- a/CrystallineGrowth.Tests/CrystallineGrowthPipelineTests.cs +++ b/CrystallineGrowth.Tests/CrystallineGrowthPipelineTests.cs @@ -201,6 +201,25 @@ public sealed class CrystallineGrowthPipelineTests Assert.Equal(expected, reused); } + [Fact] + public void AReclaimedGridIsSimulatedAgain() + { + using var pipeline = CreatePipeline(); + var parameters = Parameters(); + var device = GraphicsDevice.GetDefault(); + using var texture = device.AllocateReadWriteTexture2D(64, 64); + Upload(texture, Square(64, 64, 16, 16, 32, 32)); + + var first = pipeline.Simulate(texture, 64, 64, 0, 0, 64, 64, in parameters, hashSource: true); + var repeated = pipeline.Simulate(texture, 64, 64, 0, 0, 64, 64, in parameters, hashSource: true); + device.TrimMemory(); + var reclaimed = pipeline.Simulate(texture, 64, 64, 0, 0, 64, 64, in parameters, hashSource: true); + + Assert.True(first); + Assert.False(repeated); + Assert.True(reclaimed); + } + [Fact] public void AWarmPipelineAllocatesNoManagedMemory() {