Added initial version of TerraFX ShaderCompiler type

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-16 14:03:00 +01:00
1 親 f475c5e60a
コミット 3f1b27e092
2ファイル変更
+168

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

+22
ファイルの表示
@@ -27,6 +27,28 @@ namespace ComputeSharp.Graphics.Helpers
}
}
/// <summary>
/// Throws a <see cref="Win32Exception"/> if <paramref name="result"/> represents an error.
/// </summary>
/// <param name="result">The input <see cref="HRESULT"/> to check.</param>
/// <param name="resource">An owned resource to dispose if it is not a null reference.</param>
/// <exception cref="Win32Exception">Thrown if <paramref name="result"/> represents an error.</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void ThrowIfFailed(int result, void* resource)
{
if (result < 0)
{
static void Throw(int result, void* resource)
{
if (resource != null) ((IUnknown*)resource)->Release();
throw new Win32Exception(result);
}
Throw(result, resource);
}
}
/// <summary>
/// Throws a <see cref="Win32Exception"/> if <paramref name="result"/> represents an error.
/// </summary>