Refactor HlslBytecodeSyntaxProcessor partial constants

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-17 15:09:00 +01:00
1 親 9c645170c8
コミット 86b39c28f5
3ファイル変更
+20 -12

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

+10 -4
ファイルの表示
@@ -142,21 +142,21 @@ internal static partial class HlslBytecodeSyntaxProcessor
return;
}
bool hasD2DRequiresDoublePrecisionSupportAttribute = structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName(
RequiresDoublePrecisionSupportAttributeName,
bool hasRequiresDoublePrecisionSupportAttribute = structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName(
GetRequiresDoublePrecisionSupportAttributeName(),
out AttributeData? attributeData);
// Check the two cases where diagnostics are necessary:
// - The shader does not have [[D2D]RequiresDoublePrecisionSupport], but it needs it
// - The shader has [[D2D]RequiresDoublePrecisionSupport], but it does not need it
if (!hasD2DRequiresDoublePrecisionSupportAttribute && success.RequiresDoublePrecisionSupport)
if (!hasRequiresDoublePrecisionSupportAttribute && success.RequiresDoublePrecisionSupport)
{
diagnostics.Add(DiagnosticInfo.Create(
MissingRequiresDoublePrecisionSupportAttribute,
structDeclarationSymbol,
structDeclarationSymbol));
}
else if (hasD2DRequiresDoublePrecisionSupportAttribute && !success.RequiresDoublePrecisionSupport)
else if (hasRequiresDoublePrecisionSupportAttribute && !success.RequiresDoublePrecisionSupport)
{
diagnostics.Add(DiagnosticInfo.Create(
UnnecessaryRequiresDoublePrecisionSupportAttribute,
@@ -165,6 +165,12 @@ internal static partial class HlslBytecodeSyntaxProcessor
}
}
/// <summary>
/// Gets the type name for the attribute to indicate that double precision support is required.
/// </summary>
/// <returns>The type name for the attribute to indicate that double precision support is required.</returns>
private static partial string GetRequiresDoublePrecisionSupportAttributeName();
/// <summary>
/// Compiles the input HLSL source into bytecode.
/// </summary>