Add IGraphicsResource interface

このコミットが含まれているのは:
Sergio Pedri committed 2022-01-06 22:54:55 +01:00
1 親 b1d0ffd030
コミット c5a31efd00
11ファイル変更
+28 -28

検索条件に一致するファイルはありません

+2 -4
ファイルの表示
@@ -24,7 +24,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed buffer stored on GPU memory.
/// </summary>
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
public unsafe abstract class Buffer<T> : NativeObject
public unsafe abstract class Buffer<T> : NativeObject, IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -122,9 +122,7 @@ public unsafe abstract class Buffer<T> : NativeObject
this.d3D12Resource.Get()->SetName(this);
}
/// <summary>
/// Gets the <see cref="ComputeSharp.GraphicsDevice"/> associated with the current instance.
/// </summary>
/// <inheritdoc/>
public GraphicsDevice GraphicsDevice { get; }
/// <summary>
+2 -4
ファイルの表示
@@ -24,7 +24,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed 2D texture stored on GPU memory.
/// </summary>
/// <typeparam name="T">The type of items stored on the texture.</typeparam>
public unsafe abstract class Texture2D<T> : NativeObject, GraphicsResourceHelper.IGraphicsResource
public unsafe abstract class Texture2D<T> : NativeObject, IGraphicsResource, GraphicsResourceHelper.IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -132,9 +132,7 @@ public unsafe abstract class Texture2D<T> : NativeObject, GraphicsResourceHelper
this.d3D12Resource.Get()->SetName(this);
}
/// <summary>
/// Gets the <see cref="ComputeSharp.GraphicsDevice"/> associated with the current instance.
/// </summary>
/// <inheritdoc/>
public GraphicsDevice GraphicsDevice { get; }
/// <summary>
+2 -4
ファイルの表示
@@ -24,7 +24,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed 3D texture stored on GPU memory.
/// </summary>
/// <typeparam name="T">The type of items stored on the texture.</typeparam>
public unsafe abstract class Texture3D<T> : NativeObject, GraphicsResourceHelper.IGraphicsResource
public unsafe abstract class Texture3D<T> : NativeObject, IGraphicsResource, GraphicsResourceHelper.IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -137,9 +137,7 @@ public unsafe abstract class Texture3D<T> : NativeObject, GraphicsResourceHelper
this.d3D12Resource.Get()->SetName(this);
}
/// <summary>
/// Gets the <see cref="ComputeSharp.GraphicsDevice"/> associated with the current instance.
/// </summary>
/// <inheritdoc/>
public GraphicsDevice GraphicsDevice { get; }
/// <summary>
+2 -4
ファイルの表示
@@ -15,7 +15,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed buffer stored on CPU memory, that can be used to transfer data to/from the GPU.
/// </summary>
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
public abstract unsafe class TransferBuffer<T> : NativeObject, IMemoryOwner<T>
public abstract unsafe class TransferBuffer<T> : NativeObject, IGraphicsResource, IMemoryOwner<T>
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -68,9 +68,7 @@ public abstract unsafe class TransferBuffer<T> : NativeObject, IMemoryOwner<T>
this.d3D12Resource.Get()->SetName(this);
}
/// <summary>
/// Gets the <see cref="ComputeSharp.GraphicsDevice"/> associated with the current instance.
/// </summary>
/// <inheritdoc/>
public GraphicsDevice GraphicsDevice { get; }
/// <summary>
+2 -4
ファイルの表示
@@ -15,7 +15,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed 2D texture stored on on CPU memory, that can be used to transfer data to/from the GPU.
/// </summary>
/// <typeparam name="T">The type of items stored on the texture.</typeparam>
public unsafe abstract class TransferTexture2D<T> : NativeObject
public unsafe abstract class TransferTexture2D<T> : NativeObject, IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -84,9 +84,7 @@ public unsafe abstract class TransferTexture2D<T> : NativeObject
this.d3D12Resource.Get()->SetName(this);
}
/// <summary>
/// Gets the <see cref="ComputeSharp.GraphicsDevice"/> associated with the current instance.
/// </summary>
/// <inheritdoc/>
public GraphicsDevice GraphicsDevice { get; }
/// <summary>
+2 -4
ファイルの表示
@@ -15,7 +15,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed 3D texture stored on on CPU memory, that can be used to transfer data to/from the GPU.
/// </summary>
/// <typeparam name="T">The type of items stored on the texture.</typeparam>
public unsafe abstract class TransferTexture3D<T> : NativeObject
public unsafe abstract class TransferTexture3D<T> : NativeObject, IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -87,9 +87,7 @@ public unsafe abstract class TransferTexture3D<T> : NativeObject
this.d3D12Resource.Get()->SetName(this);
}
/// <summary>
/// Gets the <see cref="ComputeSharp.GraphicsDevice"/> associated with the current instance.
/// </summary>
/// <inheritdoc/>
public GraphicsDevice GraphicsDevice { get; }
/// <summary>
+12
ファイルの表示
@@ -0,0 +1,12 @@
namespace ComputeSharp;
/// <summary>
/// An interface representing a graphics resource associated to a given <see cref="GraphicsDevice"/> instance.
/// </summary>
public interface IGraphicsResource
{
/// <summary>
/// Gets the <see cref="ComputeSharp.GraphicsDevice"/> instance associated with the current resource.
/// </summary>
GraphicsDevice GraphicsDevice { get; }
}
+1 -1
ファイルの表示
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadOnlyTexture2D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadOnlyTexture2D<TPixel>
public interface IReadOnlyTexture2D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>
+1 -1
ファイルの表示
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadOnlyTexture3D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadOnlyTexture3D<TPixel>
public interface IReadOnlyTexture3D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>
+1 -1
ファイルの表示
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadWriteTexture2D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadWriteTexture2D<TPixel>
public interface IReadWriteTexture2D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>
+1 -1
ファイルの表示
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadWriteTexture3D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadWriteTexture3D<TPixel>
public interface IReadWriteTexture3D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>