7 コミット
作成者 SHA1 メッセージ 日付
routersys 36293e28e6 バージョンをv1.1.3へ更新する
リリース / build-and-release (workflow_dispatch) Actions がタグ v1.1.3 のコミットから作成しました
2026-10-03 17:22:47 +09:00
routersys cb4ce0276e 格子の資源が回収された後に計算し直す試験を追加する 2026-10-03 17:05:35 +09:00
routersys f322f174b7 資源が回収された後の処理器の描画の試験を追加する 2026-10-03 16:58:01 +09:00
routersys 0ef3ada3ec 格子の資源が回収された後の描画の試験を追加する 2026-10-03 16:58:01 +09:00
routersys 6386c5b4de 回収された格子の資源を描画の前に作り直す
・GPUのメモリが逼迫して資源が回収された後に、描画が失敗し続ける不具合を修正-F
2026-10-03 16:58:00 +09:00
routersys 4c93f2ee33 バージョンをv1.1.2へ更新する
リリース / build-and-release (workflow_dispatch) Actions がタグ v1.1.2 のコミットから作成しました
2026-09-29 15:37:38 +09:00
routersys ff008e6ce2 素材の色のハッシュを取る範囲をスレッドグループの倍数に切り上げる
・幅か高さが8の倍数でない素材を同じ設定のまま続けて描くと例外が出る不具合を修正-F
2026-09-29 15:33:14 +09:00
6個のファイルの変更、124行の追加、7行の削除

検索条件に一致するファイルはありません

