Added more texture type validation APIs

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-15 20:16:48 +01:00
1 親 345cd58d19
コミット 7629dee8c0
13ファイル変更
+68 -26

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

+42 -8
ファイルの表示
@@ -152,13 +152,13 @@ namespace ComputeSharp
internal bool IsCacheCoherentUMA { get; }
/// <summary>
/// Checks whether the current device supports the creation of <see cref="Resources.Texture2D{T}"/>
/// resources for a specified type <typeparamref name="T"/>.
/// Checks whether the current device supports the creation of
/// <see cref="ReadOnlyTexture2D{T}"/> resources for a specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of values to check support for.</typeparam>
/// <returns>Whether <see cref="Resources.Texture2D{T}"/> instances can be created by the current device.</returns>
/// <returns>Whether <see cref="ReadOnlyTexture2D{T}"/> instances can be created by the current device.</returns>
[Pure]
public bool IsTexture2DSupportedForType<T>()
public bool IsReadOnlyTexture2DSupportedForType<T>()
where T : unmanaged
{
ThrowIfDisposed();
@@ -167,13 +167,30 @@ namespace ComputeSharp
}
/// <summary>
/// Checks whether the current device supports the creation of <see cref="Resources.Texture3D{T}"/>
/// resources for a specified type <typeparamref name="T"/>.
/// Checks whether the current device supports the creation of
/// <see cref="ReadWriteTexture2D{T}"/> resources for a specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of values to check support for.</typeparam>
/// <returns>Whether <see cref="Resources.Texture3D{T}"/> instances can be created by the current device.</returns>
/// <returns>Whether <see cref="ReadWriteTexture2D{T}"/> instances can be created by the current device.</returns>
[Pure]
public bool IsTexture3DSupportedForType<T>()
public bool IsReadWriteTexture2DSupportedForType<T>()
where T : unmanaged
{
ThrowIfDisposed();
return this.d3D12Device.Get()->IsDxgiFormatSupported(
DXGIFormatHelper.GetForType<T>(),
D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW);
}
/// <summary>
/// Checks whether the current device supports the creation of
/// <see cref="ReadOnlyTexture3D{T}"/> resources for a specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of values to check support for.</typeparam>
/// <returns>Whether <see cref="ReadOnlyTexture3D{T}"/> instances can be created by the current device.</returns>
[Pure]
public bool IsReadOnlyTexture3DSupportedForType<T>()
where T : unmanaged
{
ThrowIfDisposed();
@@ -181,6 +198,23 @@ namespace ComputeSharp
return this.d3D12Device.Get()->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE3D);
}
/// <summary>
/// Checks whether the current device supports the creation of
/// <see cref="ReadWriteTexture3D{T}"/> resources for a specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of values to check support for.</typeparam>
/// <returns>Whether <see cref="ReadWriteTexture3D{T}"/> instances can be created by the current device.</returns>
[Pure]
public bool IsReadWriteTexture3DSupportedForType<T>()
where T : unmanaged
{
ThrowIfDisposed();
return this.d3D12Device.Get()->IsDxgiFormatSupported(
DXGIFormatHelper.GetForType<T>(),
D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW);
}
/// <inheritdoc cref="ID3D12DescriptorHandleAllocator.Rent"/>
internal void RentShaderResourceViewDescriptorHandles(
out D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle,