From 4ae42a2be5b667fc5aaaf031c6b1656311f1f90c Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 20 Nov 2020 12:26:18 +0100 Subject: [PATCH] Added ToString() override for GraphicsDevice --- src/ComputeSharp.Graphics/GraphicsDevice.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.Graphics/GraphicsDevice.cs b/src/ComputeSharp.Graphics/GraphicsDevice.cs index c162150c..a74b2c31 100644 --- a/src/ComputeSharp.Graphics/GraphicsDevice.cs +++ b/src/ComputeSharp.Graphics/GraphicsDevice.cs @@ -1,4 +1,5 @@ -using System.Runtime.CompilerServices; +using System.Diagnostics; +using System.Runtime.CompilerServices; using ComputeSharp.Core.Extensions; using ComputeSharp.Core.Helpers; using ComputeSharp.Core.Interop; @@ -13,6 +14,7 @@ namespace ComputeSharp.Graphics /// /// A that represents a DX12.1-compatible GPU device that can be used to run compute shaders. /// + [DebuggerDisplay("{ToString(),raw}")] public sealed unsafe class GraphicsDevice : NativeObject { /// @@ -209,5 +211,11 @@ namespace ComputeSharp.Graphics this.copyCommandAllocatorPool.Dispose(); this.shaderResourceViewDescriptorAllocator.Dispose(); } + + /// + public override string ToString() + { + return $"[{Luid}] {Name}"; + } } }