+1 -1
ファイルの表示
@@ -1,5 +1,5 @@
========================================
氷晶成長 for YMM4 v1.1.1
氷晶成長 for YMM4 v1.1.3
========================================
YukkuriMovieMaker4上で動作する、素材の縁を結晶の核とみなし、
Gravner–Griffeathの雪結晶成長モデルで氷晶を成長させて霜として描画する
+43
ファイルの表示
@@ -250,6 +250,25 @@ public sealed class CrystallineGrowthEffectProcessorTests
Assert.True(first.SamePixelsAs(again));
}
[Theory]
[InlineData(60, 64)]
[InlineData(64, 36)]
public void AnImageOfAnySizeIsDrawnTheSameOnTheNextFrame(int width, int height)
{
using var devices = new GraphicsDevices();
using var context = devices.CreateContext();
RequireInterop(context);
using var source = SourceImage.Solid(context, width, height, Gray);
using var processor = new CrystallineGrowthEffect().CreateVideoEffect(context);
processor.SetInput(source.Bitmap);
var first = RenderFrame(context, processor, 0);
var next = RenderFrame(context, processor, 1);
Assert.True(HasFrostOutside(first, source));
Assert.True(first.SamePixelsAs(next));
}
[Fact]
public void ANewProcessorDrawsTheSameFrost()
{
@@ -490,6 +509,30 @@ public sealed class CrystallineGrowthEffectProcessorTests
}
}
[Fact(Timeout = 60000)]
public async Task AProcessorDrawsLikeAFreshOneAfterTheDeviceReclaimsIdleMemory()
{
await Task.Run(() =>
{
using var devices = new GraphicsDevices();
using var context = devices.CreateContext();
RequireInterop(context);
using var source = new SourceImage(context, Size, Size, (x, y) => x is >= 16 and < 48 && y is >= 16 and < 48 ? Bgra.Opaque(80, 200, 255) : Bgra.Transparent);
var effect = new CrystallineGrowthEffect();
using var processor = effect.CreateVideoEffect(context);
processor.SetInput(source.Bitmap);
RenderFrame(context, processor, 0);
GraphicsDevice.GetDefault().TrimMemory();
var reclaimed = RenderFrame(context, processor, 0);
using var fresh = effect.CreateVideoEffect(context);
fresh.SetInput(source.Bitmap);
var expected = RenderFrame(context, fresh, 0);
Assert.True(reclaimed.SamePixelsAs(expected));
}, TestContext.Current.CancellationToken);
}
[Fact]
public void AFailureWhileUpdatingIsNotSwallowed()
{
+59
ファイルの表示
@@ -185,6 +185,41 @@ public sealed class CrystallineGrowthPipelineTests
Assert.True(shortReach <= 80 + 32 + 12 + 8);
}
[Fact]
public void APipelineWhoseGridWasReclaimedDrawsLikeAFreshOne()
{
using var pipeline = CreatePipeline();
using var fresh = CreatePipeline();
var source = Square(64, 64, 16, 16, 32, 32);
var parameters = Parameters();
Render(pipeline, source, 64, 64, parameters);
GraphicsDevice.GetDefault().TrimMemory();
var reused = Render(pipeline, source, 64, 64, parameters);
var expected = Render(fresh, source, 64, 64, parameters);
Assert.Equal(expected, reused);
}
[Fact]
public void AReclaimedGridIsSimulatedAgain()
{
using var pipeline = CreatePipeline();
var parameters = Parameters();
var device = GraphicsDevice.GetDefault();
using var texture = device.AllocateReadWriteTexture2D<Bgra32, Float4>(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()
{
@@ -449,6 +484,30 @@ public sealed class CrystallineGrowthPipelineTests
Assert.Null(pipeline.SourceHash);
}
[Theory]
[InlineData(100, 64)]
[InlineData(64, 60)]
public void RecoloringOnlyTheLastPixelChangesTheSourceHashAtAnySize(int width, int height)
{
using var pipeline = CreatePipeline();
var device = GraphicsDevice.GetDefault();
using var sourceTexture = device.AllocateReadWriteTexture2D<Bgra32, Float4>(width, height);
var gray = Square(width, height, 0, 0, width, height);
var recolored = gray.ToArray();
recolored[^1] = unchecked((int)0xFFFF0000);
var parameters = Parameters(seed: 3);
Upload(sourceTexture, gray);
pipeline.Simulate(sourceTexture, width, height, 0, 0, width, height, in parameters, hashSource: true);
var grayHash = Assert.NotNull(pipeline.SourceHash);
Upload(sourceTexture, recolored);
pipeline.Simulate(sourceTexture, width, height, 0, 0, width, height, in parameters, hashSource: true);
var recoloredHash = Assert.NotNull(pipeline.SourceHash);
Assert.NotEqual(grayHash.Sum, recoloredHash.Sum);
Assert.NotEqual(grayHash.Mix, recoloredHash.Mix);
}
[Fact]
public void TheGrowthIsSimulatedAgainOnlyWhenTheShapeOrTheGrowthSettingsChange()
{
+1 -1
ファイルの表示
@@ -5,7 +5,7 @@
<UseWPF>true</UseWPF>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.1.1</Version>
<Version>1.1.3</Version>
<Platforms>AnyCPU;x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+16 -4
ファイルの表示
@@ -440,10 +440,10 @@ internal sealed class CrystallineGrowthPipeline : IDisposable
private void EnsureGrid(int gridWidth, int gridHeight)
{
if (_gridWidth == gridWidth && _gridHeight == gridHeight)
return;
var resized = _gridWidth != gridWidth || _gridHeight != gridHeight;
if (resized)
DisposeGridBuffers();
DisposeGridBuffers();
var gridLength = gridWidth * gridHeight;
if (!_host.TryEnsureGrid(
new CrystallineGrowthGridResources.Plan(
@@ -456,8 +456,20 @@ internal sealed class CrystallineGrowthPipeline : IDisposable
maskLength: gridLength,
reachMaskLength: gridLength,
renderMassLength: gridLength),
out _))
out var changed))
throw new InvalidOperationException();
if (!resized)
{
if (changed)
{
_structureKey = null;
_geometryKey = null;
ReleaseGeometry();
}
return;
}
_birth = _device.AllocateReadWriteBuffer<int>(gridLength);
_birthReadBack = _device.AllocateReadBackBuffer<int>(gridLength);
_cachedBirth = new int[gridLength];
+4 -1
ファイルの表示
@@ -282,7 +282,10 @@ internal sealed partial class CrystallineGrowthPipelineHost
{
context.For(1, new SourceHashResetShader(scratch));
context.Barrier(scratch);
context.For(sourceWidth, sourceHeight, new SourceHashShader(source, scratch, sourceWidth, sourceHeight));
context.For(
ThreadGroupAlignment.AlignX<SourceHashShader>(sourceWidth),
ThreadGroupAlignment.AlignY<SourceHashShader>(sourceHeight),
new SourceHashShader(source, scratch, sourceWidth, sourceHeight));
context.Barrier(scratch);
}