From 8d0f17e01d8b06fac6c25c15ef7826dcabcf88c9 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 14 Aug 2019 00:06:20 +0200 Subject: [PATCH] Removed unnecessary code --- .../Commands/CommandAllocatorPool.cs | 3 +-- src/ComputeSharp.Graphics/Commands/CommandList.cs | 8 ++------ src/ComputeSharp.Graphics/GraphicsDevice.cs | 4 ---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/ComputeSharp.Graphics/Commands/CommandAllocatorPool.cs b/src/ComputeSharp.Graphics/Commands/CommandAllocatorPool.cs index 28fadec8..a5bcb7a0 100644 --- a/src/ComputeSharp.Graphics/Commands/CommandAllocatorPool.cs +++ b/src/ComputeSharp.Graphics/Commands/CommandAllocatorPool.cs @@ -46,11 +46,10 @@ namespace ComputeSharp.Graphics.Commands long completedValue = CommandListType switch { - CommandListType.Bundle => GraphicsDevice.NativeDirectFence.CompletedValue, CommandListType.Compute => GraphicsDevice.NativeComputeFence.CompletedValue, CommandListType.Copy => GraphicsDevice.NativeCopyFence.CompletedValue, CommandListType.Direct => GraphicsDevice.NativeDirectFence.CompletedValue, - _ => throw new NotSupportedException("This command list type is not supported.") + _ => throw new NotSupportedException($"Unsupported command list type with value {CommandListType}") }; if (fenceValue <= completedValue) diff --git a/src/ComputeSharp.Graphics/Commands/CommandList.cs b/src/ComputeSharp.Graphics/Commands/CommandList.cs index 175f3717..b26c690f 100644 --- a/src/ComputeSharp.Graphics/Commands/CommandList.cs +++ b/src/ComputeSharp.Graphics/Commands/CommandList.cs @@ -15,11 +15,10 @@ namespace ComputeSharp.Graphics.Commands { CommandAllocator = CommandListType switch { - CommandListType.Bundle => GraphicsDevice.BundleAllocatorPool.GetCommandAllocator(), CommandListType.Compute => GraphicsDevice.ComputeAllocatorPool.GetCommandAllocator(), CommandListType.Copy => GraphicsDevice.CopyAllocatorPool.GetCommandAllocator(), CommandListType.Direct => GraphicsDevice.DirectAllocatorPool.GetCommandAllocator(), - _ => throw new NotSupportedException("This command list type is not supported.") + _ => throw new NotSupportedException($"Unsupported command list type with value {CommandListType}") }; NativeCommandList = GraphicsDevice.NativeDevice.CreateCommandList(CommandListType, CommandAllocator, null); @@ -105,9 +104,6 @@ namespace ComputeSharp.Graphics.Commands { switch (CommandListType) { - case CommandListType.Bundle: - GraphicsDevice.BundleAllocatorPool.Enqueue(CommandAllocator, GraphicsDevice.NextDirectFenceValue - 1); - break; case CommandListType.Direct: GraphicsDevice.DirectAllocatorPool.Enqueue(CommandAllocator, GraphicsDevice.NextDirectFenceValue - 1); break; @@ -118,7 +114,7 @@ namespace ComputeSharp.Graphics.Commands GraphicsDevice.CopyAllocatorPool.Enqueue(CommandAllocator, GraphicsDevice.NextCopyFenceValue - 1); break; default: - throw new NotSupportedException("This command list type is not supported."); + throw new NotSupportedException($"Unsupported command list type with value {CommandListType}"); } NativeCommandList.Dispose(); diff --git a/src/ComputeSharp.Graphics/GraphicsDevice.cs b/src/ComputeSharp.Graphics/GraphicsDevice.cs index 5cc3f424..19df8220 100644 --- a/src/ComputeSharp.Graphics/GraphicsDevice.cs +++ b/src/ComputeSharp.Graphics/GraphicsDevice.cs @@ -39,7 +39,6 @@ namespace ComputeSharp.Graphics NativeCopyCommandQueue = NativeDevice.CreateCommandQueue(new CommandQueueDescription(CommandListType.Copy)); NativeDirectCommandQueue = NativeDevice.CreateCommandQueue(new CommandQueueDescription(CommandListType.Direct)); - BundleAllocatorPool = new CommandAllocatorPool(this, CommandListType.Bundle); ComputeAllocatorPool = new CommandAllocatorPool(this, CommandListType.Compute); CopyAllocatorPool = new CommandAllocatorPool(this, CommandListType.Copy); DirectAllocatorPool = new CommandAllocatorPool(this, CommandListType.Direct); @@ -71,8 +70,6 @@ namespace ComputeSharp.Graphics /// internal DescriptorAllocator ShaderResourceViewAllocator { get; set; } - internal CommandAllocatorPool BundleAllocatorPool { get; } - internal CommandAllocatorPool ComputeAllocatorPool { get; } internal CommandAllocatorPool CopyAllocatorPool { get; } @@ -183,7 +180,6 @@ namespace ComputeSharp.Graphics ShaderResourceViewAllocator.Dispose(); - BundleAllocatorPool.Dispose(); ComputeAllocatorPool.Dispose(); CopyAllocatorPool.Dispose(); DirectAllocatorPool.Dispose();