Add effect registration check for E_NOTFOUND

このコミットが含まれているのは:
Sergio Pedri committed 2022-12-22 10:56:03 -08:00
1 親 49ecac2169
コミット 5c59b021c8
2ファイル変更
+6 -1

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

+3 -1
ファイルの表示
@@ -243,7 +243,9 @@ unsafe partial class PixelShaderEffect<T>
// Check if creation failed due to the effect not being registered. In that case, register
// it and then try again. This is much faster than check whether the effect is registered
// manually every time, by enumerating all registered effects for the target device context.
if (hresult == D2DERR.D2DERR_EFFECT_IS_NOT_REGISTERED)
// An unregistered effect can also sometimes return E_NOTFOUND, although it's not documented.
if (hresult == D2DERR.D2DERR_EFFECT_IS_NOT_REGISTERED ||
hresult == E.E_NOTFOUND)
{
// Register the effect with the factory (pass the same D2D1 draw transform mapper factory that was used before)
D2D1PixelShaderEffect.RegisterForD2D1Factory1<T>(d2D1Factory1.Get(), out _);
+3
ファイルの表示
@@ -7,6 +7,9 @@ namespace TerraFX.Interop.Windows;
internal static class E
{
[NativeTypeName("#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)")]
public const int E_NOTFOUND = -2147023728;
[NativeTypeName("#define E_NOT_VALID_STATE HRESULT_FROM_WIN32(ERROR_INVALID_STATE)")]
public const int E_NOT_VALID_STATE = -2147019873;