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
ファイルの表示
@@ -81,3 +81,4 @@ CMPSD2D0071 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github
CMPSD2D0072 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
CMPSD2D0073 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
CMPSD2D0074 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
CMPSD2D0075 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
+16
ファイルの表示
@@ -1109,4 +1109,20 @@ partial class DiagnosticDescriptors
isEnabledByDefault: true,
description: "A pixel 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: "CMPSD2D0075",
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.D2D1.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");
}