From d8a4a7412d76f448b928cae883b983b3da8a9d1f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 20 Nov 2021 16:48:18 +0100 Subject: [PATCH] Restore and fix warnings --- Directory.Build.props | 1 + .../Processors/HlslBokehBlurProcessor{TPixel}.cs | 2 +- .../Views/MainWindow.xaml.cs | 2 +- .../Backend/SwapChainApplication{T}.cs | 2 +- .../Backend/Win32ApplicationRunner.cs | 9 +++------ samples/Directory.Build.props | 7 +++++++ .../Diagnostics/DiagnosticsExtensions.cs | 4 ++-- .../Helpers/SyntaxFactoryHelper.cs | 2 +- src/ComputeSharp.SourceGenerators/IShaderGenerator.cs | 4 ++-- .../Mappings/HlslKnownMembers.cs | 7 ++++--- .../Mappings/HlslKnownTypes.cs | 3 ++- .../SyntaxRewriters/ShaderSourceRewriter.cs | 2 +- src/Directory.Build.props | 4 ++-- .../NativeLibrariesResolverTests.cs | 2 +- .../DiagnosticsTests.cs | 3 +-- .../Attributes/AdditionalDataAttribute.cs | 2 +- .../Attributes/AdditionalResourceAttribute.cs | 2 +- .../ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs | 2 +- tests/ComputeSharp.Tests/Attributes/DataAttribute.cs | 2 +- tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs | 2 +- tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs | 2 +- .../Extensions/GraphicsDeviceExtensions.cs | 5 +++-- tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs | 2 +- tests/ComputeSharp.Tests/ShadersTests.cs | 4 ++-- tests/Directory.Build.props | 7 +++++++ 25 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 samples/Directory.Build.props create mode 100644 tests/Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props index be7d258d..1fff9d22 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,6 +3,7 @@ true 10.0 enable + true Sergio Pedri Copyright (c) 2021 Sergio Pedri $(NoWarn);MSB3270 diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs index e41bb4f6..79eb4b45 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs @@ -56,7 +56,7 @@ public sealed partial class HlslBokehBlurProcessor private readonly float KernelsScale; /// - /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances. + /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances. /// private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Complex64[][] Kernels)> Cache = new(); diff --git a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs index c9ce9c54..a3af54a7 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs +++ b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs @@ -4,7 +4,7 @@ using Microsoft.UI.Xaml.Input; namespace ComputeSharp.SwapChain.WinUI.Views; /// -/// A view for . +/// A view for . /// public sealed partial class MainWindow : Window { diff --git a/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs index db765d50..df208d46 100644 --- a/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs +++ b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs @@ -76,7 +76,7 @@ internal sealed class SwapChainApplication : Win32Application private bool isResizePending; /// - /// Creates a new instance with the specified parameters. + /// Creates a new instance with the specified parameters. /// /// The instance used to create shaders to run. public SwapChainApplication(Func shaderFactory) diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs index 281a26cf..475a2210 100644 --- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs +++ b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs @@ -39,13 +39,10 @@ internal unsafe static class Win32ApplicationRunner private static Thread renderThread = null!; /// - /// Runs a specified application and starts the main loop to update its state. - /// This is the entry point for a given application of type , and it should be - /// called as soon as the process is launched, excluding any other additional initialization needed. - /// To launch an application, simply add this line to the project being used: - /// Win32ApplicationRunner.Run<MyApplication>(); + /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application, + /// and it should be called as soon as the process is launched, excluding any other additional initialization needed. /// - /// The type of application being launched. + /// The input application instance to run. /// The exit code for the application. public static int Run(Win32Application application) { diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props new file mode 100644 index 00000000..e190c8b2 --- /dev/null +++ b/samples/Directory.Build.props @@ -0,0 +1,7 @@ + + + + + $(NoWarn);CS1591 + + \ No newline at end of file diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs index 9739f8ab..a5894cd6 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs @@ -11,7 +11,7 @@ internal static class DiagnosticsExtensions /// /// Adds a new diagnostics to the current compilation. /// - /// The instance currently in use. + /// The instance currently in use. /// The input for the diagnostics to create. /// The source to attach the diagnostics to. /// The optional arguments for the formatted message to include. @@ -27,7 +27,7 @@ internal static class DiagnosticsExtensions /// /// Adds a new diagnostics to the current compilation. /// - /// The instance currently in use. + /// The instance currently in use. /// The input for the diagnostics to create. /// The source to attach the diagnostics to. /// The optional arguments for the formatted message to include. diff --git a/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs index 8b08572f..f1d215c8 100644 --- a/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs +++ b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs @@ -21,7 +21,7 @@ internal static class SyntaxFactoryHelper /// /// /// - /// The input sequence of groups. + /// The input sequence of groups. /// An instance with the described contents. [Pure] public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<(string A, string B)> groups) diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs index 986e19ca..c89752f1 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs @@ -147,7 +147,7 @@ public sealed partial class IShaderGenerator : ISourceGenerator /// /// Creates a instance for the GetDispatchId method. /// - /// The for . + /// The for the input struct declaration. /// The resulting instance for the GetDispatchId method. private static partial MethodDeclarationSyntax CreateGetDispatchIdMethod(INamedTypeSymbol structDeclarationSymbol); @@ -155,7 +155,7 @@ public sealed partial class IShaderGenerator : ISourceGenerator /// Creates a instance for the LoadDispatchDataMethod method. /// /// The input instance to use. - /// The for . + /// The for the input struct declaration. /// The collection of discovered resources in the current shader type. /// The total number of 32 bit root constants being loaded for the current shader type. /// The resulting instance for the LoadDispatchDataMethod method. diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs index 904ef8e1..adecb8dd 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs @@ -414,11 +414,12 @@ internal static class HlslKnownMembers } /// - /// Tries to get the mapped HLSL-compatible indexer vector type name for the input indexer name. + /// Tries to get the mapped rank and axis for a given indexer name. /// /// The input fully qualified indexer name. - /// The mapped type name, if one is found. - /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer. + /// The resulting indexer rank, if found. + /// The resulting indexer axis, if found. + /// Whether or not a rank and axis could be resolved by the input indexer name. [Pure] public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis) { diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs index 9ebd68ed..25b7ae9d 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs @@ -336,7 +336,8 @@ internal static class HlslKnownTypes /// /// Gets the mapped HLSL-compatible type name for the input type name. /// - /// The input type name to map. + /// The input type name to map. + /// The resulting mapped type name, if found. /// The HLSL-compatible type name that can be used in an HLSL shader. public static bool TryGetMappedName(string originalName, out string? mappedName) { diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs index 89cd50a3..0b45396c 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs @@ -114,7 +114,7 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter public bool IsGroupIdsUsed { get; private set; } /// - /// Gets whether or not the shader uses at least once. /// public bool IsGroupIdsIndexUsed { get; private set; } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 3b884e46..96486587 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ + + - - \ No newline at end of file diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs index cd9741a3..64b123f5 100644 --- a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs +++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs @@ -13,7 +13,7 @@ public class NativeLibrariesResolverTests /// /// Performs static initialization for the assembly before any unit tests are run. /// - /// The for the test runner instance in use. + /// The for the test runner instance in use. [AssemblyInitialize] public static void Initialize(TestContext _) { diff --git a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs index e3a11320..f956aeea 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs +++ b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs @@ -1404,8 +1404,7 @@ public class DiagnosticsTests /// /// The generator type to use. /// The input source to process. - /// The target index to check in the resulting output. - /// The expected body to compare with the generated code. + /// The expected diagnostics ids to be generated. private static void VerifyGeneratedDiagnostics(string source, params string[] diagnosticsIds) where TGenerator : class, ISourceGenerator, new() { diff --git a/tests/ComputeSharp.Tests/Attributes/AdditionalDataAttribute.cs b/tests/ComputeSharp.Tests/Attributes/AdditionalDataAttribute.cs index 6922c6ee..d4c0b0bc 100644 --- a/tests/ComputeSharp.Tests/Attributes/AdditionalDataAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/AdditionalDataAttribute.cs @@ -3,7 +3,7 @@ namespace ComputeSharp.Tests.Attributes; /// -/// An attribute to use with adding additional arbitrary input data. +/// An attribute to use with adding additional arbitrary input data. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public sealed class AdditionalDataAttribute : Attribute diff --git a/tests/ComputeSharp.Tests/Attributes/AdditionalResourceAttribute.cs b/tests/ComputeSharp.Tests/Attributes/AdditionalResourceAttribute.cs index bc2cedab..f5c8fda9 100644 --- a/tests/ComputeSharp.Tests/Attributes/AdditionalResourceAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/AdditionalResourceAttribute.cs @@ -3,7 +3,7 @@ namespace ComputeSharp.Tests.Attributes; /// -/// An attribute to use with targeting an additional specific resource type. +/// An attribute to use with targeting an additional specific resource type. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public sealed class AdditionalResourceAttribute : Attribute diff --git a/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs b/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs index 9976dc66..1c83a15d 100644 --- a/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs @@ -3,7 +3,7 @@ namespace ComputeSharp.Tests.Attributes; /// -/// An attribute to use with targeting all supported devices. +/// An attribute to use with targeting all supported devices. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public sealed class AllDevicesAttribute : Attribute diff --git a/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs b/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs index c4f63acf..b1633f24 100644 --- a/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs @@ -3,7 +3,7 @@ namespace ComputeSharp.Tests.Attributes; /// -/// An attribute to use with adding arbitrary input data. +/// An attribute to use with adding arbitrary input data. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public sealed class DataAttribute : Attribute diff --git a/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs b/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs index 7c249b42..4bf2e34e 100644 --- a/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs @@ -4,7 +4,7 @@ using ComputeSharp.Tests.Extensions; namespace ComputeSharp.Tests.Attributes; /// -/// An attribute to use with adding a specific input. +/// An attribute to use with adding a specific input. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public sealed class DeviceAttribute : Attribute diff --git a/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs b/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs index 72f9d75a..08e6477f 100644 --- a/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs @@ -3,7 +3,7 @@ namespace ComputeSharp.Tests.Attributes; /// -/// An attribute to use with targeting a specific resource type. +/// An attribute to use with targeting a specific resource type. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public sealed class ResourceAttribute : Attribute diff --git a/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs b/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs index 0491aa04..003cbbb3 100644 --- a/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs +++ b/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs @@ -266,6 +266,7 @@ public static class GraphicsDeviceExtensions /// The type of items in the texture. /// The target instance to allocate the texture for. /// The type of texture to allocate. + /// The input 3D array to use as source data for the texture. /// A instance of the requested size. [Pure] public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, T[,,] data) @@ -309,7 +310,7 @@ public static class GraphicsDeviceExtensions /// The type of texture to allocate. /// The type of filepath to use. /// The filename of the image file to load and decode into the texture. - /// A instance with the contents of the specified file. + /// A instance with the contents of the specified file. [Pure] public static Texture2D LoadTexture2D(this GraphicsDevice device, Type textureType, Type inputType, string filename) where T : unmanaged, IUnorm @@ -341,7 +342,7 @@ public static class GraphicsDeviceExtensions /// The instance to use to allocate the texture. /// The type of texture to allocate. /// The buffer with the image data to load and decode into the texture. - /// A instance with the contents of the specified file. + /// A instance with the contents of the specified file. [Pure] public static Texture2D LoadTexture2D(this GraphicsDevice device, Type type, byte[] buffer) where T : unmanaged, IUnorm diff --git a/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs b/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs index 2b79f68a..c68a82fc 100644 --- a/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs +++ b/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs @@ -18,7 +18,7 @@ public static class ImagingExtensions /// Creates a new instance with the specified texture data. /// /// The input pixel format used in the texture. - /// The target pixel format for the returned image. + /// The target pixel format for the returned image. /// The source instance to read data from. /// An image with the data from the input texture. [Pure] diff --git a/tests/ComputeSharp.Tests/ShadersTests.cs b/tests/ComputeSharp.Tests/ShadersTests.cs index 573ab028..3099466f 100644 --- a/tests/ComputeSharp.Tests/ShadersTests.cs +++ b/tests/ComputeSharp.Tests/ShadersTests.cs @@ -136,7 +136,6 @@ public class ShadersTests /// /// Executes a given test for a specified shader. /// - /// The type of shader to test. /// The device to use. /// The type of shader being executed. /// The comparison delta. @@ -194,7 +193,8 @@ public class ShadersTests /// /// Executes a given test for a specified shader. /// - /// The type of shader to test. + /// The type of compute shader to test. + /// The type of pixel shader to test. /// The device to use. /// The type of shader being executed. /// The factory of compute shaders. diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props new file mode 100644 index 00000000..e190c8b2 --- /dev/null +++ b/tests/Directory.Build.props @@ -0,0 +1,7 @@ + + + + + $(NoWarn);CS1591 + + \ No newline at end of file