Remove ResourceTextureDescriptionsInfo model
このコミットが含まれているのは:
1 親
f94d86e789
コミット
8d129d3d30
4ファイル変更
+10
-19
検索条件に一致するファイルはありません
+7
-7
@@ -20,16 +20,16 @@ partial class ID2D1ShaderGenerator
|
||||
/// <summary>
|
||||
/// Creates a <see cref="PropertyDeclarationSyntax"/> instance for the <c>ResourceTextureDescriptions</c> property.
|
||||
/// </summary>
|
||||
/// <param name="resourceTextureDescriptionsInfo">The resource texture descriptions info gathered for the current shader.</param>
|
||||
/// <param name="resourceTextureDescriptions">The resource texture descriptions info gathered for the current shader.</param>
|
||||
/// <param name="additionalTypes">Any additional <see cref="TypeDeclarationSyntax"/> instances needed by the generated code, if needed.</param>
|
||||
/// <returns>The resulting <see cref="PropertyDeclarationSyntax"/> instance for the <c>ResourceTextureDescriptions</c> property.</returns>
|
||||
public static PropertyDeclarationSyntax GetSyntax(ResourceTextureDescriptionsInfo resourceTextureDescriptionsInfo, out TypeDeclarationSyntax[] additionalTypes)
|
||||
public static PropertyDeclarationSyntax GetSyntax(EquatableArray<ResourceTextureDescription> resourceTextureDescriptions, out TypeDeclarationSyntax[] additionalTypes)
|
||||
{
|
||||
ExpressionSyntax memoryExpression;
|
||||
|
||||
// If there are no resource texture descriptions, just return a default expression.
|
||||
// Otherwise, declare the shared array and return it from the property.
|
||||
if (resourceTextureDescriptionsInfo.ResourceTextureDescriptions.Length == 0)
|
||||
if (resourceTextureDescriptions.Length == 0)
|
||||
{
|
||||
memoryExpression = LiteralExpression(SyntaxKind.DefaultLiteralExpression, Token(SyntaxKind.DefaultKeyword));
|
||||
additionalTypes = Array.Empty<TypeDeclarationSyntax>();
|
||||
@@ -41,7 +41,7 @@ partial class ID2D1ShaderGenerator
|
||||
IdentifierName("Data"),
|
||||
IdentifierName(nameof(ResourceTextureDescriptions)));
|
||||
|
||||
additionalTypes = new[] { GetArrayDeclaration(resourceTextureDescriptionsInfo) };
|
||||
additionalTypes = new[] { GetArrayDeclaration(resourceTextureDescriptions) };
|
||||
}
|
||||
|
||||
// This code produces a method declaration as follows:
|
||||
@@ -61,13 +61,13 @@ partial class ID2D1ShaderGenerator
|
||||
/// <summary>
|
||||
/// Gets the array declaration for the given resource texture descriptions.
|
||||
/// </summary>
|
||||
/// <param name="resourceTextureDescriptionsInfo">The resource texture descriptions info gathered for the current shader.</param>
|
||||
/// <param name="resourceTextureDescriptions">The resource texture descriptions info gathered for the current shader.</param>
|
||||
/// <returns>The array declaration for the given resource texture descriptions.</returns>
|
||||
private static TypeDeclarationSyntax GetArrayDeclaration(ResourceTextureDescriptionsInfo resourceTextureDescriptionsInfo)
|
||||
private static TypeDeclarationSyntax GetArrayDeclaration(EquatableArray<ResourceTextureDescription> resourceTextureDescriptions)
|
||||
{
|
||||
using ImmutableArrayBuilder<ExpressionSyntax> resourceTextureDescriptionExpressions = ImmutableArrayBuilder<ExpressionSyntax>.Rent();
|
||||
|
||||
foreach (ResourceTextureDescription resourceTextureDescription in resourceTextureDescriptionsInfo.ResourceTextureDescriptions)
|
||||
foreach (ResourceTextureDescription resourceTextureDescription in resourceTextureDescriptions)
|
||||
{
|
||||
// Create the description expression:
|
||||
//
|
||||
|
||||
@@ -147,7 +147,7 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
|
||||
ConstantBufferSizeInBytes: constantBufferSizeInBytes,
|
||||
Fields: fieldInfos,
|
||||
InputTypes: inputTypes,
|
||||
ResourceTextureDescriptions: new ResourceTextureDescriptionsInfo(resourceTextureDescriptions),
|
||||
ResourceTextureDescriptions: resourceTextureDescriptions,
|
||||
HlslShaderSource: new HlslShaderSourceInfo(
|
||||
hlslSource,
|
||||
shaderProfile,
|
||||
@@ -266,7 +266,7 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
|
||||
});
|
||||
|
||||
// Get the ResourceTextureDescriptions info (hierarchy and resource texture descriptions)
|
||||
IncrementalValuesProvider<(HierarchyInfo Hierarchy, ResourceTextureDescriptionsInfo ResourceTextureDescriptions)> resourceTextureDescriptionsInfo =
|
||||
IncrementalValuesProvider<(HierarchyInfo Hierarchy, EquatableArray<ResourceTextureDescription> ResourceTextureDescriptions)> resourceTextureDescriptionsInfo =
|
||||
shaderInfoWithErrors
|
||||
.Select(static (item, _) => (item.Hierarchy, item.ResourceTextureDescriptions));
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ internal sealed record D2D1ShaderInfo(
|
||||
int ConstantBufferSizeInBytes,
|
||||
EquatableArray<FieldInfo> Fields,
|
||||
EquatableArray<uint> InputTypes,
|
||||
ResourceTextureDescriptionsInfo ResourceTextureDescriptions,
|
||||
EquatableArray<ResourceTextureDescription> ResourceTextureDescriptions,
|
||||
HlslShaderSourceInfo HlslShaderSource,
|
||||
OutputBufferInfo OutputBuffer,
|
||||
InputDescriptionsInfo InputDescriptions,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using ComputeSharp.SourceGeneration.Helpers;
|
||||
|
||||
namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A model representing gathered resource texture descriptions for a shader.
|
||||
/// </summary>
|
||||
/// <param name="ResourceTextureDescriptions">The resource textures for the current shader.</param>
|
||||
internal sealed record ResourceTextureDescriptionsInfo(EquatableArray<ResourceTextureDescription> ResourceTextureDescriptions);
|
||||
新しいイシューから参照
ユーザーをブロックする