コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
a1071d504a
|
||
|
|
250821f68e
|
||
|
|
4bfa25b4b3
|
||
|
|
cef93c9176
|
||
|
|
37152f3011
|
検索条件に一致するファイルはありません
@@ -1,5 +1,5 @@
|
||||
========================================
|
||||
浮世絵 for YMM4 v1.2.2
|
||||
浮世絵 for YMM4 v1.2.3
|
||||
========================================
|
||||
YukkuriMovieMaker4上で動作する、素材を多色木版画の原画とみなし、
|
||||
エッジ接線流に沿った主線と、限定パレットの階調にまとめた色面を刷り重ねて
|
||||
|
||||
@@ -264,6 +264,30 @@ public sealed class UkiyoeEffectProcessorTests
|
||||
Assert.Equal(secondSize > firstSize, after.Width > before.Width);
|
||||
}
|
||||
|
||||
[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 UkiyoeEffect();
|
||||
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()
|
||||
{
|
||||
|
||||
@@ -238,6 +238,41 @@ public sealed class UkiyoePipelineTests
|
||||
Assert.True(DarkPixels(withLines) > DarkPixels(withoutLines));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void APipelineWhoseGridWasReclaimedDrawsLikeAFreshOne()
|
||||
{
|
||||
using var pipeline = CreatePipeline();
|
||||
using var fresh = CreatePipeline();
|
||||
var source = Gradient(64, 64, 8, 8, 48, 48);
|
||||
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, Gradient(64, 64, 8, 8, 48, 48));
|
||||
|
||||
var first = pipeline.Simulate(texture, 64, 64, 0, 0, 64, 64, in parameters);
|
||||
var repeated = pipeline.Simulate(texture, 64, 64, 0, 0, 64, 64, in parameters);
|
||||
device.TrimMemory();
|
||||
var reclaimed = pipeline.Simulate(texture, 64, 64, 0, 0, 64, 64, in parameters);
|
||||
|
||||
Assert.True(first);
|
||||
Assert.False(repeated);
|
||||
Assert.True(reclaimed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AWarmPipelineAllocatesNoManagedMemory()
|
||||
{
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>1.2.2</Version>
|
||||
<Version>1.2.3</Version>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
|
||||
@@ -274,16 +274,16 @@ internal sealed class UkiyoePipeline : IDisposable
|
||||
|
||||
private void EnsureGrid(int gridWidth, int gridHeight)
|
||||
{
|
||||
if (_gridWidth == gridWidth && _gridHeight == gridHeight)
|
||||
return;
|
||||
|
||||
var gridLength = gridWidth * gridHeight;
|
||||
if (!_host.TryEnsureGrid(
|
||||
new UkiyoeGridResources.Plan(
|
||||
gridLength, gridLength, gridLength, gridLength, gridLength, gridLength, gridLength, gridLength, gridLength),
|
||||
out _))
|
||||
out var changed))
|
||||
throw new InvalidOperationException();
|
||||
|
||||
if (!changed && _gridWidth == gridWidth && _gridHeight == gridHeight)
|
||||
return;
|
||||
|
||||
_cachedLitCount = 0;
|
||||
_cachedBoundsMinX = int.MaxValue;
|
||||
_cachedBoundsMinY = int.MaxValue;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする