Restore <TreatWarningsAsErrors> and fix warnings

このコミットが含まれているのは:
Sergio Pedri committed 2021-11-20 16:48:18 +01:00
1 親 ec901922db
コミット d8a4a7412d
25ファイル変更
+49 -35

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

+1
ファイルの表示
@@ -3,6 +3,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Company>Sergio Pedri</Company>
<Copyright>Copyright (c) 2021 Sergio Pedri</Copyright>
<NoWarn>$(NoWarn);MSB3270</NoWarn>
+1 -1
ファイルの表示
@@ -56,7 +56,7 @@ public sealed partial class HlslBokehBlurProcessor
private readonly float KernelsScale;
/// <summary>
/// The mapping of initialized complex kernels and parameters, to speed up the initialization of new <see cref="HlslBokehBlurProcessor{TPixel}"/> instances.
/// The mapping of initialized complex kernels and parameters, to speed up the initialization of new <see cref="HlslBokehBlurProcessor"/> instances.
/// </summary>
private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Complex64[][] Kernels)> Cache = new();
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using Microsoft.UI.Xaml.Input;
namespace ComputeSharp.SwapChain.WinUI.Views;
/// <summary>
/// A view for <see cref="MainViewModel"/>.
/// A view for <see cref="ComputeSharp.SwapChain.WinUI.ViewModels.MainViewModel"/>.
/// </summary>
public sealed partial class MainWindow : Window
{
+1 -1
ファイルの表示
@@ -76,7 +76,7 @@ internal sealed class SwapChainApplication<T> : Win32Application
private bool isResizePending;
/// <summary>
/// Creates a new <see cref="SwapChainApplication"/> instance with the specified parameters.
/// Creates a new <see cref="SwapChainApplication{T}"/> instance with the specified parameters.
/// </summary>
/// <param name="shaderFactory">The <see cref="Func{T1, TResult}"/> instance used to create shaders to run.</param>
public SwapChainApplication(Func<TimeSpan, T> shaderFactory)
+3 -6
ファイルの表示
@@ -39,13 +39,10 @@ internal unsafe static class Win32ApplicationRunner
private static Thread renderThread = null!;
/// <summary>
/// Runs a specified application and starts the main loop to update its state.
/// This is the entry point for a given application of type <typeparamref name="T"/>, and it should be
/// called as soon as the process is launched, excluding any other additional initialization needed.
/// <para>To launch an application, simply add this line to the project being used:</para>
/// <c>Win32ApplicationRunner.Run&lt;MyApplication>();</c>
/// 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.
/// </summary>
/// <typeparam name="T">The type of application being launched.</typeparam>
/// <param name="application">The input application instance to run.</param>
/// <returns>The exit code for the application.</returns>
public static int Run(Win32Application application)
{
+7
ファイルの表示
@@ -0,0 +1,7 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
</Project>
+2 -2
ファイルの表示
@@ -11,7 +11,7 @@ internal static class DiagnosticsExtensions
/// <summary>
/// Adds a new diagnostics to the current compilation.
/// </summary>
/// <param name="context">The <see cref="GeneratorEditContext"/> instance currently in use.</param>
/// <param name="context">The <see cref="GeneratorExecutionContext"/> instance currently in use.</param>
/// <param name="descriptor">The input <see cref="DiagnosticDescriptor"/> for the diagnostics to create.</param>
/// <param name="symbol">The source <see cref="ISymbol"/> to attach the diagnostics to.</param>
/// <param name="args">The optional arguments for the formatted message to include.</param>
@@ -27,7 +27,7 @@ internal static class DiagnosticsExtensions
/// <summary>
/// Adds a new diagnostics to the current compilation.
/// </summary>
/// <param name="context">The <see cref="GeneratorEditContext"/> instance currently in use.</param>
/// <param name="context">The <see cref="GeneratorExecutionContext"/> instance currently in use.</param>
/// <param name="descriptor">The input <see cref="DiagnosticDescriptor"/> for the diagnostics to create.</param>
/// <param name="node">The source <see cref="SyntaxNode"/> to attach the diagnostics to.</param>
/// <param name="args">The optional arguments for the formatted message to include.</param>
+1 -1
ファイルの表示
@@ -21,7 +21,7 @@ internal static class SyntaxFactoryHelper
/// </code>
/// </para>
/// </summary>
/// <param name="values">The input sequence of <see cref="string"/> groups.</param>
/// <param name="groups">The input sequence of <see cref="string"/> groups.</param>
/// <returns>An <see cref="ArrayCreationExpressionSyntax"/> instance with the described contents.</returns>
[Pure]
public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<(string A, string B)> groups)
+2 -2
ファイルの表示
@@ -147,7 +147,7 @@ public sealed partial class IShaderGenerator : ISourceGenerator
/// <summary>
/// Creates a <see cref="MethodDeclarationSyntax"/> instance for the <c>GetDispatchId</c> method.
/// </summary>
/// <param name="structDeclarationSymbol">The <see cref="INamedTypeSymbol"/> for <paramref name="structDeclaration"/>.</param>
/// <param name="structDeclarationSymbol">The <see cref="INamedTypeSymbol"/> for the input struct declaration.</param>
/// <returns>The resulting <see cref="MethodDeclarationSyntax"/> instance for the <c>GetDispatchId</c> method.</returns>
private static partial MethodDeclarationSyntax CreateGetDispatchIdMethod(INamedTypeSymbol structDeclarationSymbol);
@@ -155,7 +155,7 @@ public sealed partial class IShaderGenerator : ISourceGenerator
/// Creates a <see cref="MethodDeclarationSyntax"/> instance for the <c>LoadDispatchDataMethod</c> method.
/// </summary>
/// <param name="context">The input <see cref="GeneratorExecutionContext"/> instance to use.</param>
/// <param name="structDeclarationSymbol">The <see cref="INamedTypeSymbol"/> for <paramref name="structDeclaration"/>.</param>
/// <param name="structDeclarationSymbol">The <see cref="INamedTypeSymbol"/> for the input struct declaration.</param>
/// <param name="discoveredResources">The collection of discovered resources in the current shader type.</param>
/// <param name="root32BitConstantsCount">The total number of 32 bit root constants being loaded for the current shader type.</param>
/// <returns>The resulting <see cref="MethodDeclarationSyntax"/> instance for the <c>LoadDispatchDataMethod</c> method.</returns>
+4 -3
ファイルの表示
@@ -414,11 +414,12 @@ internal static class HlslKnownMembers
}
/// <summary>
/// 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.
/// </summary>
/// <param name="name">The input fully qualified indexer name.</param>
/// <param name="mapped">The mapped type name, if one is found.</param>
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader for the given indexer.</returns>
/// <param name="rank">The resulting indexer rank, if found.</param>
/// <param name="axis">The resulting indexer axis, if found.</param>
/// <returns>Whether or not a rank and axis could be resolved by the input indexer name.</returns>
[Pure]
public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis)
{
+2 -1
ファイルの表示
@@ -336,7 +336,8 @@ internal static class HlslKnownTypes
/// <summary>
/// Gets the mapped HLSL-compatible type name for the input type name.
/// </summary>
/// <param name="name">The input type name to map.</param>
/// <param name="originalName">The input type name to map.</param>
/// <param name="mappedName">The resulting mapped type name, if found.</param>
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader.</returns>
public static bool TryGetMappedName(string originalName, out string? mappedName)
{
+1 -1
ファイルの表示
@@ -114,7 +114,7 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter
public bool IsGroupIdsUsed { get; private set; }
/// <summary>
/// Gets whether or not the shader uses <see cref="GroupIds.Index/> at least once.
/// Gets whether or not the shader uses <see cref="GroupIds.Index"/> at least once.
/// </summary>
public bool IsGroupIdsIndexUsed { get; private set; }
+2 -2
ファイルの表示
@@ -1,7 +1,7 @@
<Project>
<Import Project="..\Directory.Build.props" />
<ItemGroup>
<PackageReference Include="NuGetizer" Version="0.7.5" PrivateAssets="all" />
</ItemGroup>
<Import Project="..\Directory.Build.props" />
</Project>
+1 -1
ファイルの表示
@@ -13,7 +13,7 @@ public class NativeLibrariesResolverTests
/// <summary>
/// Performs static initialization for the assembly before any unit tests are run.
/// </summary>
/// <param name="context">The <see cref="TestContext"/> for the test runner instance in use.</param>
/// <param name="_">The <see cref="TestContext"/> for the test runner instance in use.</param>
[AssemblyInitialize]
public static void Initialize(TestContext _)
{
+1 -2
ファイルの表示
@@ -1404,8 +1404,7 @@ public class DiagnosticsTests
/// </summary>
/// <typeparam name="TGenerator">The generator type to use.</typeparam>
/// <param name="source">The input source to process.</param>
/// <param name="index">The target index to check in the resulting output.</param>
/// <param name="expectedBody">The expected body to compare with the generated code.</param>
/// <param name="diagnosticsIds">The expected diagnostics ids to be generated.</param>
private static void VerifyGeneratedDiagnostics<TGenerator>(string source, params string[] diagnosticsIds)
where TGenerator : class, ISourceGenerator, new()
{
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@
namespace ComputeSharp.Tests.Attributes;
/// <summary>
/// An attribute to use with <see cref="CombinatorialAttribute"/> adding additional arbitrary input data.
/// An attribute to use with <see cref="CombinatorialTestMethodAttribute"/> adding additional arbitrary input data.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class AdditionalDataAttribute : Attribute
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@
namespace ComputeSharp.Tests.Attributes;
/// <summary>
/// An attribute to use with <see cref="CombinatorialAttribute"/> targeting an additional specific resource type.
/// An attribute to use with <see cref="CombinatorialTestMethodAttribute"/> targeting an additional specific resource type.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class AdditionalResourceAttribute : Attribute
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@
namespace ComputeSharp.Tests.Attributes;
/// <summary>
/// An attribute to use with <see cref="CombinatorialAttribute"/> targeting all supported devices.
/// An attribute to use with <see cref="CombinatorialTestMethodAttribute"/> targeting all supported devices.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class AllDevicesAttribute : Attribute
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@
namespace ComputeSharp.Tests.Attributes;
/// <summary>
/// An attribute to use with <see cref="CombinatorialAttribute"/> adding arbitrary input data.
/// An attribute to use with <see cref="CombinatorialTestMethodAttribute"/> adding arbitrary input data.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class DataAttribute : Attribute
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using ComputeSharp.Tests.Extensions;
namespace ComputeSharp.Tests.Attributes;
/// <summary>
/// An attribute to use with <see cref="CombinatorialAttribute"/> adding a specific <see cref="Extensions.Device"/> input.
/// An attribute to use with <see cref="CombinatorialTestMethodAttribute"/> adding a specific <see cref="Extensions.Device"/> input.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class DeviceAttribute : Attribute
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@
namespace ComputeSharp.Tests.Attributes;
/// <summary>
/// An attribute to use with <see cref="CombinatorialAttribute"/> targeting a specific resource type.
/// An attribute to use with <see cref="CombinatorialTestMethodAttribute"/> targeting a specific resource type.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class ResourceAttribute : Attribute
+3 -2
ファイルの表示
@@ -266,6 +266,7 @@ public static class GraphicsDeviceExtensions
/// <typeparam name="T">The type of items in the texture.</typeparam>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance to allocate the texture for.</param>
/// <param name="type">The type of texture to allocate.</param>
/// <param name="data">The input 3D array to use as source data for the texture.</param>
/// <returns>A <see cref="Texture2D{T}"/> instance of the requested size.</returns>
[Pure]
public static Texture3D<T> AllocateTexture3D<T>(this GraphicsDevice device, Type type, T[,,] data)
@@ -309,7 +310,7 @@ public static class GraphicsDeviceExtensions
/// <param name="textureType">The type of texture to allocate.</param>
/// <param name="inputType">The type of filepath to use.</param>
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
/// <returns>A <see cref="Texture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
/// <returns>A <see cref="Texture2D{T}"/> instance with the contents of the specified file.</returns>
[Pure]
public static Texture2D<T> LoadTexture2D<T, TPixel>(this GraphicsDevice device, Type textureType, Type inputType, string filename)
where T : unmanaged, IUnorm<TPixel>
@@ -341,7 +342,7 @@ public static class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
/// <param name="type">The type of texture to allocate.</param>
/// <param name="buffer">The buffer with the image data to load and decode into the texture.</param>
/// <returns>A <see cref="Texture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
/// <returns>A <see cref="Texture2D{T}"/> instance with the contents of the specified file.</returns>
[Pure]
public static Texture2D<T> LoadTexture2D<T, TPixel>(this GraphicsDevice device, Type type, byte[] buffer)
where T : unmanaged, IUnorm<TPixel>
+1 -1
ファイルの表示
@@ -18,7 +18,7 @@ public static class ImagingExtensions
/// Creates a new <see cref="Image{TPixel}"/> instance with the specified texture data.
/// </summary>
/// <typeparam name="TFrom">The input pixel format used in the texture.</typeparam>
/// <typeparam name="To">The target pixel format for the returned image.</typeparam>
/// <typeparam name="TTo">The target pixel format for the returned image.</typeparam>
/// <param name="texture">The source <see cref="Texture2D{T}"/> instance to read data from.</param>
/// <returns>An image with the data from the input texture.</returns>
[Pure]
+2 -2
ファイルの表示
@@ -136,7 +136,6 @@ public class ShadersTests
/// <summary>
/// Executes a given test for a specified shader.
/// </summary>
/// <typeparam name="T">The type of shader to test.</typeparam>
/// <param name="device">The device to use.</param>
/// <param name="shaderType">The type of shader being executed.</param>
/// <param name="delta">The comparison delta.</param>
@@ -194,7 +193,8 @@ public class ShadersTests
/// <summary>
/// Executes a given test for a specified shader.
/// </summary>
/// <typeparam name="T">The type of shader to test.</typeparam>
/// <typeparam name="TCompute">The type of compute shader to test.</typeparam>
/// <typeparam name="TPixel">The type of pixel shader to test.</typeparam>
/// <param name="device">The device to use.</param>
/// <param name="shaderType">The type of shader being executed.</param>
/// <param name="computeFactory">The factory of compute shaders.</param>
+7
ファイルの表示
@@ -0,0 +1,7 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
</Project>