Skip warnings for shader types with no fields

このコミットが含まれているのは:
Sergio Pedri committed 2023-11-24 00:32:27 +01:00
1 親 709197ee43
コミット 43b79bdf4b
9ファイル変更
+46 -16

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

@@ -8,13 +8,13 @@ namespace ComputeSharp.SourceGenerators;
/// <inheritdoc/>
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public sealed class NotReadonlyComputeShaderTypeAnalyzer : NotReadonlyShaderTypeAnalyzerBase
public sealed class NotReadOnlyComputeShaderTypeWithFieldsAnalyzer : NotReadOnlyShaderTypeWithFieldsAnalyzerBase
{
/// <summary>
/// Creates a new <see cref="NotReadonlyComputeShaderTypeAnalyzer"/> instance.
/// Creates a new <see cref="NotReadOnlyComputeShaderTypeWithFieldsAnalyzer"/> instance.
/// </summary>
public NotReadonlyComputeShaderTypeAnalyzer()
: base(NotReadonlyShaderType, ImmutableArray.Create("ComputeSharp.IComputeShader", "ComputeSharp.IComputeShader`1"))
public NotReadOnlyComputeShaderTypeWithFieldsAnalyzer()
: base(NotReadOnlyShaderType, ImmutableArray.Create("ComputeSharp.IComputeShader", "ComputeSharp.IComputeShader`1"))
{
}
}
+1 -1
ファイルの表示
@@ -805,7 +805,7 @@ partial class DiagnosticDescriptors
/// Format: <c>"The shader of type {0} is not readonly (shaders cannot mutate their instance state while running, so shader types not being readonly makes them error prone)"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor NotReadonlyShaderType = new(
public static readonly DiagnosticDescriptor NotReadOnlyShaderType = new(
id: "CMPS0057",
title: "Not readonly shader type (using IComputeShader or IComputeShader<T>)",
messageFormat: "The shader of type {0} is not readonly (shaders cannot mutate their instance state while running, so shader types not being readonly makes them error prone)",