From 9b69b65ad752409b0cd4063dd29acbd0563b802c Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 12 Aug 2019 14:22:29 +0200 Subject: [PATCH] Moved Gpu class to the main ComputeSharp project --- src/ComputeSharp/ComputeSharp.csproj | 7 ++++++- .../Gpu.cs | 9 +++++++-- .../DirectX12ComputeShaderSample.csproj | 3 +-- 3 files changed, 14 insertions(+), 5 deletions(-) rename src/{DirectX12ComputeShaderSample => ComputeSharp}/Gpu.cs (88%) diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj index 50891f1b..57aeb7e6 100644 --- a/src/ComputeSharp/ComputeSharp.csproj +++ b/src/ComputeSharp/ComputeSharp.csproj @@ -2,7 +2,8 @@ netstandard2.0 - true + 8.0 + enable @@ -12,4 +13,8 @@ + + + + diff --git a/src/DirectX12ComputeShaderSample/Gpu.cs b/src/ComputeSharp/Gpu.cs similarity index 88% rename from src/DirectX12ComputeShaderSample/Gpu.cs rename to src/ComputeSharp/Gpu.cs index 970ae4b7..2992cc39 100644 --- a/src/DirectX12ComputeShaderSample/Gpu.cs +++ b/src/ComputeSharp/Gpu.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using ComputeSharp; using ComputeSharp.Graphics; using ComputeSharp.Shaders; using ComputeSharp.Shaders.Renderer; @@ -10,12 +9,18 @@ using CommandList = ComputeSharp.Graphics.CommandList; using PipelineState = ComputeSharp.Graphics.PipelineState; using ShaderBytecode = SharpDX.Direct3D12.ShaderBytecode; -namespace DirectX12ComputeShaderSample +namespace ComputeSharp { + /// + /// A that acts as an entry-point for all the library APIs, exposing the available GPU devices + /// public static class Gpu { private static GraphicsDevice _Default; + /// + /// Gets the default instance for the current machine + /// public static GraphicsDevice Default => _Default ??= new GraphicsDevice(true); } diff --git a/src/DirectX12ComputeShaderSample/DirectX12ComputeShaderSample.csproj b/src/DirectX12ComputeShaderSample/DirectX12ComputeShaderSample.csproj index a9e9535e..33fc9464 100644 --- a/src/DirectX12ComputeShaderSample/DirectX12ComputeShaderSample.csproj +++ b/src/DirectX12ComputeShaderSample/DirectX12ComputeShaderSample.csproj @@ -6,8 +6,7 @@ - - +