Simplify creating source generator builder types
このコミットが含まれているのは:
1 親
26934553f6
コミット
7506cab338
27ファイル変更
+58
-88
検索条件に一致するファイルはありません
@@ -105,8 +105,8 @@ partial class IShaderGenerator
|
||||
ICollection<INamedTypeSymbol> types,
|
||||
bool isComputeShader)
|
||||
{
|
||||
using ImmutableArrayBuilder<(string, string, string)> resources = ImmutableArrayBuilder<(string, string, string)>.Rent();
|
||||
using ImmutableArrayBuilder<(string, string)> values = ImmutableArrayBuilder<(string, string)>.Rent();
|
||||
using ImmutableArrayBuilder<(string, string, string)> resources = new();
|
||||
using ImmutableArrayBuilder<(string, string)> values = new();
|
||||
|
||||
bool hlslResourceFound = false;
|
||||
|
||||
@@ -199,7 +199,7 @@ partial class IShaderGenerator
|
||||
ICollection<INamedTypeSymbol> discoveredTypes,
|
||||
IDictionary<IFieldSymbol, string> constantDefinitions)
|
||||
{
|
||||
using ImmutableArrayBuilder<(string, string, string?)> builder = ImmutableArrayBuilder<(string, string, string?)>.Rent();
|
||||
using ImmutableArrayBuilder<(string, string, string?)> builder = new();
|
||||
|
||||
foreach (FieldDeclarationSyntax fieldDeclaration in structDeclaration.Members.OfType<FieldDeclarationSyntax>())
|
||||
{
|
||||
@@ -263,7 +263,7 @@ partial class IShaderGenerator
|
||||
INamedTypeSymbol structDeclarationSymbol,
|
||||
ICollection<INamedTypeSymbol> types)
|
||||
{
|
||||
using ImmutableArrayBuilder<(string, string, int?)> builder = ImmutableArrayBuilder<(string, string, int?)>.Rent();
|
||||
using ImmutableArrayBuilder<(string, string, int?)> builder = new();
|
||||
|
||||
foreach (IFieldSymbol fieldSymbol in structDeclarationSymbol.GetMembers().OfType<IFieldSymbol>())
|
||||
{
|
||||
@@ -337,7 +337,7 @@ partial class IShaderGenerator
|
||||
where syntaxNode.IsKind(SyntaxKind.MethodDeclaration)
|
||||
select (MethodDeclarationSyntax)syntaxNode).ToImmutableArray();
|
||||
|
||||
using ImmutableArrayBuilder<(string, string)> methods = ImmutableArrayBuilder<(string, string)>.Rent();
|
||||
using ImmutableArrayBuilder<(string, string)> methods = new();
|
||||
|
||||
string? entryPoint = null;
|
||||
bool isSamplerUsed = false;
|
||||
@@ -425,7 +425,7 @@ partial class IShaderGenerator
|
||||
/// <returns>A sequence of discovered constants to declare in the shader.</returns>
|
||||
internal static ImmutableArray<(string Name, string Value)> GetDefinedConstants(IReadOnlyDictionary<IFieldSymbol, string> constantDefinitions)
|
||||
{
|
||||
using ImmutableArrayBuilder<(string, string)> builder = ImmutableArrayBuilder<(string, string)>.Rent();
|
||||
using ImmutableArrayBuilder<(string, string)> builder = new();
|
||||
|
||||
foreach (KeyValuePair<IFieldSymbol, string> constant in constantDefinitions)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ partial class IShaderGenerator
|
||||
IEnumerable<INamedTypeSymbol> types,
|
||||
IReadOnlyDictionary<IMethodSymbol, MethodDeclarationSyntax> instanceMethods)
|
||||
{
|
||||
using ImmutableArrayBuilder<(string, string)> builder = ImmutableArrayBuilder<(string, string)>.Rent();
|
||||
using ImmutableArrayBuilder<(string, string)> builder = new();
|
||||
|
||||
IReadOnlyCollection<INamedTypeSymbol> invalidTypes;
|
||||
|
||||
@@ -567,7 +567,7 @@ partial class IShaderGenerator
|
||||
bool isSamplerUsed,
|
||||
string executeMethod)
|
||||
{
|
||||
using ImmutableArrayBuilder<char> hlslBuilder = ImmutableArrayBuilder<char>.Rent();
|
||||
using ImmutableArrayBuilder<char> hlslBuilder = new();
|
||||
|
||||
void AppendLF()
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする