Remove CommunityToolkit.Diagnostics from ComputeSharp package

このコミットが含まれているのは:
Sergio Pedri committed 2023-02-25 18:34:59 +01:00
1 親 72338416c2
コミット 5a4fd9a4ce
19ファイル変更
+58 -46

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

+3 -11
ファイルの表示
@@ -1,6 +1,5 @@
using System;
using System.Runtime.CompilerServices;
using CommunityToolkit.Diagnostics;
using ComputeSharp.__Internals;
using ComputeSharp.Shaders.Models;
using TerraFX.Interop.DirectX;
@@ -27,23 +26,16 @@ internal struct ShaderBytecodeLoader : IBytecodeLoader
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ICachedShader GetCachedShader()
{
if (this.cachedShader is not ICachedShader cachedShader)
{
return ThrowHelper.ThrowInvalidOperationException<ICachedShader>("The shader has not been initialized.");
}
default(InvalidOperationException).ThrowIf(this.cachedShader is null);
return cachedShader;
return this.cachedShader;
}
/// <inheritdoc/>
public unsafe void LoadDynamicBytecode(IntPtr handle)
{
default(InvalidOperationException).ThrowIf(this.cachedShader is not null);
if (handle == IntPtr.Zero)
{
ThrowHelper.ThrowNotSupportedException("Runtime shader compilation is not supported by the current configuration.");
}
default(InvalidOperationException).ThrowIf(handle == IntPtr.Zero);
this.cachedShader = new ICachedShader.Dynamic((IDxcBlob*)handle);
}