diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj index 958bf173..31d48cef 100644 --- a/src/ComputeSharp/ComputeSharp.csproj +++ b/src/ComputeSharp/ComputeSharp.csproj @@ -1,7 +1,7 @@  - net5.0 + netstandard2.0;net5.0 diff --git a/src/ComputeSharp/Extensions/Buffers/BufferExtensions.cs b/src/ComputeSharp/Extensions/Buffers/BufferExtensions.cs index 95ddd2f5..32c9e32e 100644 --- a/src/ComputeSharp/Extensions/Buffers/BufferExtensions.cs +++ b/src/ComputeSharp/Extensions/Buffers/BufferExtensions.cs @@ -3,6 +3,11 @@ using System.Diagnostics.Contracts; using System.Runtime.InteropServices; using ComputeSharp.Graphics.Buffers.Abstract; using Microsoft.Toolkit.Diagnostics; +#if NET5_0 +using GC = System.GC; +#else +using GC = ComputeSharp.System.GC; +#endif namespace ComputeSharp { diff --git a/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs b/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs index 4c1b03e2..00ec659c 100644 --- a/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs +++ b/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs @@ -55,6 +55,7 @@ namespace ComputeSharp texture.GetData(destination.AsSpan(), 0, 0, texture.Width, texture.Height); } +#if NET5_0 /// /// Reads the contents of the specified range from the current instance and writes them into a target array. /// @@ -68,6 +69,7 @@ namespace ComputeSharp { texture.GetData(destination.AsSpan(), x, y); } +#endif /// /// Reads the contents of the specified range from the current instance and writes them into a target array. @@ -98,6 +100,7 @@ namespace ComputeSharp texture.GetData(destination.AsSpan(offset), 0, 0, texture.Width, texture.Height); } +#if NET5_0 /// /// Reads the contents of the specified range from the current instance and writes them into a target array. /// @@ -112,6 +115,7 @@ namespace ComputeSharp { texture.GetData(destination.AsSpan(offset), x, y); } +#endif /// /// Reads the contents of the specified range from the current instance and writes them into a target array. @@ -143,6 +147,7 @@ namespace ComputeSharp texture.GetData(destination, 0, 0, texture.Width, texture.Height); } +#if NET5_0 /// /// Reads the contents of the specified range from the current instance and writes them into a target . /// @@ -159,6 +164,7 @@ namespace ComputeSharp texture.GetData(destination, offsetX, offsetY, width, height); } +#endif /// /// Reads the contents of the specified range from the current instance and writes them into a target . @@ -203,6 +209,7 @@ namespace ComputeSharp texture.SetData(source.AsSpan(), 0, 0, texture.Width, texture.Height); } +#if NET5_0 /// /// Writes the contents of a given array to a specified area of the current instance. /// @@ -216,6 +223,7 @@ namespace ComputeSharp { texture.SetData(source.AsSpan(), x, y); } +#endif /// /// Writes the contents of a given array to a specified area of the current instance. @@ -233,6 +241,7 @@ namespace ComputeSharp texture.SetData(source.AsSpan(), x, y, width, height); } +#if NET5_0 /// /// Writes the contents of a given array to a specified area of the current instance. /// @@ -247,6 +256,7 @@ namespace ComputeSharp { texture.SetData(source.AsSpan(offset), x, y); } +#endif /// /// Writes the contents of a given array to a specified area of the current instance. @@ -278,6 +288,7 @@ namespace ComputeSharp texture.SetData(source, 0, 0, texture.Width, texture.Height); } +#if NET5_0 /// /// Writes the contents of a given to a specified area of the current instance. /// @@ -294,6 +305,7 @@ namespace ComputeSharp texture.SetData(source, offsetX, offsetY, width, height); } +#endif /// /// Writes the contents of a given to a specified area of the current instance. diff --git a/src/ComputeSharp/Extensions/Buffers/Texture3DExtensions.cs b/src/ComputeSharp/Extensions/Buffers/Texture3DExtensions.cs index 850378a5..8666780e 100644 --- a/src/ComputeSharp/Extensions/Buffers/Texture3DExtensions.cs +++ b/src/ComputeSharp/Extensions/Buffers/Texture3DExtensions.cs @@ -66,6 +66,7 @@ namespace ComputeSharp texture.GetData(destination.AsSpan(offset), 0, 0, 0, texture.Width, texture.Height, texture.Depth); } +#if NET5_0 /// /// Reads the contents of the specified range from the current instance and writes them into a target array. /// @@ -81,6 +82,7 @@ namespace ComputeSharp { texture.GetData(destination.AsSpan(offset), x, y, z); } +#endif /// /// Reads the contents of the specified range from the current instance and writes them into a target array. @@ -113,6 +115,7 @@ namespace ComputeSharp texture.GetData(destination, 0, 0, 0, texture.Width, texture.Height, texture.Depth); } +#if NET5_0 /// /// Reads the contents of the specified range from the current instance and writes them into a target . /// @@ -131,6 +134,7 @@ namespace ComputeSharp texture.GetData(destination, offsetX, offsetY, offsetZ, width, height, depth); } +#endif /// /// Reads the contents of the specified range from the current instance and writes them into a target . @@ -182,6 +186,7 @@ namespace ComputeSharp texture.SetData(source.AsSpan(), 0, 0, 0, texture.Width, texture.Height, texture.Depth); } +#if NET5_0 /// /// Writes the contents of a given array to a specified area of the current instance. /// @@ -196,6 +201,7 @@ namespace ComputeSharp { texture.SetData(source.AsSpan(), x, y, z); } +#endif /// /// Writes the contents of a given array to a specified area of the current instance. @@ -215,6 +221,7 @@ namespace ComputeSharp texture.SetData(source.AsSpan(), x, y, z, width, height, depth); } +#if NET5_0 /// /// Writes the contents of a given array to a specified area of the current instance. /// @@ -230,6 +237,7 @@ namespace ComputeSharp { texture.SetData(source.AsSpan(offset), x, y, z); } +#endif /// /// Writes the contents of a given array to a specified area of the current instance. @@ -263,6 +271,7 @@ namespace ComputeSharp texture.SetData(source, 0, 0, 0, texture.Width, texture.Height, texture.Depth); } +#if NET5_0 /// /// Writes the contents of a given to a specified area of the current instance. /// @@ -281,6 +290,7 @@ namespace ComputeSharp texture.SetData(source, offsetX, offsetY, offsetZ, width, height, depth); } +#endif /// /// Writes the contents of a given to a specified area of the current instance.