Fix base type of custom NotSupportedException types
このコミットが含まれているのは:
1 親
89da6ebe30
コミット
b1fb409f73
4ファイル変更
+10
-10
検索条件に一致するファイルはありません
@@ -4,15 +4,15 @@ using System.Text;
|
||||
namespace ComputeSharp.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// A custom <see cref="InvalidOperationException"/> that indicates when a resource was attempted to be created with an unsupported type.
|
||||
/// A custom <see cref="NotSupportedException"/> that indicates when a resource was attempted to be created with an unsupported type.
|
||||
/// </summary>
|
||||
public sealed class UnsupportedDoubleOperationsException : InvalidOperationException
|
||||
public sealed class UnsupportedDoubleOperationException : NotSupportedException
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="UnsupportedDoubleOperationsException"/> instance.
|
||||
/// Creates a new <see cref="UnsupportedDoubleOperationException"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="message">The message that describes the error.</param>
|
||||
private UnsupportedDoubleOperationsException(string message)
|
||||
private UnsupportedDoubleOperationException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public sealed class UnsupportedDoubleOperationsException : InvalidOperationExcep
|
||||
/// </summary>
|
||||
/// <param name="type">The element type of resource that was being created.</param>
|
||||
/// <returns>A new <see cref="UnsupportedTextureTypeException"/> instance with a formatted error message.</returns>
|
||||
private static UnsupportedDoubleOperationsException Create(Type type)
|
||||
private static UnsupportedDoubleOperationException Create(Type type)
|
||||
{
|
||||
StringBuilder builder = new(256);
|
||||
|
||||
@@ -35,7 +35,7 @@ public sealed class UnsupportedDoubleOperationsException : InvalidOperationExcep
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Throws a new <see cref="UnsupportedDoubleOperationsException"/> instance from the specified parameters.
|
||||
/// Throws a new <see cref="UnsupportedDoubleOperationException"/> instance from the specified parameters.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of values in the resource that couldn't be created.</typeparam>
|
||||
internal static void Throw<T>()
|
||||
|
||||
@@ -5,9 +5,9 @@ using Microsoft.Toolkit.Diagnostics;
|
||||
namespace ComputeSharp.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// A custom <see cref="InvalidOperationException"/> that indicates when a texture was attempted to be created with an unsupported type.
|
||||
/// A custom <see cref="NotSupportedException"/> that indicates when a texture was attempted to be created with an unsupported type.
|
||||
/// </summary>
|
||||
public sealed class UnsupportedTextureTypeException : InvalidOperationException
|
||||
public sealed class UnsupportedTextureTypeException : NotSupportedException
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="UnsupportedTextureTypeException"/> instance.
|
||||
|
||||
@@ -79,7 +79,7 @@ public unsafe abstract class Buffer<T> : NativeObject, IGraphicsResource
|
||||
if (TypeInfo<T>.IsDoubleOrContainsDoubles &&
|
||||
device.D3D12Device->CheckFeatureSupport<D3D12_FEATURE_DATA_D3D12_OPTIONS>(D3D12_FEATURE_D3D12_OPTIONS).DoublePrecisionFloatShaderOps == 0)
|
||||
{
|
||||
UnsupportedDoubleOperationsException.Throw<T>();
|
||||
UnsupportedDoubleOperationException.Throw<T>();
|
||||
}
|
||||
|
||||
nint usableSizeInBytes = checked((nint)(length * elementSizeInBytes));
|
||||
|
||||
@@ -414,7 +414,7 @@ public partial class BufferTests
|
||||
[Resource(typeof(ConstantBuffer<>))]
|
||||
[Resource(typeof(ReadOnlyBuffer<>))]
|
||||
[Resource(typeof(ReadWriteBuffer<>))]
|
||||
[ExpectedException(typeof(UnsupportedDoubleOperationsException))]
|
||||
[ExpectedException(typeof(UnsupportedDoubleOperationException))]
|
||||
public void Dispatch_ReadWriteBuffer_DoublePrecision_ThrowsExceptionIfUnsupported(Device device, Type resourceType)
|
||||
{
|
||||
if (device.Get().IsDoublePrecisionSupportAvailable())
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする