回収された格子の資源を描画の前に作り直す

・GPUのメモリが逼迫して資源が回収された後に、描画が失敗し続ける不具合を修正-F
このコミットが含まれているのは:
routersys committed 2026-10-03 17:04:21 +09:00
1 親 79862b930d
コミット 9c116a1260
1ファイル変更
+12 -4
+12 -4
ファイルの表示
@@ -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<int>(gridLength);
_inkStepReadBack = _device.AllocateReadBackBuffer<int>(gridLength);
_cachedInkStep = new int[gridLength];