diff --git a/src/ComputeSharp.Shaders/Translation/Models/DispatchData.cs b/src/ComputeSharp.Shaders/Translation/Models/DispatchData.cs index c47050ba..249a3279 100644 --- a/src/ComputeSharp.Shaders/Translation/Models/DispatchData.cs +++ b/src/ComputeSharp.Shaders/Translation/Models/DispatchData.cs @@ -54,16 +54,10 @@ namespace ComputeSharp.Shaders.Translation.Models [MethodImpl(MethodImplOptions.AggressiveInlining)] get { -#if NET5_0 ref ulong r0 = ref MemoryMarshal.GetArrayDataReference(this.resourcesArray); ref D3D12_GPU_DESCRIPTOR_HANDLE r1 = ref Unsafe.As(ref r0); return MemoryMarshal.CreateReadOnlySpan(ref r1, this.resourcesCount); -#else - Span span = this.resourcesArray.AsSpan(0, this.resourcesCount); - - return MemoryMarshal.Cast(span); -#endif } } @@ -75,17 +69,11 @@ namespace ComputeSharp.Shaders.Translation.Models [MethodImpl(MethodImplOptions.AggressiveInlining)] get { -#if NET5_0 ref byte r0 = ref MemoryMarshal.GetArrayDataReference(this.variablesArray); ref uint r1 = ref Unsafe.As(ref r0); int length = (int)((uint)this.variablesByteSize / sizeof(uint)); return MemoryMarshal.CreateReadOnlySpan(ref r1, length); -#else - Span span = this.variablesArray.AsSpan(0, this.variablesByteSize); - - return MemoryMarshal.Cast(span); -#endif } } diff --git a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.LibraryLoading.cs b/src/ComputeSharp.Shaders/Translation/ShaderCompiler.LibraryLoading.cs index 9b860505..61d2b051 100644 --- a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.LibraryLoading.cs +++ b/src/ComputeSharp.Shaders/Translation/ShaderCompiler.LibraryLoading.cs @@ -1,9 +1,7 @@ -#if NET5_0 -using System; +using System; using System.IO; using System.Runtime.InteropServices; using FX = TerraFX.Interop.Windows; -#endif namespace ComputeSharp.Shaders.Translation { @@ -15,7 +13,6 @@ namespace ComputeSharp.Shaders.Translation /// private static void InitializeDxcLibrariesLoading() { -#if NET5_0 // Test whether the native libraries are present in the same folder of the executable // (which is the case when the program was built with a runtime identifier), or whether // they are in the "runtimes\win-x64\native" folder in the executable directory. @@ -60,7 +57,6 @@ namespace ComputeSharp.Shaders.Translation return IntPtr.Zero; }; -#endif } } } diff --git a/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs b/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs index ae58b6b7..c320577c 100644 --- a/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs +++ b/src/ComputeSharp/Extensions/Buffers/Texture2DExtensions.cs @@ -55,7 +55,6 @@ 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. /// @@ -69,7 +68,6 @@ 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. @@ -100,7 +98,6 @@ 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. /// @@ -115,7 +112,6 @@ 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. @@ -147,7 +143,6 @@ 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 . /// @@ -164,7 +159,6 @@ 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 . @@ -209,7 +203,6 @@ 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. /// @@ -223,7 +216,6 @@ namespace ComputeSharp { texture.SetData(source.AsSpan(), x, y); } -#endif /// /// Writes the contents of a given array to a specified area of the current instance. @@ -241,7 +233,6 @@ 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. /// @@ -256,7 +247,6 @@ 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. @@ -288,7 +278,6 @@ 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. /// @@ -305,7 +294,6 @@ 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 6c16d91a..796623d1 100644 --- a/src/ComputeSharp/Extensions/Buffers/Texture3DExtensions.cs +++ b/src/ComputeSharp/Extensions/Buffers/Texture3DExtensions.cs @@ -66,7 +66,6 @@ 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. /// @@ -82,7 +81,6 @@ 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. @@ -115,7 +113,6 @@ 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 . /// @@ -134,7 +131,6 @@ 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 . @@ -186,7 +182,6 @@ 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. /// @@ -201,7 +196,6 @@ 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. @@ -221,7 +215,6 @@ 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. /// @@ -237,7 +230,6 @@ 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. @@ -271,7 +263,6 @@ 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. /// @@ -290,7 +281,6 @@ 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.