Rename DispatchAxis to DefaultThreadGroupSizes

このコミットが含まれているのは:
Sergio Pedri committed 2023-11-21 18:03:19 +01:00
1 親 cecc16a52e
コミット be0f0cf593
66ファイル変更
+216 -213

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

+10 -10
ファイルの表示
@@ -46,24 +46,24 @@ partial class ComputeShaderDescriptorGenerator
// Check for a dispatch axis argument first
if (attribute.ConstructorArguments.Length == 1)
{
int dispatchAxis = (int)attribute.ConstructorArguments[0].Value!;
int defaultSize = (int)attribute.ConstructorArguments[0].Value!;
(threadsX, threadsY, threadsZ) = (DispatchAxis)dispatchAxis switch
(threadsX, threadsY, threadsZ) = (DefaultThreadGroupSizes)defaultSize switch
{
DispatchAxis.X => (64, 1, 1),
DispatchAxis.Y => (1, 64, 1),
DispatchAxis.Z => (1, 1, 64),
DispatchAxis.XY => (8, 8, 1),
DispatchAxis.XZ => (8, 1, 8),
DispatchAxis.YZ => (1, 8, 8),
DispatchAxis.XYZ => (4, 4, 4),
DefaultThreadGroupSizes.X => (64, 1, 1),
DefaultThreadGroupSizes.Y => (1, 64, 1),
DefaultThreadGroupSizes.Z => (1, 1, 64),
DefaultThreadGroupSizes.XY => (8, 8, 1),
DefaultThreadGroupSizes.XZ => (8, 1, 8),
DefaultThreadGroupSizes.YZ => (1, 8, 8),
DefaultThreadGroupSizes.XYZ => (4, 4, 4),
_ => (0, 0, 0)
};
// Validate the dispatch axis argument
if ((threadsX, threadsY, threadsZ) is (0, 0, 0))
{
diagnostics.Add(InvalidThreadGroupSizeAttributeDefaultThreadGroupSize, structDeclarationSymbol, structDeclarationSymbol);
diagnostics.Add(InvalidThreadGroupSizeAttributeDefaultThreadGroupSizes, structDeclarationSymbol, structDeclarationSymbol);
threadsX = threadsY = threadsZ = 0;
isCompilationEnabled = false;
+1 -1
ファイルの表示
@@ -60,9 +60,9 @@
<!-- ComputeSharp APIs -->
<Compile Include="..\ComputeSharp\Core\Attributes\Enums\CompileOptions.cs" Link="ComputeSharp\Core\Attributes\Enums\CompileOptions.cs" />
<Compile Include="..\ComputeSharp\Core\Attributes\Enums\DefaultThreadGroupSizes.cs" Link="ComputeSharp\Core\Attributes\Enums\DefaultThreadGroupSizes.cs" />
<Compile Include="..\ComputeSharp\Core\Attributes\GroupSharedAttribute.cs" Link="ComputeSharp\Core\Attributes\GroupSharedAttribute.cs" />
<Compile Include="..\ComputeSharp\Core\Attributes\ThreadGroupSizeAttribute.cs" Link="ComputeSharp\Core\Attributes\ThreadGroupSizeAttribute.cs" />
<Compile Include="..\ComputeSharp\Core\Dispatch\DispatchAxis.cs" Link="ComputeSharp\Core\Dispatch\DispatchAxis.cs" />
<Compile Include="..\ComputeSharp\Core\Dispatch\DispatchSize.cs" Link="ComputeSharp\Core\Dispatch\DispatchSize.cs" />
<Compile Include="..\ComputeSharp\Core\Dispatch\GridIds.cs" Link="ComputeSharp\Core\Dispatch\GridIds.cs" />
<Compile Include="..\ComputeSharp\Core\Dispatch\GroupIds.cs" Link="ComputeSharp\Core\Dispatch\GroupIds.cs" />
+6 -6
ファイルの表示
@@ -654,19 +654,19 @@ partial class DiagnosticDescriptors
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an embedded bytecode shader with an invalid dispatch axis value.
/// Gets a <see cref="DiagnosticDescriptor"/> for shaders shader with an invalid DefaultThreadGroupSizes value.
/// <para>
/// Format: <c>"The shader of type {0} is using an invalid DefaultThreadGroupSize value in its [ThreadGroupSize] attribute"</c>.
/// Format: <c>"The shader of type {0} is using an invalid DefaultThreadGroupSizes value in its [ThreadGroupSize] attribute"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidThreadGroupSizeAttributeDefaultThreadGroupSize = new(
public static readonly DiagnosticDescriptor InvalidThreadGroupSizeAttributeDefaultThreadGroupSizes = new(
id: "CMPS0048",
title: "Invalid DefaultThreadGroupSize value for [ThreadGroupSize] use",
messageFormat: "The shader of type {0} is using an invalid DefaultThreadGroupSize value in its [ThreadGroupSize] attribute",
title: "Invalid DefaultThreadGroupSizes value for [ThreadGroupSize] use",
messageFormat: "The shader of type {0} is using an invalid DefaultThreadGroupSizes value in its [ThreadGroupSize] attribute",
category: "ComputeSharp.Shaders",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "The DefaultThreadGroupSize value for [ThreadGroupSize] attributes have to be valid.",
description: "The DefaultThreadGroupSizes value for [ThreadGroupSize] attributes have to be valid.",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
/// <summary>