Use GetText instead of ToFullString
このコミットが含まれているのは:
1 親
b7770934dc
コミット
1465b5fd9d
6ファイル変更
+34
-24
検索条件に一致するファイルはありません
+5
-3
@@ -1,12 +1,14 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ComputeSharp.__Internals;
|
||||
using ComputeSharp.D2D1.__Internals;
|
||||
using ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
@@ -25,17 +27,17 @@ partial class ID2D1ShaderGenerator
|
||||
/// <param name="bytecodeInfo">The input bytecode info.</param>
|
||||
/// <param name="fixup">An opaque <see cref="Func{TResult}"/> instance to transform the final tree into text.</param>
|
||||
/// <returns>The resulting <see cref="MethodDeclarationSyntax"/> instance for the <c>BuildHlslSource</c> method.</returns>
|
||||
public static MethodDeclarationSyntax GetSyntax(EmbeddedBytecodeInfo bytecodeInfo, out Func<SyntaxNode, string> fixup)
|
||||
public static MethodDeclarationSyntax GetSyntax(EmbeddedBytecodeInfo bytecodeInfo, out Func<SyntaxNode, SourceText> fixup)
|
||||
{
|
||||
BlockSyntax block = GetShaderBytecodeBody(bytecodeInfo, out string? bytecodeLiterals);
|
||||
|
||||
if (bytecodeLiterals is not null)
|
||||
{
|
||||
fixup = tree => tree.ToFullString().Replace("__EMBEDDED_SHADER_BYTECODE", bytecodeLiterals);
|
||||
fixup = tree => SourceText.From(tree.ToFullString().Replace("__EMBEDDED_SHADER_BYTECODE", bytecodeLiterals), Encoding.UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
fixup = static tree => tree.ToFullString();
|
||||
fixup = static tree => tree.GetText(Encoding.UTF8);
|
||||
}
|
||||
|
||||
// This code produces a method declaration as follows:
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする