Add dedicated diagnostic for Math/MathF calls

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-09 18:38:20 +01:00
1 親 3b92f3d595
コミット 2b1b864c8d
6ファイル変更
+70 -1

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

+1
ファイルの表示
@@ -68,3 +68,4 @@ CMPS0059 | ComputeSharp.Shaders | Error | [Documentation](https://github.com/Ser
CMPS0060 | ComputeSharp.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
CMPS0061 | ComputeSharp.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
CMPS0062 | ComputeSharp.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
CMPS0063 | ComputeSharp.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
+16
ファイルの表示
@@ -885,4 +885,20 @@ partial class DiagnosticDescriptors
isEnabledByDefault: true,
description: "A compute shader cannot use a 'this' expression outside of member accesses (such as 'this.field').",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an invocation of a <c>Math</c> or <c>MathF</c> API.
/// <para>
/// Format: <c>"The method {0} cannot be used in a shader, use equivalent APIs from the Hlsl type instead"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidMathOrMathFCall = new(
id: "CMPS0063",
title: "Invalid Math or MathF invocation from a shader",
messageFormat: "The method {0} cannot be used in a shader, use equivalent APIs from the Hlsl type instead",
category: "ComputeSharp.Shaders",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "Methods from the Math and MathF types cannot be used in a shader, and equivalent APIs from the Hlsl type should be used instead.",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
}