Remove ComputeSharp reference from D2D1Interop

このコミットが含まれているのは:
Sergio Pedri committed 2022-04-24 21:03:13 +02:00
1 親 41be84bfe4
コミット 8511779b41
8ファイル変更
+99 -9

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

-3
ファイルの表示
@@ -14,7 +14,4 @@
<ItemGroup>
<PackageReference Include="TerraFX.Interop.Windows" Version="10.0.20348" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ComputeSharp\ComputeSharp.csproj" />
</ItemGroup>
</Project>
+14
ファイルの表示
@@ -9,6 +9,20 @@ namespace ComputeSharp.D2D1Interop.Extensions;
/// <remarks>Trimmed down version of the same file in <c>ComputeSharp</c>.</remarks>
internal static class ComPtrExtensions
{
/// <summary>
/// Gets the address of the current <see cref="ComPtr{T}"/> instance as a raw <see langword="void"/> double pointer.
/// </summary>
/// <typeparam name="T">The type to wrap in the current <see cref="ComPtr{T}"/> instance.</typeparam>
/// <param name="ptr">The input <see cref="ComPtr{T}"/> instance to get the address for.</param>
/// <returns>The raw pointer to the input <see cref="ComPtr{T}"/> instance.</returns>
/// <remarks>This method is only valid when the current <see cref="ComPtr{T}"/> instance is on the stack or pinned.</remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void** GetVoidAddressOf<T>(this in ComPtr<T> ptr)
where T : unmanaged, IUnknown.Interface
{
return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr));
}
/// <summary>
/// Moves the current <see cref="ComPtr{T}"/> instance and resets it without releasing the reference.
/// </summary>
+43
ファイルの表示
@@ -0,0 +1,43 @@
using System;
using System.Diagnostics.CodeAnalysis;
namespace ComputeSharp.D2D1Interop.Helpers;
/// <summary>
/// Helper methods to efficiently throw exceptions.
/// </summary>
internal static partial class ThrowHelper
{
/// <summary>
/// Throws a new <see cref="ArgumentOutOfRangeException"/>.
/// </summary>
/// <param name="name">The argument name.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown with the specified parameter.</exception>
[DoesNotReturn]
public static void ThrowArgumentOutOfRangeException(string? name)
{
throw new ArgumentOutOfRangeException(name);
}
/// <summary>
/// Throws a new <see cref="InvalidOperationException"/>.
/// </summary>
/// <param name="message">The message to include in the exception.</param>
/// <exception cref="InvalidOperationException">Thrown with the specified parameter.</exception>
[DoesNotReturn]
public static void ThrowInvalidOperationException(string? message)
{
throw new InvalidOperationException(message);
}
/// <summary>
/// Throws a new <see cref="NotSupportedException"/>.
/// </summary>
/// <param name="message">The message to include in the exception.</param>
/// <exception cref="NotSupportedException">Thrown with the specified parameter.</exception>
[DoesNotReturn]
public static void ThrowNotSupportedException(string? message)
{
throw new NotSupportedException(message);
}
}
+2 -2
ファイルの表示
@@ -1,9 +1,9 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using CommunityToolkit.Diagnostics;
using ComputeSharp.__Internals;
using ComputeSharp.Core.Extensions;
using ComputeSharp.D2D1Interop.Extensions;
using ComputeSharp.D2D1Interop.Helpers;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
+5 -2
ファイルの表示
@@ -2,7 +2,7 @@
using System.Buffers;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using CommunityToolkit.Diagnostics;
using ComputeSharp.D2D1Interop.Helpers;
namespace ComputeSharp.D2D1Interop.Shaders.Interop.Buffers;
@@ -40,7 +40,10 @@ internal sealed unsafe class PinnedBufferMemoryManager : MemoryManager<byte>
/// <inheritdoc/>
public override unsafe MemoryHandle Pin(int elementIndex = 0)
{
Guard.IsInRange(elementIndex, 0, this.length);
if ((uint)elementIndex >= this.length)
{
ThrowHelper.ThrowArgumentOutOfRangeException(nameof(elementIndex));
}
return new(this.buffer + elementIndex);
}
+1 -1
ファイルの表示
@@ -1,8 +1,8 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Core.Extensions;
using ComputeSharp.D2D1Interop;
using ComputeSharp.D2D1Interop.Extensions;
using ComputeSharp.Shaders.Dispatching;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
+34
ファイルの表示
@@ -0,0 +1,34 @@
using System;
namespace ComputeSharp
{
/// <summary>
/// Placeholder.
/// </summary>
public struct Float4
{
}
/// <summary>
/// Placeholder.
/// </summary>
public struct Float2
{
}
}
namespace ComputeSharp.Exceptions
{
/// <summary>
/// Placeholder.
/// </summary>
public sealed class InvalidExecutionContextException : Exception
{
/// <summary>
/// Placeholder.
/// </summary>
public InvalidExecutionContextException(string name)
{
}
}
}
-1
ファイルの表示
@@ -3,7 +3,6 @@
[module: SkipLocalsInit]
[assembly: InternalsVisibleTo("ComputeSharp.Dynamic")]
[assembly: InternalsVisibleTo("ComputeSharp.D2D1Interop")]
[assembly: InternalsVisibleTo("ComputeSharp.Uwp")]
[assembly: InternalsVisibleTo("ComputeSharp.WinUI")]