diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs
index 06992782..e15f3cea 100644
--- a/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs
@@ -24,7 +24,7 @@ namespace ComputeSharp.Resources;
/// A representing a typed buffer stored on GPU memory.
///
/// The type of items stored on the buffer.
-public unsafe abstract class Buffer : NativeObject
+public unsafe abstract class Buffer : NativeObject, IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -122,9 +122,7 @@ public unsafe abstract class Buffer : NativeObject
this.d3D12Resource.Get()->SetName(this);
}
- ///
- /// Gets the associated with the current instance.
- ///
+ ///
public GraphicsDevice GraphicsDevice { get; }
///
diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs
index 3b828db5..2e5f35b1 100644
--- a/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs
@@ -24,7 +24,7 @@ namespace ComputeSharp.Resources;
/// A representing a typed 2D texture stored on GPU memory.
///
/// The type of items stored on the texture.
-public unsafe abstract class Texture2D : NativeObject, GraphicsResourceHelper.IGraphicsResource
+public unsafe abstract class Texture2D : NativeObject, IGraphicsResource, GraphicsResourceHelper.IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -132,9 +132,7 @@ public unsafe abstract class Texture2D : NativeObject, GraphicsResourceHelper
this.d3D12Resource.Get()->SetName(this);
}
- ///
- /// Gets the associated with the current instance.
- ///
+ ///
public GraphicsDevice GraphicsDevice { get; }
///
diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs
index 55d913df..ddfda4af 100644
--- a/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs
@@ -24,7 +24,7 @@ namespace ComputeSharp.Resources;
/// A representing a typed 3D texture stored on GPU memory.
///
/// The type of items stored on the texture.
-public unsafe abstract class Texture3D : NativeObject, GraphicsResourceHelper.IGraphicsResource
+public unsafe abstract class Texture3D : NativeObject, IGraphicsResource, GraphicsResourceHelper.IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -137,9 +137,7 @@ public unsafe abstract class Texture3D : NativeObject, GraphicsResourceHelper
this.d3D12Resource.Get()->SetName(this);
}
- ///
- /// Gets the associated with the current instance.
- ///
+ ///
public GraphicsDevice GraphicsDevice { get; }
///
diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs
index 04bb5bfd..b9478f5f 100644
--- a/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs
@@ -15,7 +15,7 @@ namespace ComputeSharp.Resources;
/// A representing a typed buffer stored on CPU memory, that can be used to transfer data to/from the GPU.
///
/// The type of items stored on the buffer.
-public abstract unsafe class TransferBuffer : NativeObject, IMemoryOwner
+public abstract unsafe class TransferBuffer : NativeObject, IGraphicsResource, IMemoryOwner
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -68,9 +68,7 @@ public abstract unsafe class TransferBuffer : NativeObject, IMemoryOwner
this.d3D12Resource.Get()->SetName(this);
}
- ///
- /// Gets the associated with the current instance.
- ///
+ ///
public GraphicsDevice GraphicsDevice { get; }
///
diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs
index dd94a193..24d274b2 100644
--- a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs
@@ -15,7 +15,7 @@ namespace ComputeSharp.Resources;
/// A representing a typed 2D texture stored on on CPU memory, that can be used to transfer data to/from the GPU.
///
/// The type of items stored on the texture.
-public unsafe abstract class TransferTexture2D : NativeObject
+public unsafe abstract class TransferTexture2D : NativeObject, IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -84,9 +84,7 @@ public unsafe abstract class TransferTexture2D : NativeObject
this.d3D12Resource.Get()->SetName(this);
}
- ///
- /// Gets the associated with the current instance.
- ///
+ ///
public GraphicsDevice GraphicsDevice { get; }
///
diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs
index 20c7adb9..c939db0a 100644
--- a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs
@@ -15,7 +15,7 @@ namespace ComputeSharp.Resources;
/// A representing a typed 3D texture stored on on CPU memory, that can be used to transfer data to/from the GPU.
///
/// The type of items stored on the texture.
-public unsafe abstract class TransferTexture3D : NativeObject
+public unsafe abstract class TransferTexture3D : NativeObject, IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -87,9 +87,7 @@ public unsafe abstract class TransferTexture3D : NativeObject
this.d3D12Resource.Get()->SetName(this);
}
- ///
- /// Gets the associated with the current instance.
- ///
+ ///
public GraphicsDevice GraphicsDevice { get; }
///
diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IGraphicsResource.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IGraphicsResource.cs
new file mode 100644
index 00000000..b55614d9
--- /dev/null
+++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IGraphicsResource.cs
@@ -0,0 +1,12 @@
+namespace ComputeSharp;
+
+///
+/// An interface representing a graphics resource associated to a given instance.
+///
+public interface IGraphicsResource
+{
+ ///
+ /// Gets the instance associated with the current resource.
+ ///
+ GraphicsDevice GraphicsDevice { get; }
+}
diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs
index 085a81c8..367d8dd1 100644
--- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap instances.
///
/// The type of normalized pixels used on the GPU side.
-public interface IReadOnlyTexture2D
+public interface IReadOnlyTexture2D : IGraphicsResource
where TPixel : unmanaged
{
///
diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs
index 04625bd5..7a92ae62 100644
--- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap instances.
///
/// The type of normalized pixels used on the GPU side.
-public interface IReadOnlyTexture3D
+public interface IReadOnlyTexture3D : IGraphicsResource
where TPixel : unmanaged
{
///
diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs
index aaa76334..e9938395 100644
--- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap instances.
///
/// The type of normalized pixels used on the GPU side.
-public interface IReadWriteTexture2D
+public interface IReadWriteTexture2D : IGraphicsResource
where TPixel : unmanaged
{
///
diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs
index af43c3dc..746fec0d 100644
--- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs
+++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap instances.
///
/// The type of normalized pixels used on the GPU side.
-public interface IReadWriteTexture3D
+public interface IReadWriteTexture3D : IGraphicsResource
where TPixel : unmanaged
{
///