diff --git a/ComputeSharp.sln b/ComputeSharp.sln
index 078cf036..12ef6026 100644
--- a/ComputeSharp.sln
+++ b/ComputeSharp.sln
@@ -46,10 +46,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ComputeSharp.Sample.FSharp"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample.FSharp.Shaders", "samples\ComputeSharp.Sample.FSharp.Shaders\ComputeSharp.Sample.FSharp.Shaders.csproj", "{1F37A704-3CDF-45BB-8114-ED9137E5F2CF}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Polyfills", "Polyfills", "{8DCE343F-BA78-4FE1-B562-B57C603A8BAA}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.NetStandard", "src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.shproj", "{A5997814-D8D2-4541-87AC-C3E53CAA67C0}"
-EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.Win32.D3D12", "src\ComputeSharp.Win32.D3D12\ComputeSharp.Win32.D3D12.shproj", "{514FF00E-BBF0-4D55-A47C-EEEB6208ADCE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.WinUI", "src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj", "{FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}"
@@ -446,7 +442,6 @@ Global
{C12D7ACE-98ED-4813-8118-6667C34F484F} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{7C625EC4-F599-4350-A915-F046DF2406D3} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{1F37A704-3CDF-45BB-8114-ED9137E5F2CF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {A5997814-D8D2-4541-87AC-C3E53CAA67C0} = {8DCE343F-BA78-4FE1-B562-B57C603A8BAA}
{514FF00E-BBF0-4D55-A47C-EEEB6208ADCE} = {D991153C-A34D-4042-B76F-822ADB111DD0}
{0071701E-B9C5-4098-BE5F-EF556C4553C6} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{0800BD51-499D-44C2-9417-FD1F7FDFE9C4} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
@@ -485,8 +480,6 @@ Global
src\ComputeSharp.CodeFixing\ComputeSharp.CodeFixing.projitems*{9b4448b1-200f-4966-8a13-a508691b3003}*SharedItemsImports = 5
src\ComputeSharp.Win32.D2D1\ComputeSharp.Win32.D2D1.projitems*{9da1da9f-f8b2-4b25-be80-c21f773029e3}*SharedItemsImports = 13
samples\ComputeSharp.SwapChain.Shaders.D2D1.Shared\ComputeSharp.SwapChain.Shaders.D2D1.Shared.projitems*{9ea5ae9d-c39a-4f43-b03e-0a848ea2558a}*SharedItemsImports = 5
- src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems*{a5997814-d8d2-4541-87ac-c3e53caa67c0}*SharedItemsImports = 13
- src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems*{bfb003d1-788b-48de-8065-39479c162cb0}*SharedItemsImports = 5
src\ComputeSharp.SourceGeneration\ComputeSharp.SourceGeneration.projitems*{bfb003d1-788b-48de-8065-39479c162cb0}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.Shaders.Shared\ComputeSharp.SwapChain.Shaders.Shared.projitems*{c12d7ace-98ed-4813-8118-6667c34f484f}*SharedItemsImports = 5
src\ComputeSharp.SourceGeneration.Hlsl\ComputeSharp.SourceGeneration.Hlsl.projitems*{e44053bd-a761-47fb-aa78-087a599672ea}*SharedItemsImports = 5
diff --git a/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj b/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj
index 00a1b79d..9dadf433 100644
--- a/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj
+++ b/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj
@@ -23,7 +23,4 @@
-
-
-
diff --git a/src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs b/src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs
index 890e181d..83c19302 100644
--- a/src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs
+++ b/src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs
@@ -1,11 +1,7 @@
+using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using TerraFX.Interop.Windows;
-#if NET6_0_OR_GREATER
-using Math = System.Math;
-#else
-using Math = ComputeSharp.NetStandard.Math;
-#endif
namespace ComputeSharp.D2D1.Extensions;
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs
index c7a95502..e2c08b74 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs
@@ -1,14 +1,9 @@
using System;
using System.Buffers;
using System.Diagnostics.CodeAnalysis;
-#if NET6_0_OR_GREATER
using System.Numerics;
-#endif
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-#if !NET6_0_OR_GREATER
-using BitOperations = ComputeSharp.NetStandard.BitOperations;
-#endif
namespace ComputeSharp.D2D1.Shaders.Interop.Buffers;
diff --git a/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.projitems b/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.projitems
deleted file mode 100644
index 830cad6b..00000000
--- a/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.projitems
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
- true
- a5997814-d8d2-4541-87ac-c3e53caa67c0
-
-
- ComputeSharp.NetStandard
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.shproj b/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.shproj
deleted file mode 100644
index 975577c8..00000000
--- a/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.shproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- a5997814-d8d2-4541-87ac-c3e53caa67c0
- 14.0
-
-
-
-
-
-
-
diff --git a/src/ComputeSharp.NetStandard/System/Buffers/BitOperations.cs b/src/ComputeSharp.NetStandard/System/Buffers/BitOperations.cs
deleted file mode 100644
index 77d206d5..00000000
--- a/src/ComputeSharp.NetStandard/System/Buffers/BitOperations.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.Runtime.CompilerServices;
-
-namespace ComputeSharp.NetStandard;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 6.
-///
-internal static class BitOperations
-{
- ///
- /// Rounds the given integral value up to a power of 2.
- ///
- /// The value.
- ///
- /// The smallest power of 2 which is greater than or equal to .
- /// If is 0 or the result overflows, returns 0.
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static uint RoundUpToPowerOf2(uint value)
- {
- // Based on https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
- --value;
-
- value |= value >> 1;
- value |= value >> 2;
- value |= value >> 4;
- value |= value >> 8;
- value |= value >> 16;
-
- return value + 1;
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Collections.Generic/DictionaryExtensions.cs b/src/ComputeSharp.NetStandard/System/Collections.Generic/DictionaryExtensions.cs
deleted file mode 100644
index 4c47fb38..00000000
--- a/src/ComputeSharp.NetStandard/System/Collections.Generic/DictionaryExtensions.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-namespace System.Collections.Generic;
-
-///
-/// A helper type with extensions for the type.
-///
-internal static class DictionaryExtensions
-{
- ///
- /// Tries to remove an item from a instance and returns it if present.
- ///
- /// The type of dictionary keys.
- /// The type of dictionary values.
- /// The input instance.
- /// The lookup key to use.
- /// The resulting item, if present.
- /// Whether or not an item was found with the given key.
- public static bool Remove(this Dictionary dictionary, TKey key, out TValue? value)
- where TKey : notnull
- {
- if (dictionary.TryGetValue(key, out value))
- {
- _ = dictionary.Remove(key);
-
- return true;
- }
-
- return false;
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Collections.Generic/QueueExtensions.cs b/src/ComputeSharp.NetStandard/System/Collections.Generic/QueueExtensions.cs
deleted file mode 100644
index d3ed152c..00000000
--- a/src/ComputeSharp.NetStandard/System/Collections.Generic/QueueExtensions.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace System.Collections.Generic;
-
-///
-/// A helper type with extensions for the type.
-///
-internal static class QueueExtensions
-{
- ///
- /// Tries to dequeue an item from the input instance.
- ///
- /// The type of items in the queue.
- /// The input queue.
- /// The resulting item, if any.
- /// Whether or not an item was found.
- public static bool TryDequeue(this Queue queue, out T? result)
- {
- if (queue.Count > 0)
- {
- result = queue.Dequeue();
-
- return true;
- }
-
- result = default!;
-
- return false;
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Enum.cs b/src/ComputeSharp.NetStandard/System/Enum.cs
deleted file mode 100644
index 2389db55..00000000
--- a/src/ComputeSharp.NetStandard/System/Enum.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace ComputeSharp.NetStandard;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 6.
-///
-internal static class Enum
-{
- ///
- /// Returns the name of the input enum value.
- ///
- /// Specifies the type of the enum element.
- /// The input enum value.
- /// The name of .
- public static string GetName(T value)
- where T : unmanaged, global::System.Enum
- {
- return global::System.Enum.GetName(typeof(T), value)!;
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/FormatExtensions.cs b/src/ComputeSharp.NetStandard/System/FormatExtensions.cs
deleted file mode 100644
index cea6f5f3..00000000
--- a/src/ComputeSharp.NetStandard/System/FormatExtensions.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Runtime.CompilerServices;
-
-namespace System;
-
-///
-/// A polyfill type with additional formatting extensions.
-///
-internal static class FormatExtensions
-{
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static string ToString(this T value, string? format)
- {
- throw new NotSupportedException("This API is not supported on this target.");
- }
-
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static string ToString(this T value, string? format, IFormatProvider? formatProvider)
- {
- throw new NotSupportedException("This API is not supported on this target.");
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/GC.cs b/src/ComputeSharp.NetStandard/System/GC.cs
deleted file mode 100644
index 8bc43596..00000000
--- a/src/ComputeSharp.NetStandard/System/GC.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace ComputeSharp.NetStandard;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 6.
-///
-internal static class GC
-{
- ///
- /// Allocate an array while skipping zero-initialization if possible.
- ///
- /// Specifies the type of the array element.
- /// Specifies the length of the array.
- /// Specifies whether the allocated array must be pinned.
- ///
- /// If pinned is set to true, must not be a reference type or a type that contains object references.
- ///
- public static T[] AllocateUninitializedArray(int length, bool pinned = false)
- {
- return new T[length];
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/IO/Path.cs b/src/ComputeSharp.NetStandard/System/IO/Path.cs
deleted file mode 100644
index 17593483..00000000
--- a/src/ComputeSharp.NetStandard/System/IO/Path.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace ComputeSharp.NetStandard;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 6.
-///
-internal static class Path
-{
- ///
- /// Returns the extension of the given path.
- ///
- ///
- /// The returned value is an empty if the given path does not include an extension.
- ///
- public static ReadOnlySpan GetExtension(ReadOnlySpan path)
- {
- return global::System.IO.Path.GetExtension(path.ToString()).AsSpan();
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/IO/StreamExtensions.cs b/src/ComputeSharp.NetStandard/System/IO/StreamExtensions.cs
deleted file mode 100644
index b18da222..00000000
--- a/src/ComputeSharp.NetStandard/System/IO/StreamExtensions.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System.Buffers;
-
-namespace System.IO;
-
-///
-/// A polyfill type with extensions for .
-///
-internal static class StreamExtensions
-{
- ///
- /// Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
- ///
- /// The input instance.
- /// A region of memory. When this method returns, the contents of this region are replaced by the bytes read from the current source.
- /// The total number of bytes read into the buffer.
- public static int Read(this Stream stream, Span span)
- {
- if (span.IsEmpty)
- {
- return 0;
- }
-
- byte[] array = ArrayPool.Shared.Rent(span.Length);
-
- int bytesRead = stream.Read(array, 0, span.Length);
-
- array.AsSpan(0, bytesRead).CopyTo(span);
-
- ArrayPool.Shared.Return(array);
-
- return bytesRead;
- }
-
- ///
- /// Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
- ///
- /// The input instance.
- /// A region of memory. This method copies the contents of this region to the current stream.
- public static void Write(this Stream stream, ReadOnlySpan span)
- {
- if (span.IsEmpty)
- {
- return;
- }
-
- byte[] array = ArrayPool.Shared.Rent(span.Length);
-
- span.CopyTo(array);
-
- stream.Write(array, 0, span.Length);
-
- ArrayPool.Shared.Return(array);
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/IntPtrExtensions.cs b/src/ComputeSharp.NetStandard/System/IntPtrExtensions.cs
deleted file mode 100644
index 89316e29..00000000
--- a/src/ComputeSharp.NetStandard/System/IntPtrExtensions.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Runtime.CompilerServices;
-
-namespace System;
-
-///
-/// A polyfill type with extensions for and .
-///
-internal static class IntPtrExtensions
-{
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static unsafe int CompareTo(this nint left, nint right)
- {
- if (sizeof(nint) == sizeof(int))
- {
- return ((int)left).CompareTo((int)right);
- }
-
- return ((long)left).CompareTo(right);
- }
-
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static unsafe int CompareTo(this nuint left, nuint right)
- {
- if (sizeof(nuint) == sizeof(uint))
- {
- return ((uint)left).CompareTo((uint)right);
- }
-
- return ((ulong)left).CompareTo(right);
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Math.cs b/src/ComputeSharp.NetStandard/System/Math.cs
deleted file mode 100644
index 8e65f153..00000000
--- a/src/ComputeSharp.NetStandard/System/Math.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Runtime.CompilerServices;
-
-namespace ComputeSharp.NetStandard;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 6.
-///
-internal static class Math
-{
- ///
- /// Returns clamped to the inclusive range of and .
- ///
- /// The value to be clamped.
- /// The lower bound of the result.
- /// The upper bound of the result.
- /// The input value clamped to the inclusive range of and .
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static int Clamp(int value, int min, int max)
- {
- if (value < min)
- {
- return min;
- }
-
- if (value > max)
- {
- return max;
- }
-
- return value;
- }
-
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static int Min(int val1, int val2)
- {
- return global::System.Math.Min(val1, val2);
- }
-
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static int Max(int val1, int val2)
- {
- return global::System.Math.Max(val1, val2);
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/ComputeSharp.NetStandard/System/Runtime/CompilerServices/RuntimeHelpers.cs
deleted file mode 100644
index 4ba073f0..00000000
--- a/src/ComputeSharp.NetStandard/System/Runtime/CompilerServices/RuntimeHelpers.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-
-namespace ComputeSharp.NetStandard;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 5.
-///
-internal static class RuntimeHelpers
-{
- ///
- /// Allocates some memory tied to the lifetime of a specific type.
- ///
- /// The type to associate the memory to.
- /// The size in byte of the memory to allocate.
- /// A pointer to the allocated memory.
- public static IntPtr AllocateTypeAssociatedMemory(Type type, int size)
- {
- return Marshal.AllocHGlobal(size);
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Runtime/InteropServices/MemoryMarshal.cs b/src/ComputeSharp.NetStandard/System/Runtime/InteropServices/MemoryMarshal.cs
deleted file mode 100644
index 143ecf6c..00000000
--- a/src/ComputeSharp.NetStandard/System/Runtime/InteropServices/MemoryMarshal.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-
-namespace ComputeSharp.NetStandard;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 6.
-///
-internal static class MemoryMarshal
-{
- ///
- /// Returns a reference to the 0th element of . 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.
- ///
- /// is .
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static ref T GetArrayDataReference(T[] array)
- {
- return ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(array.AsSpan());
- }
-
- ///
- /// Creates a new read-only span for a -terminated UTF-8 string.
- ///
- /// The pointer to the -terminated string of bytes.
- /// A read-only span representing the specified -terminated string, or an empty span if the pointer is .
- /// The returned span does not include the terminator, nor does it validate the well-formedness of the UTF-8 data.
- /// The string is longer than .
- public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(byte* value)
- {
- for (int i = 0; i < int.MaxValue; i++)
- {
- // Stop when the null-terminator has been found
- if (value[i] == 0)
- {
- return new(value, i);
- }
- }
-
- throw new ArgumentException("The string must be null-terminated.");
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Runtime/InteropServices/NativeMemory.cs b/src/ComputeSharp.NetStandard/System/Runtime/InteropServices/NativeMemory.cs
deleted file mode 100644
index a9810ac4..00000000
--- a/src/ComputeSharp.NetStandard/System/Runtime/InteropServices/NativeMemory.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-namespace System.Runtime.InteropServices;
-
-///
-/// This class contains methods that are mainly used to manage native memory.
-///
-internal static unsafe class NativeMemory
-{
- ///
- /// Allocates a block of memory of the specified size, in bytes.
- ///
- /// The size, in bytes, of the block to allocate.
- /// A pointer to the allocated block of memory.
- /// Thrown when allocating of memory failed.
- ///
- /// This method allows to be 0 and will return a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
- /// This method is a thin wrapper over the C malloc API.
- ///
- public static void* Alloc(nuint byteCount)
- {
- return (void*)Marshal.AllocHGlobal(checked((int)byteCount));
- }
-
- ///
- /// Frees a block of memory.
- ///
- /// A pointer to the block of memory that should be freed.
- ///
- /// This method does nothing if is .
- /// This method is a thin wrapper over the C free API.
- ///
- public static void Free(void* ptr)
- {
- Marshal.FreeHGlobal((IntPtr)ptr);
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.NetStandard/System/Text/EncodingExtensions.cs b/src/ComputeSharp.NetStandard/System/Text/EncodingExtensions.cs
deleted file mode 100644
index 3ee8ab6c..00000000
--- a/src/ComputeSharp.NetStandard/System/Text/EncodingExtensions.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Runtime.InteropServices;
-
-namespace System.Text;
-
-///
-/// A polyfill type that mirrors some methods from on .NET 5.
-///
-internal static class EncodingExtensions
-{
- ///
- /// Encodes into a span of bytes a set of characters from the specified read-only span.
- ///
- /// The input instance to use.
- /// The span containing the set of characters to encode.
- /// The byte span to hold the encoded bytes.
- /// The number of encoded bytes.
- public static unsafe int GetBytes(this Encoding encoding, ReadOnlySpan chars, Span bytes)
- {
- fixed (char* charsPtr = &MemoryMarshal.GetReference(chars))
- fixed (byte* bytesPtr = &MemoryMarshal.GetReference(bytes))
- {
- return encoding.GetBytes(charsPtr, chars.Length, bytesPtr, bytes.Length);
- }
- }
-
- ///
- /// Decodes a text from a sequence of bytes.
- ///
- /// The input instance to use.
- /// The byte span that holds the encoded bytes.
- /// The resulting text.
- public static unsafe string GetString(this Encoding encoding, ReadOnlySpan bytes)
- {
- fixed (byte* bytesPtr = &MemoryMarshal.GetReference(bytes))
- {
- return encoding.GetString(bytesPtr, bytes.Length);
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.Win32.D2D1/Windows/shared/uuids/Windows.Manual.cs b/src/ComputeSharp.Win32.D2D1/Windows/shared/uuids/Windows.Manual.cs
index 340eb9b0..b575a2c9 100644
--- a/src/ComputeSharp.Win32.D2D1/Windows/shared/uuids/Windows.Manual.cs
+++ b/src/ComputeSharp.Win32.D2D1/Windows/shared/uuids/Windows.Manual.cs
@@ -6,9 +6,6 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
-#if !NET6_0_OR_GREATER
-using RuntimeHelpers = ComputeSharp.NetStandard.RuntimeHelpers;
-#endif
namespace TerraFX.Interop.Windows;
diff --git a/src/ComputeSharp.Win32.D3D12/Windows/shared/uuids/Windows.Manual.cs b/src/ComputeSharp.Win32.D3D12/Windows/shared/uuids/Windows.Manual.cs
index 31d53d37..15045cca 100644
--- a/src/ComputeSharp.Win32.D3D12/Windows/shared/uuids/Windows.Manual.cs
+++ b/src/ComputeSharp.Win32.D3D12/Windows/shared/uuids/Windows.Manual.cs
@@ -6,7 +6,6 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
-using RuntimeHelpers = ComputeSharp.NetStandard.RuntimeHelpers;
#pragma warning disable IDE1006
diff --git a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs
index 6a245080..9406ae92 100644
--- a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs
+++ b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs
@@ -3,9 +3,6 @@ using ComputeSharp.Graphics.Extensions;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_DESCRIPTOR_HEAP_TYPE;
-#if !NET6_0_OR_GREATER
-using GC = ComputeSharp.NetStandard.GC;
-#endif
namespace ComputeSharp.Graphics.Commands.Interop;
diff --git a/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs
index 4f40f97f..095fa47b 100644
--- a/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs
+++ b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs
@@ -1,9 +1,6 @@
using System;
using System.Runtime.InteropServices;
using ComputeSharp.Resources;
-#if !NET6_0_OR_GREATER
-using GC = ComputeSharp.NetStandard.GC;
-#endif
namespace ComputeSharp;
diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs
index 2f4de787..869d41eb 100644
--- a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs
+++ b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs
@@ -14,9 +14,6 @@ using static TerraFX.Interop.Windows.STATFLAG;
using static TerraFX.Interop.Windows.STG;
using static TerraFX.Interop.Windows.STGM;
using static TerraFX.Interop.Windows.STGTY;
-#if !NET6_0_OR_GREATER
-using RuntimeHelpers = ComputeSharp.NetStandard.RuntimeHelpers;
-#endif
namespace ComputeSharp.Graphics.Extensions;
diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs
index 9481099b..c374551a 100644
--- a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs
+++ b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs
@@ -14,9 +14,6 @@ using static TerraFX.Interop.Windows.STATFLAG;
using static TerraFX.Interop.Windows.STG;
using static TerraFX.Interop.Windows.STGM;
using static TerraFX.Interop.Windows.STGTY;
-#if !NET6_0_OR_GREATER
-using RuntimeHelpers = ComputeSharp.NetStandard.RuntimeHelpers;
-#endif
namespace ComputeSharp.Graphics.Extensions;
diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs
index 0c190ede..376a190d 100644
--- a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs
+++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
@@ -7,11 +8,6 @@ using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_MESSAGE_ID;
using static TerraFX.Interop.DirectX.D3D12_MESSAGE_SEVERITY;
-#if NET6_0_OR_GREATER
-using Enum = System.Enum;
-#else
-using Enum = ComputeSharp.NetStandard.Enum;
-#endif
namespace ComputeSharp.Graphics.Helpers;
diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs
index 4d8bf14d..befcc3c7 100644
--- a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs
+++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs
@@ -1,13 +1,9 @@
using System;
+using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Core.Extensions;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
-#if NET6_0_OR_GREATER
-using RuntimeHelpers = System.Runtime.CompilerServices.RuntimeHelpers;
-#else
-using RuntimeHelpers = ComputeSharp.NetStandard.RuntimeHelpers;
-#endif
#pragma warning disable CA1416
diff --git a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs
index ec13519f..8b038533 100644
--- a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs
+++ b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs
@@ -1,11 +1,7 @@
using System;
+using System.IO;
using System.Runtime.CompilerServices;
using TerraFX.Interop.Windows;
-#if NET6_0_OR_GREATER
-using Path = System.IO.Path;
-#else
-using Path = ComputeSharp.NetStandard.Path;
-#endif
#pragma warning disable IDE0011
diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs
index 4583f59b..51a6e390 100644
--- a/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs
@@ -2,6 +2,7 @@ using System;
using System.Buffers;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using ComputeSharp.Core.Helpers;
using ComputeSharp.Graphics.Commands.Interop;
using ComputeSharp.Graphics.Extensions;
@@ -14,11 +15,6 @@ using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_FEATURE;
using static TerraFX.Interop.DirectX.DXGI_FORMAT;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
-#if NET6_0_OR_GREATER
-using MemoryMarshal = System.Runtime.InteropServices.MemoryMarshal;
-#else
-using MemoryMarshal = ComputeSharp.NetStandard.MemoryMarshal;
-#endif
#pragma warning disable CA1063
diff --git a/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs
index 1ca213a0..7d03d63a 100644
--- a/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs
@@ -1,9 +1,5 @@
+using System;
using System.Diagnostics;
-#if NET6_0_OR_GREATER
-using GC = System.GC;
-#else
-using GC = ComputeSharp.NetStandard.GC;
-#endif
namespace ComputeSharp.Resources.Debug;
diff --git a/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs
index cee56bee..7cd6a601 100644
--- a/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs
@@ -1,9 +1,5 @@
+using System;
using System.Diagnostics;
-#if NET6_0_OR_GREATER
-using GC = System.GC;
-#else
-using GC = ComputeSharp.NetStandard.GC;
-#endif
namespace ComputeSharp.Resources.Debug;