Move HLSL extensions to new shared project

このコミットが含まれているのは:
Sergio Pedri committed 2022-04-24 21:04:28 +02:00
1 親 33235d68c8
コミット 31cfdd9eca
22ファイル変更
+44 -238

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

+17
ファイルの表示
@@ -0,0 +1,17 @@
namespace ComputeSharp.SourceGeneration.Extensions;
/// <summary>
/// Extension methods for <see cref="string"/> types.
/// </summary>
internal static class StringExtensions
{
/// <summary>
/// Converts a given <see cref="string"/> instance to a valid HLSL identifier name.
/// </summary>
/// <param name="text">The input <see cref="string"/> instance to convert.</param>
/// <returns>An valid HLSL identifier name from <paramref name="text"/>.</returns>
public static string ToHlslIdentifierName(this string text)
{
return text.Replace('.', '_').Replace('+', '_');
}
}