Added dispatch helpers for normalized texture interfaces

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-06 17:28:55 +01:00
1 親 226481aff6
コミット 958fa15a11
5ファイル変更
+152 -16

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

+13 -1
ファイルの表示
@@ -1,4 +1,5 @@
using System.Runtime.CompilerServices;
using ComputeSharp.__Internals;
using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Commands;
using ComputeSharp.Graphics.Extensions;
@@ -15,13 +16,15 @@ using static TerraFX.Interop.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.D3D12_UAV_DIMENSION;
using FX = TerraFX.Interop.Windows;
#pragma warning disable CS0618
namespace ComputeSharp.Resources
{
/// <summary>
/// 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
public unsafe abstract class Texture2D<T> : NativeObject, GraphicsResourceHelper.IGraphicsResource
where T : unmanaged
{
/// <summary>
@@ -281,5 +284,14 @@ namespace ComputeSharp.Resources
GraphicsDeviceMismatchException.Throw(this, device);
}
}
/// <inheritdoc/>
D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device)
{
ThrowIfDisposed();
ThrowIfDeviceMismatch(device);
return D3D12GpuDescriptorHandle;
}
}
}
+13 -1
ファイルの表示
@@ -1,4 +1,5 @@
using System.Runtime.CompilerServices;
using ComputeSharp.__Internals;
using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Commands;
using ComputeSharp.Graphics.Extensions;
@@ -15,13 +16,15 @@ using static TerraFX.Interop.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.D3D12_UAV_DIMENSION;
using FX = TerraFX.Interop.Windows;
#pragma warning disable CS0618
namespace ComputeSharp.Resources
{
/// <summary>
/// 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
public unsafe abstract class Texture3D<T> : NativeObject, GraphicsResourceHelper.IGraphicsResource
where T : unmanaged
{
/// <summary>
@@ -304,5 +307,14 @@ namespace ComputeSharp.Resources
GraphicsDeviceMismatchException.Throw(this, device);
}
}
/// <inheritdoc/>
D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device)
{
ThrowIfDisposed();
ThrowIfDeviceMismatch(device);
return D3D12GpuDescriptorHandle;
}
}
}