From b572d939562e76cd0a5c1267ebb7cb55df39ac21 Mon Sep 17 00:00:00 2001 From: routersys Date: Tue, 22 Sep 2026 12:39:41 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9B=E3=82=B9=E3=83=88=E3=81=A8Direct2D?= =?UTF-8?q?=E3=81=8B=E3=82=89=E3=81=AE=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=97?= =?UTF-8?q?=E5=8F=A3=E3=81=A7=E4=BE=8B=E5=A4=96=E3=82=92=E5=A0=B1=E5=91=8A?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・想定していない例外を開発者へ自動で報告する機能を追加-A --- InkDispersion/InkDispersionCustomEffect.cs | 13 +++++++- InkDispersion/InkDispersionEffect.cs | 12 ++++++- InkDispersion/InkDispersionEffectProcessor.cs | 32 +++++++++++++++++-- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/InkDispersion/InkDispersionCustomEffect.cs b/InkDispersion/InkDispersionCustomEffect.cs index 035f3d6..8a8b05d 100644 --- a/InkDispersion/InkDispersionCustomEffect.cs +++ b/InkDispersion/InkDispersionCustomEffect.cs @@ -33,7 +33,18 @@ internal sealed class InkDispersionCustomEffect(IGraphicsDevicesAndContext devic protected override void UpdateConstants() { - drawInformation?.SetPixelShaderConstantBuffer(_cb); + if (drawInformation is null) + return; + + try + { + drawInformation.SetPixelShaderConstantBuffer(_cb); + } + catch (Exception exception) + { + InkDispersionTelemetry.Report(exception); + throw; + } } public override void MapInputRectsToOutputRect( diff --git a/InkDispersion/InkDispersionEffect.cs b/InkDispersion/InkDispersionEffect.cs index ba8a2b2..1282cfd 100644 --- a/InkDispersion/InkDispersionEffect.cs +++ b/InkDispersion/InkDispersionEffect.cs @@ -90,7 +90,17 @@ public sealed class InkDispersionEffect : VideoEffectBase public override IEnumerable CreateExoVideoFilters(int keyFrameIndex, ExoOutputDescription exoOutputDescription) => []; public override IVideoEffectProcessor CreateVideoEffect(IGraphicsDevicesAndContext devices) - => new InkDispersionEffectProcessor(devices, this); + { + try + { + return new InkDispersionEffectProcessor(devices, this); + } + catch (Exception exception) + { + InkDispersionTelemetry.Report(exception); + throw; + } + } protected override IEnumerable GetAnimatables() => _animatables ??= [Amount, Spread, Water, Reach, Fiber, Sizing, Viscosity, Drying, Density, Grain]; diff --git a/InkDispersion/InkDispersionEffectProcessor.cs b/InkDispersion/InkDispersionEffectProcessor.cs index 728ff5d..2e8c3ee 100644 --- a/InkDispersion/InkDispersionEffectProcessor.cs +++ b/InkDispersion/InkDispersionEffectProcessor.cs @@ -41,6 +41,19 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase } public override DrawDescription Update(EffectDescription effectDescription) + { + try + { + return UpdateCore(effectDescription); + } + catch (Exception exception) + { + InkDispersionTelemetry.Report(exception); + throw; + } + } + + private DrawDescription UpdateCore(EffectDescription effectDescription) { if (IsPassThroughEffect || _effect is null || _outputCrop is null || _outputTransform is null || _outputTransformOutput is null || _resourceSet is null || _interopProvider is null || _pipeline is null || input is null) return effectDescription.DrawDescription; @@ -290,8 +303,9 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase _resourceSet = InkDispersionResourceSet.Create(interopDevice, _interopDomain); _pipeline = InkDispersionPipeline.TryCreate(interopDevice); } - catch + catch (Exception exception) { + InkDispersionTelemetry.Report(exception); ReleaseInterop(); throw; } @@ -339,8 +353,9 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase disposer.Collect(output); return output; } - catch + catch (Exception exception) { + InkDispersionTelemetry.Report(exception); output?.Dispose(); outputTransformOutput?.Dispose(); outputTransform?.Dispose(); @@ -360,6 +375,19 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase } protected override void ClearEffectChain() + { + try + { + ClearEffectChainCore(); + } + catch (Exception exception) + { + InkDispersionTelemetry.Report(exception); + throw; + } + } + + private void ClearEffectChainCore() { _effect?.SetInput(0, null, true); _effect?.SetInput(1, null, true);