Fixed handling of exp constants in shaders

このコミットが含まれているのは:
Sergio Pedri committed 2021-05-11 18:13:35 +02:00
1 親 37a6e5a7b3
コミット 0cc3f08eec
1ファイル変更
+5 -1
+5 -1
ファイルの表示
@@ -180,7 +180,11 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
{
string literal = updatedNode.Token.ValueText;
if (!literal.Contains('.')) literal += ".0";
// If the numeric literal is neither a decimal nor an exponential, add the ".0" suffix
if (literal.IndexOfAny(new[] { '.', 'E' }) == -1)
{
literal += ".0";
}
return updatedNode.WithToken(Literal(literal, 0f));
}