GPUデバイスロストを固有の失敗として扱う

このコミットが含まれているのは:
routersys committed 2026-09-21 10:33:33 +09:00
1 親 bf6de65f3c
コミット ad1d6cdd50
4ファイル変更
+11

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

+8
ファイルの表示
@@ -3,6 +3,7 @@ using System.Diagnostics;
using System.Globalization;
using System.IO;
using ProxyForge.Sources;
using Vortice.DXGI;
using YukkuriMovieMaker.Commons;
using YukkuriMovieMaker.Plugin.FileSource;
@@ -95,6 +96,10 @@ internal sealed class ProxyEncoder(FFmpegExecutables executables, VideoSourceFac
renderer = null;
return session;
}
catch (SharpGen.Runtime.SharpGenException exception) when (IsDeviceLost(exception.ResultCode))
{
throw new ProxyEncodeException(ProxyEncodeFailure.GraphicsDeviceLost, "The GPU device was removed, hung, or reset.");
}
finally
{
renderer?.Dispose();
@@ -104,6 +109,9 @@ internal sealed class ProxyEncoder(FFmpegExecutables executables, VideoSourceFac
}
}
static bool IsDeviceLost(SharpGen.Runtime.Result result)
=> result == ResultCode.DeviceRemoved || result == ResultCode.DeviceHung || result == ResultCode.DeviceReset;
static void TryDelete(string path)
{
try