Removed .NET Standard 2.0 target (😢)
このコミットが含まれているのは:
1 親
e6858564f3
コミット
a855f3a264
13ファイル変更
+10
-192
検索条件に一致するファイルはありません
@@ -1,15 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<DocumentationFile>ComputeSharp.Core.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- .NET Standard 2.0 doesn't have the vector types -->
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -3,9 +3,6 @@ using ComputeSharp.Graphics.Extensions;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using TerraFX.Interop;
|
||||
using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_TYPE;
|
||||
#if NETSTANDARD2_0
|
||||
using GC = Polyfills.GC;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.Graphics.Commands.Interop
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<DocumentationFile>ComputeSharp.Graphics.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
#if NETSTANDARD2_0
|
||||
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Polyfills
|
||||
{
|
||||
/// <summary>
|
||||
/// A polyfill class for the <see cref="GC"/> type.
|
||||
/// </summary>
|
||||
internal static class GC
|
||||
{
|
||||
/// <summary>
|
||||
/// Allocates an array while skipping zero-initialization, if possible.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Specifies the type of the array element.</typeparam>
|
||||
/// <param name="length">Specifies the length of the array.</param>
|
||||
/// <param name="pinned">Specifies whether the allocated array must be pinned.</param>
|
||||
/// <returns>An array object with uninitialized memory, if possible.</returns>
|
||||
public static T[] AllocateUninitializedArray<T>(int length, bool pinned = false)
|
||||
{
|
||||
return new T[length];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A polyfill class for the <see cref="MemoryMarshal"/> type.
|
||||
/// </summary>
|
||||
internal static class MemoryMarshal
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a reference to the 0th element of array. If the array is empty, returns
|
||||
/// a reference to where the 0th element would have been stored. Such a reference
|
||||
/// may be used for pinning but must never be dereferenced.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the array elements.</typeparam>
|
||||
/// <param name="array">The array to analyze.</param>
|
||||
/// <returns>Reference to the 0th element in array.</returns>
|
||||
public static ref T GetArrayDataReference<T>(T[] array)
|
||||
{
|
||||
IntPtr offset = TypeInfo<T>.ArrayDataByteOffset;
|
||||
RawObjectData rawObject = Unsafe.As<RawObjectData>(array)!;
|
||||
ref byte r0 = ref rawObject.Data;
|
||||
ref byte r1 = ref Unsafe.AddByteOffset(ref r0, offset);
|
||||
ref T r2 = ref Unsafe.As<byte, T>(ref r1);
|
||||
|
||||
return ref r2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A private generic class to preload type info for arbitrary runtime types.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to load info for.</typeparam>
|
||||
private static class TypeInfo<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// The byte offset to the first <typeparamref name="T"/> element in a SZ array.
|
||||
/// </summary>
|
||||
public static readonly IntPtr ArrayDataByteOffset = MeasureArrayDataByteOffset();
|
||||
|
||||
/// <summary>
|
||||
/// Computes the value for <see cref="ArrayDataByteOffset"/>.
|
||||
/// </summary>
|
||||
/// <returns>The value of <see cref="ArrayDataByteOffset"/> for the current runtime.</returns>
|
||||
private static IntPtr MeasureArrayDataByteOffset()
|
||||
{
|
||||
T[] array = new T[1];
|
||||
RawObjectData rawObject = Unsafe.As<RawObjectData>(array)!;
|
||||
ref byte r0 = ref rawObject.Data;
|
||||
ref byte r1 = ref Unsafe.As<T, byte>(ref array[0]);
|
||||
|
||||
return Unsafe.ByteOffset(ref r0, ref r1);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mapping type for a raw object.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
private sealed class RawObjectData
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public byte Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>
|
||||
/// Extensions for the <see cref="Queue{T}"/> type.
|
||||
/// </summary>
|
||||
internal static class QueueExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Removes the object at the beginning of the <see cref="Queue{T}"/> instance and copies it to the result parameter.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of values in the input <see cref="Queue{T}"/>.</typeparam>
|
||||
/// <param name="queue">The input <see cref="Queue{T}"/>.</param>
|
||||
/// <param name="result">The removed object.</param>
|
||||
/// <returns>Whether or not the object was successfully removed.</returns>
|
||||
public static bool TryDequeue<T>(this Queue<T> queue, out T? result)
|
||||
{
|
||||
if (queue.Count > 0)
|
||||
{
|
||||
result = queue.Dequeue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
result = default;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Buffers;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Extensions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
@@ -7,11 +8,6 @@ using ComputeSharp.Interop;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using TerraFX.Interop;
|
||||
using FX = TerraFX.Interop.Windows;
|
||||
#if NET5_0
|
||||
using MemoryMarshal = System.Runtime.InteropServices.MemoryMarshal;
|
||||
#else
|
||||
using MemoryMarshal = Polyfills.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.Resources
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
#if NET5_0
|
||||
using GC = System.GC;
|
||||
#else
|
||||
using GC = Polyfills.GC;
|
||||
#endif
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ComputeSharp.Resources.Views
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<DocumentationFile>ComputeSharp.Shaders.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#if NETSTANDARD2_0
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace System.Runtime.CompilerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// Reserved to be used by the compiler for tracking metadata.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
internal static class IsExternalInit
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.Reflection
|
||||
{
|
||||
/// <summary>
|
||||
/// Extensions for the <see cref="MethodInfo"/> type.
|
||||
/// </summary>
|
||||
internal static class MethodInfoExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a delegate of type T from a given method.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of delegate to create.</typeparam>
|
||||
/// <param name="method">The input <see cref="MethodInfo"/>.</param>
|
||||
/// <returns>The delegate for this method.</returns>
|
||||
public static T CreateDelegate<T>(this MethodInfo method)
|
||||
where T : Delegate
|
||||
{
|
||||
return (T)method.CreateDelegate(typeof(T));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,14 +4,10 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.__Internals;
|
||||
using ComputeSharp.Shaders.Translation.Models;
|
||||
using TerraFX.Interop;
|
||||
#if NET5_0
|
||||
using MemoryMarshal = System.Runtime.InteropServices.MemoryMarshal;
|
||||
#else
|
||||
using MemoryMarshal = Polyfills.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
#pragma warning disable CS0618
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<DocumentationFile>ComputeSharp.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -3,11 +3,6 @@ using System.Diagnostics.Contracts;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Resources;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
#if NET5_0
|
||||
using GC = System.GC;
|
||||
#else
|
||||
using GC = Polyfills.GC;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.1;net5.0</TargetFrameworks>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.1;net5.0</TargetFrameworks>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする