From 6f969f4a7f0193e3ad0ab76ef48262ef55e36b95 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 14 Aug 2019 00:10:17 +0200 Subject: [PATCH] Finished GraphicsDevice code refactoring --- src/ComputeSharp.Graphics/GraphicsDevice.cs | 53 ++++++++++++++++++--- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/src/ComputeSharp.Graphics/GraphicsDevice.cs b/src/ComputeSharp.Graphics/GraphicsDevice.cs index 19df8220..51f33d7e 100644 --- a/src/ComputeSharp.Graphics/GraphicsDevice.cs +++ b/src/ComputeSharp.Graphics/GraphicsDevice.cs @@ -24,6 +24,21 @@ namespace ComputeSharp.Graphics /// private readonly AutoResetEvent AutoResetEvent = new AutoResetEvent(false); + /// + /// The instance to use for compute operations + /// + private readonly CommandQueue NativeComputeCommandQueue; + + /// + /// The instance to use for copy operations + /// + private readonly CommandQueue NativeCopyCommandQueue; + + /// + /// The instance to use for direct operations + /// + private readonly CommandQueue NativeDirectCommandQueue; + /// /// Creates a new instance for the input /// @@ -70,30 +85,56 @@ namespace ComputeSharp.Graphics /// internal DescriptorAllocator ShaderResourceViewAllocator { get; set; } + /// + /// Gets the instance for compute operations + /// internal CommandAllocatorPool ComputeAllocatorPool { get; } + /// + /// Gets the instance for copy operations + /// internal CommandAllocatorPool CopyAllocatorPool { get; } + /// + /// Gets the instance for direct operations + /// internal CommandAllocatorPool DirectAllocatorPool { get; } - internal CommandQueue NativeComputeCommandQueue { get; } - - internal CommandQueue NativeCopyCommandQueue { get; } - - internal CommandQueue NativeDirectCommandQueue { get; } - + /// + /// Gets the instance used for compute operations + /// internal Fence NativeComputeFence { get; } + /// + /// Gets the instance used for copy operations + /// internal Fence NativeCopyFence { get; } + /// + /// Gets the instance used for direct operations + /// internal Fence NativeDirectFence { get; } + /// + /// Gets the next fence value for compute operations + /// internal long NextComputeFenceValue { get; private set; } = 1; + /// + /// Gets the next fence value for copy operations + /// internal long NextCopyFenceValue { get; private set; } = 1; + /// + /// Gets the next fence value for direct operations + /// internal long NextDirectFenceValue { get; private set; } = 1; + /// + /// Creates a instance from a description + /// + /// A instance with the info for the new object to create + /// A new instance to use in a compute shader public RootSignature CreateRootSignature(RootSignatureDescription rootSignatureDescription) { return NativeDevice.CreateRootSignature(rootSignatureDescription.Serialize());