Add diagnostic for invalid return type

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-18 14:26:09 +02:00
1 親 7576cc3045
コミット 140aa10a12
7ファイル変更
+113 -27

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

+5 -1
ファイルの表示
@@ -11,13 +11,15 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
/// <summary>
/// A model representing info on a shader method that has requested to be precompiled at build time.
/// </summary>
///<param name="Modifiers">The modifiers for the annotated method.</param>
/// <param name="Modifiers">The modifiers for the annotated method.</param>
/// <param name="MethodName">The name of the annotated method.</param>
/// <param name="InvalidReturnType">The fully qualified name of the return type, if invalid.</param>
/// <param name="HlslSource">The HLSL source.</param>
/// <param name="Bytecode">The compiled shader bytecode, if available.</param>
internal sealed record EmbeddedBytecodeMethodInfo(
ImmutableArray<SyntaxKind> Modifiers,
string MethodName,
string? InvalidReturnType,
string HlslSource,
ImmutableArray<byte> Bytecode)
{
@@ -31,6 +33,7 @@ internal sealed record EmbeddedBytecodeMethodInfo(
{
hashCode.AddRange(obj.Modifiers);
hashCode.Add(obj.MethodName);
hashCode.Add(obj.InvalidReturnType);
hashCode.Add(obj.HlslSource);
hashCode.AddBytes(obj.Bytecode.AsSpan());
}
@@ -41,6 +44,7 @@ internal sealed record EmbeddedBytecodeMethodInfo(
return
MemoryMarshal.Cast<SyntaxKind, ushort>(x.Modifiers.AsSpan()).SequenceEqual(MemoryMarshal.Cast<SyntaxKind, ushort>(y.Modifiers.AsSpan())) &&
x.MethodName == y.MethodName &&
x.InvalidReturnType == y.InvalidReturnType &&
x.HlslSource == y.HlslSource &&
x.Bytecode.SequenceEqual(y.Bytecode);
}
+4
ファイルの表示
@@ -12,6 +12,7 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
/// </summary>
/// <param name="Modifiers">The modifiers for the annotated method.</param>
/// <param name="MethodName">The name of the annotated method.</param>
/// <param name="InvalidReturnType">The fully qualified name of the return type, if invalid.</param>
/// <param name="HlslSource">The HLSL source.</param>
/// <param name="ShaderProfile">The shader profile to use to compile the shader.</param>
/// <param name="CompileOptions">The compile options to use to compile the shader.</param>
@@ -19,6 +20,7 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
internal sealed record HlslShaderMethodSourceInfo(
ImmutableArray<SyntaxKind> Modifiers,
string MethodName,
string? InvalidReturnType,
string HlslSource,
D2D1ShaderProfile ShaderProfile,
D2D1CompileOptions CompileOptions,
@@ -34,6 +36,7 @@ internal sealed record HlslShaderMethodSourceInfo(
{
hashCode.AddRange(obj.Modifiers);
hashCode.Add(obj.MethodName);
hashCode.Add(obj.InvalidReturnType);
hashCode.Add(obj.HlslSource);
hashCode.Add(obj.ShaderProfile);
hashCode.Add(obj.CompileOptions);
@@ -46,6 +49,7 @@ internal sealed record HlslShaderMethodSourceInfo(
return
MemoryMarshal.Cast<SyntaxKind, ushort>(x.Modifiers.AsSpan()).SequenceEqual(MemoryMarshal.Cast<SyntaxKind, ushort>(y.Modifiers.AsSpan())) &&
x.MethodName == y.MethodName &&
x.InvalidReturnType == y.InvalidReturnType &&
x.HlslSource == y.HlslSource &&
x.ShaderProfile == y.ShaderProfile &&
x.CompileOptions == y.CompileOptions &&