Use pooled array builders in all generators
このコミットが含まれているのは:
1 親
d4b1e71c39
コミット
883d99ca9f
31ファイル変更
+320
-205
検索条件に一致するファイルはありません
+4
-3
@@ -6,6 +6,7 @@ using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.Core.Helpers;
|
||||
using ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
using ComputeSharp.SourceGeneration.Extensions;
|
||||
using ComputeSharp.SourceGeneration.Helpers;
|
||||
using ComputeSharp.SourceGeneration.Mappings;
|
||||
using ComputeSharp.SourceGeneration.Models;
|
||||
using Microsoft.CodeAnalysis;
|
||||
@@ -29,7 +30,7 @@ partial class ID2D1ShaderGenerator
|
||||
/// <param name="constantBufferSizeInBytes">The size of the shader constant buffer.</param>
|
||||
/// <returns>The sequence of <see cref="FieldInfo"/> instances for all captured resources and values.</returns>
|
||||
public static ImmutableArray<FieldInfo> GetInfo(
|
||||
ImmutableArray<DiagnosticInfo>.Builder diagnostics,
|
||||
ImmutableArrayBuilder<DiagnosticInfo> diagnostics,
|
||||
ITypeSymbol structDeclarationSymbol,
|
||||
out int constantBufferSizeInBytes)
|
||||
{
|
||||
@@ -123,7 +124,7 @@ partial class ID2D1ShaderGenerator
|
||||
// each row needs to be at a multiple of 16 bytes (a float4 register).
|
||||
if (HlslKnownTypes.IsNonLinearMatrixType(typeName, out string? elementName, out int rows, out int columns))
|
||||
{
|
||||
ImmutableArray<int>.Builder builder = ImmutableArray.CreateBuilder<int>(rows);
|
||||
using ImmutableArrayBuilder<int> builder = ImmutableArrayBuilder<int>.Rent();
|
||||
|
||||
for (int j = 0; j < rows; j++)
|
||||
{
|
||||
@@ -140,7 +141,7 @@ partial class ID2D1ShaderGenerator
|
||||
elementName!,
|
||||
rows,
|
||||
columns,
|
||||
builder.MoveToImmutable());
|
||||
builder.ToImmutable());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする