diff --git a/README.md b/README.md
index 6c05650f..f737f4e0 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
# What is it?
-**ComputeSharp** is a .NET Standard 2.0 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders. The available APIs let you allocate GPU buffers and write compute shaders as simple lambda expressions or local methods, with all the captured variables being handled automatically and passed to the running shader.
+**ComputeSharp** is a .NET Standard 2.1 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders. The available APIs let you allocate GPU buffers and write compute shaders as simple lambda expressions or local methods, with all the captured variables being handled automatically and passed to the running shader.
# Table of Contents
@@ -83,9 +83,9 @@ yBuffer.GetData(y);
# Requirements
-The **ComputeSharp** library requires .NET Standard 2.0 support, and it is available for Windows applications targeting:
-- .NET Core >= 2.0
-- .NET Framework >= 4.6.1
+The **ComputeSharp** library requires .NET Standard 2.1 support, and it is available for applications targeting:
+- .NET Core >= 3.0
+- Windows (x86 or x64)
Additionally, you need an IDE with .NET Core 3.0 and C# 8.0 support to compile the library and samples on your PC.
diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj
index 9147a851..f45bdfcc 100644
--- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj
+++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj
@@ -1,11 +1,7 @@
- netstandard2.0
+ netstandard2.1
-
-
-
-
diff --git a/src/ComputeSharp.Graphics/Buffers/Extensions/BufferExtensions.cs b/src/ComputeSharp.Graphics/Buffers/Extensions/BufferExtensions.cs
index 681f6bbc..85f0c8fd 100644
--- a/src/ComputeSharp.Graphics/Buffers/Extensions/BufferExtensions.cs
+++ b/src/ComputeSharp.Graphics/Buffers/Extensions/BufferExtensions.cs
@@ -35,13 +35,11 @@ namespace ComputeSharp
/// A constant instance with the contents of the input 2D array
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static unsafe ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged
+ public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged
{
- fixed (T* p = array)
- {
- Span span = new Span(p, array.Length);
- return device.AllocateConstantBuffer(span);
- }
+ Span span = MemoryMarshal.CreateSpan(ref array[0, 0], array.Length);
+
+ return device.AllocateConstantBuffer(span);
}
///
@@ -115,13 +113,11 @@ namespace ComputeSharp
/// A read write instance with the contents of the input 2D array
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static unsafe ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged
+ public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged
{
- fixed (T* p = array)
- {
- Span span = new Span(p, array.Length);
- return device.AllocateReadOnlyBuffer(span);
- }
+ Span span = MemoryMarshal.CreateSpan(ref array[0, 0], array.Length);
+
+ return device.AllocateReadOnlyBuffer(span);
}
///
@@ -195,13 +191,11 @@ namespace ComputeSharp
/// A read write instance with the contents of the input 2D array
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static unsafe ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged
+ public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged
{
- fixed (T* p = array)
- {
- Span span = new Span(p, array.Length);
- return device.AllocateReadWriteBuffer(span);
- }
+ Span span = MemoryMarshal.CreateSpan(ref array[0, 0], array.Length);
+
+ return device.AllocateReadWriteBuffer(span);
}
///
diff --git a/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj b/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj
index 5dc565b5..c9360703 100644
--- a/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj
+++ b/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj
@@ -1,14 +1,13 @@
- netstandard2.0
+ netstandard2.1
8.0
enable
true
-
diff --git a/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj b/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj
index e4c54147..d637e7d3 100644
--- a/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj
+++ b/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj
@@ -1,10 +1,9 @@
- netstandard2.0
+ netstandard2.1
8.0
enable
- true
diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj
index 47b844e8..a4f15ee8 100644
--- a/src/ComputeSharp/ComputeSharp.csproj
+++ b/src/ComputeSharp/ComputeSharp.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.1
8.0
enable
diff --git a/src/ComputeSharp/ComputeSharp.nuspec b/src/ComputeSharp/ComputeSharp.nuspec
index 1f2e056e..c4d67772 100644
--- a/src/ComputeSharp/ComputeSharp.nuspec
+++ b/src/ComputeSharp/ComputeSharp.nuspec
@@ -2,7 +2,7 @@
ComputeSharp
- 1.0.0-alpha2+60426c5
+ 1.0.0
ComputeSharp
Sergio Pedri
Sergio Pedri
@@ -14,11 +14,9 @@
Initial alpha release
Copyright (c) 2019 Sergio Pedri
dotnet net netcore netstandard csharp library graphics shader hlsl compute gpu
-
+
-
-