From 9c116a1260e820e0fb6b74da933c9d75b1c31fc8 Mon Sep 17 00:00:00 2001 From: routersys Date: Sat, 3 Oct 2026 17:04:21 +0900 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=8F=8E=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E6=A0=BC=E5=AD=90=E3=81=AE=E8=B3=87=E6=BA=90=E3=82=92=E6=8F=8F?= =?UTF-8?q?=E7=94=BB=E3=81=AE=E5=89=8D=E3=81=AB=E4=BD=9C=E3=82=8A=E7=9B=B4?= =?UTF-8?q?=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・GPUのメモリが逼迫して資源が回収された後に、描画が失敗し続ける不具合を修正-F --- InkDispersion/InkDispersionPipeline.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/InkDispersion/InkDispersionPipeline.cs b/InkDispersion/InkDispersionPipeline.cs index b14c23c..b2a0b44 100644 --- a/InkDispersion/InkDispersionPipeline.cs +++ b/InkDispersion/InkDispersionPipeline.cs @@ -340,10 +340,10 @@ internal sealed class InkDispersionPipeline : 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; var distributionLength = gridLength * 9; if (!_host.TryEnsureGrid( @@ -366,8 +366,16 @@ internal sealed class InkDispersionPipeline : IDisposable surfaceLength: gridLength, velocityLength: gridLength, wetnessLength: gridLength), - out _)) + out var changed)) throw new InvalidOperationException(); + + if (!resized) + { + if (changed) + _structureKey = null; + return; + } + _inkStep = _device.AllocateReadWriteBuffer(gridLength); _inkStepReadBack = _device.AllocateReadBackBuffer(gridLength); _cachedInkStep = new int[gridLength];