From 2c3c428fc98c7f5f5d80d5bf0f23980233ef4831 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 29 Jan 2022 12:35:45 +0100 Subject: [PATCH] Add missing trailing dots to exception messages --- .../Processors/HlslBokehBlurProcessor.cs | 2 +- .../HlslBokehBlurProcessor{TPixel}.cs | 2 +- .../Processors/HlslGaussianBlurProcessor.cs | 2 +- .../HlslGaussianBlurProcessor{TPixel}.cs | 2 +- .../ShaderCompiler.LibraryLoading.cs | 2 +- .../UnsupportedTextureTypeException.cs | 2 +- .../Extensions/Interop/HResultExtensions.cs | 2 +- .../Graphics/Helpers/DXGIFormatHelper.cs | 4 ++-- .../Graphics/Helpers/WICFormatHelper.cs | 20 +++++++++---------- .../__Internals/GraphicsResourceHelper.cs | 12 +++++------ .../Extensions/DeviceExtensions.cs | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs index fa3f8d67..aa7e32d6 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs @@ -74,7 +74,7 @@ public sealed partial class HlslBokehBlurProcessor : IImageProcessor { if (typeof(TPixel) != typeof(ImageSharpRgba32)) { - ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); + ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format."); } var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs index 5a4847bc..8a4add60 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs @@ -265,7 +265,7 @@ public sealed partial class HlslBokehBlurProcessor { if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) { - ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); + ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory."); } Span span = MemoryMarshal.Cast(pixelSpan); diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs index 0dd0481e..de1e6ef1 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs @@ -78,7 +78,7 @@ public sealed partial class HlslGaussianBlurProcessor : IImageProcessor { if (typeof(TPixel) != typeof(ImageSharpRgba32)) { - ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); + ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format."); } var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs index 06832d3a..11c70763 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs @@ -96,7 +96,7 @@ public sealed partial class HlslGaussianBlurProcessor { if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) { - ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); + ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory."); } Span span = MemoryMarshal.Cast(pixelSpan); diff --git a/src/ComputeSharp.Dynamic/Shaders/Translation/ShaderCompiler.LibraryLoading.cs b/src/ComputeSharp.Dynamic/Shaders/Translation/ShaderCompiler.LibraryLoading.cs index 52bf32ff..79911fff 100644 --- a/src/ComputeSharp.Dynamic/Shaders/Translation/ShaderCompiler.LibraryLoading.cs +++ b/src/ComputeSharp.Dynamic/Shaders/Translation/ShaderCompiler.LibraryLoading.cs @@ -28,7 +28,7 @@ internal sealed unsafe partial class ShaderCompiler { Architecture.X64 => "win-x64", Architecture.Arm64 => "win-arm64", - _ => ThrowHelper.ThrowNotSupportedException("Invalid process architecture") + _ => ThrowHelper.ThrowNotSupportedException("Invalid process architecture.") }; // Test whether the native libraries are present in the same folder of the executable diff --git a/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs b/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs index c030d592..0b85c50c 100644 --- a/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs +++ b/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs @@ -35,7 +35,7 @@ public sealed class UnsupportedTextureTypeException : NotSupportedException { 2 => $"{nameof(GraphicsDevice.IsReadOnlyTexture2DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture2DSupportedForType)}().", 3 => $"{nameof(GraphicsDevice.IsReadOnlyTexture3DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture3DSupportedForType)}().", - _ => ThrowHelper.ThrowArgumentException("Invalid texture rank") + _ => ThrowHelper.ThrowArgumentException("Invalid texture rank.") }); builder.Append("As a possible workaround on older devices, consider using a texture type of lower rank, or a linear buffer."); diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs index 0c2bcadf..dbf2a6ce 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs @@ -44,7 +44,7 @@ internal static class HResultExtensions if (hasErrorsOrWarnings) { - ThrowHelper.ThrowWin32Exception("Warning or error detected by ID3D12InfoQueue"); + ThrowHelper.ThrowWin32Exception("Warning or error detected by ID3D12InfoQueue."); } #else if (result < 0) diff --git a/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs index 985f2271..339286dd 100644 --- a/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs @@ -43,7 +43,7 @@ internal static class DXGIFormatHelper else if (typeof(T) == typeof(R16)) return DXGI_FORMAT_R16_UNORM; else if (typeof(T) == typeof(Rg16)) return DXGI_FORMAT_R8G8_UNORM; else if (typeof(T) == typeof(Rg32)) return DXGI_FORMAT_R16G16_UNORM; - else return ThrowHelper.ThrowArgumentException("Invalid texture type"); + else return ThrowHelper.ThrowArgumentException("Invalid texture type."); } /// @@ -86,7 +86,7 @@ internal static class DXGIFormatHelper return true; } - return ThrowHelper.ThrowArgumentException("Invalid texture type"); + return ThrowHelper.ThrowArgumentException("Invalid texture type."); } /// diff --git a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs index 7bbf2b3d..6be31a5c 100644 --- a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs @@ -30,7 +30,7 @@ internal static class WICFormatHelper else if (typeof(T) == typeof(Rgba64)) return GUID.GUID_WICPixelFormat64bppRGBA; else if (typeof(T) == typeof(R8)) return GUID.GUID_WICPixelFormat8bppGray; else if (typeof(T) == typeof(R16)) return GUID.GUID_WICPixelFormat16bppGray; - else return ThrowHelper.ThrowArgumentException("Invalid texture type"); + else return ThrowHelper.ThrowArgumentException("Invalid texture type."); } /// @@ -50,7 +50,7 @@ internal static class WICFormatHelper else if (typeof(T) == typeof(Rgba64)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA; else if (typeof(T) == typeof(R8)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR; else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type."); } else if (containerFormat == GUID.GUID_ContainerFormatPng) { @@ -59,7 +59,7 @@ internal static class WICFormatHelper else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; else if (typeof(T) == typeof(R8)) intermediateFormat = default; else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat8bppGray; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type."); } else if (containerFormat == GUID.GUID_ContainerFormatJpeg) { @@ -68,7 +68,7 @@ internal static class WICFormatHelper else if (typeof(T) == typeof(Rgba64)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR; else if (typeof(T) == typeof(R8)) intermediateFormat = default; else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat8bppGray; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type."); } else if (containerFormat == GUID.GUID_ContainerFormatWmp) { @@ -77,7 +77,7 @@ internal static class WICFormatHelper else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; else if (typeof(T) == typeof(R8)) intermediateFormat = default; else if (typeof(T) == typeof(R16)) intermediateFormat = default; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type."); } else if (containerFormat == GUID.GUID_ContainerFormatTiff) { @@ -86,7 +86,7 @@ internal static class WICFormatHelper else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; else if (typeof(T) == typeof(R8)) intermediateFormat = default; else if (typeof(T) == typeof(R16)) intermediateFormat = default; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type."); } else if (containerFormat == GUID.GUID_ContainerFormatDds) { @@ -95,11 +95,11 @@ internal static class WICFormatHelper else if (typeof(T) == typeof(Rgba64)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA; else if (typeof(T) == typeof(R8)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA; else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type."); } else { - intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid container format"); + intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid container format."); } return intermediateFormat != default; @@ -125,7 +125,7 @@ internal static class WICFormatHelper ".wmp" => GUID.GUID_ContainerFormatWmp, ".tiff" => GUID.GUID_ContainerFormatTiff, ".dds" => GUID.GUID_ContainerFormatDds, - _ => ThrowHelper.ThrowArgumentException("Invalid filename"), + _ => ThrowHelper.ThrowArgumentException("Invalid filename."), }; } @@ -145,7 +145,7 @@ internal static class WICFormatHelper ImageFormat.Wmp => GUID.GUID_ContainerFormatWmp, ImageFormat.Tiff => GUID.GUID_ContainerFormatTiff, ImageFormat.Dds => GUID.GUID_ContainerFormatDds, - _ => ThrowHelper.ThrowArgumentException("Invalid format"), + _ => ThrowHelper.ThrowArgumentException("Invalid format."), }; } } diff --git a/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs index 72da4805..0cfb4de8 100644 --- a/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs @@ -134,7 +134,7 @@ public static class GraphicsResourceHelper return *(ulong*)&d3D12GpuDescriptorHandle; } - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance."); } /// @@ -157,7 +157,7 @@ public static class GraphicsResourceHelper return *(ulong*)&d3D12GpuDescriptorHandle; } - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance."); } /// @@ -180,7 +180,7 @@ public static class GraphicsResourceHelper return *(ulong*)&d3D12GpuDescriptorHandle; } - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance."); } /// @@ -245,7 +245,7 @@ public static class GraphicsResourceHelper return *(ulong*)&d3D12GpuDescriptorHandle; } - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance."); } /// @@ -268,7 +268,7 @@ public static class GraphicsResourceHelper return *(ulong*)&d3D12GpuDescriptorHandle; } - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance."); } /// @@ -291,6 +291,6 @@ public static class GraphicsResourceHelper return *(ulong*)&d3D12GpuDescriptorHandle; } - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance."); } } diff --git a/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs index 011d306c..a55741ef 100644 --- a/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs +++ b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs @@ -21,7 +21,7 @@ public static class DeviceExtensions { Device.Discrete => GraphicsDevice.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), Device.Warp => GraphicsDevice.QueryDevices(info => !info.IsHardwareAccelerated).First(), - _ => ThrowHelper.ThrowArgumentException("Invalid device") + _ => ThrowHelper.ThrowArgumentException("Invalid device.") }; if (device is null)