Added more texture type validation APIs
このコミットが含まれているのは:
1 親
345cd58d19
コミット
7629dee8c0
13ファイル変更
+68
-26
検索条件に一致するファイルはありません
@@ -10,7 +10,6 @@ using ComputeSharp.Interop;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using TerraFX.Interop;
|
||||
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
using static TerraFX.Interop.D3D12_RESOURCE_STATES;
|
||||
using static TerraFX.Interop.D3D12_SRV_DIMENSION;
|
||||
using static TerraFX.Interop.D3D12_UAV_DIMENSION;
|
||||
@@ -60,14 +59,15 @@ namespace ComputeSharp.Resources
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="resourceType">The resource type for the current texture.</param>
|
||||
private protected Texture2D(GraphicsDevice device, int width, int height, ResourceType resourceType)
|
||||
/// <param name="d3D12FormatSupport">The format support for the current texture type.</param>
|
||||
private protected Texture2D(GraphicsDevice device, int width, int height, ResourceType resourceType, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport)
|
||||
{
|
||||
device.ThrowIfDisposed();
|
||||
|
||||
Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
|
||||
Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
|
||||
|
||||
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE2D))
|
||||
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
|
||||
{
|
||||
UnsupportedTextureTypeException.ThrowForTexture2D<T>();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ using ComputeSharp.Interop;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using TerraFX.Interop;
|
||||
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
using static TerraFX.Interop.D3D12_RESOURCE_STATES;
|
||||
using static TerraFX.Interop.D3D12_SRV_DIMENSION;
|
||||
using static TerraFX.Interop.D3D12_UAV_DIMENSION;
|
||||
@@ -61,7 +60,8 @@ namespace ComputeSharp.Resources
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <param name="resourceType">The resource type for the current texture.</param>
|
||||
private protected Texture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType)
|
||||
/// <param name="d3D12FormatSupport">The format support for the current texture type.</param>
|
||||
private protected Texture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport)
|
||||
{
|
||||
device.ThrowIfDisposed();
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace ComputeSharp.Resources
|
||||
Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
|
||||
Guard.IsBetweenOrEqualTo(depth, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
|
||||
|
||||
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE2D))
|
||||
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
|
||||
{
|
||||
UnsupportedTextureTypeException.ThrowForTexture2D<T>();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
|
||||
@@ -27,7 +28,7 @@ namespace ComputeSharp
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height)
|
||||
: base(device, width, height, ResourceType.ReadOnly)
|
||||
: base(device, width, height, ResourceType.ReadOnly, D3D12_FORMAT_SUPPORT1_TEXTURE2D)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -22,7 +23,7 @@ namespace ComputeSharp
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height)
|
||||
: base(device, width, height, ResourceType.ReadOnly)
|
||||
: base(device, width, height, ResourceType.ReadOnly, D3D12_FORMAT_SUPPORT1_TEXTURE2D)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
|
||||
@@ -28,7 +29,7 @@ namespace ComputeSharp
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth)
|
||||
: base(device, width, height, depth, ResourceType.ReadOnly)
|
||||
: base(device, width, height, depth, ResourceType.ReadOnly, D3D12_FORMAT_SUPPORT1_TEXTURE3D)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -23,7 +24,7 @@ namespace ComputeSharp
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth)
|
||||
: base(device, width, height, depth, ResourceType.ReadOnly)
|
||||
: base(device, width, height, depth, ResourceType.ReadOnly, D3D12_FORMAT_SUPPORT1_TEXTURE3D)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
|
||||
@@ -27,7 +28,7 @@ namespace ComputeSharp
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
internal ReadWriteTexture2D(GraphicsDevice device, int width, int height)
|
||||
: base(device, width, height, ResourceType.ReadWrite)
|
||||
: base(device, width, height, ResourceType.ReadWrite, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -22,7 +23,7 @@ namespace ComputeSharp
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
internal ReadWriteTexture2D(GraphicsDevice device, int width, int height)
|
||||
: base(device, width, height, ResourceType.ReadWrite)
|
||||
: base(device, width, height, ResourceType.ReadWrite, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
|
||||
@@ -28,7 +29,7 @@ namespace ComputeSharp
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth)
|
||||
: base(device, width, height, depth, ResourceType.ReadWrite)
|
||||
: base(device, width, height, depth, ResourceType.ReadWrite, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Views;
|
||||
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -23,7 +24,7 @@ namespace ComputeSharp
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth)
|
||||
: base(device, width, height, depth, ResourceType.ReadWrite)
|
||||
: base(device, width, height, depth, ResourceType.ReadWrite, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする