Renamed WarpIds type to GridIds
このコミットが含まれているのは:
1 親
ebc32be071
コミット
c5aed333af
9ファイル変更
+58
-58
検索条件に一致するファイルはありません
@@ -20,7 +20,7 @@
|
||||
<Compile Include="..\ComputeSharp\Core\Dispatch\GroupIds.cs" Link="Core\Dispatch\GroupIds.cs" />
|
||||
<Compile Include="..\ComputeSharp\Core\Dispatch\GroupSize.cs" Link="Core\Dispatch\GroupSize.cs" />
|
||||
<Compile Include="..\ComputeSharp\Core\Dispatch\ThreadIds.cs" Link="Core\Dispatch\ThreadIds.cs" />
|
||||
<Compile Include="..\ComputeSharp\Core\Dispatch\WarpIds.cs" Link="Core\Dispatch\WarpIds.cs" />
|
||||
<Compile Include="..\ComputeSharp\Core\Dispatch\GridIds.cs" Link="Core\Dispatch\GridIds.cs" />
|
||||
<Compile Include="..\ComputeSharp\Core\Exceptions\InvalidExecutionContextException.cs" Link="Core\Exceptions\InvalidExecutionContextException.cs" />
|
||||
<Compile Include="..\ComputeSharp\Core\Exceptions\MissingMethodSourceException.cs" Link="Core\Exceptions\MissingMethodSourceException.cs" />
|
||||
<Compile Include="..\ComputeSharp\Core\Extensions\MethodInfoExtensions.cs" Link="Core\Extensions\MethodInfoExtensions.cs" />
|
||||
|
||||
@@ -127,16 +127,16 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid <see cref="WarpIds"/> usage.
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid <see cref="GridIds"/> usage.
|
||||
/// </summary>
|
||||
public static readonly DiagnosticDescriptor InvalidWarpIdsUsage = new(
|
||||
public static readonly DiagnosticDescriptor InvalidGridIdsUsage = new(
|
||||
id: "CMPS0009",
|
||||
title: "Invalid WarpIds usage",
|
||||
messageFormat: "The WarpIds type can only be used within the main body of a compute shader",
|
||||
title: "Invalid GridIds usage",
|
||||
messageFormat: "The GridIds type can only be used within the main body of a compute shader",
|
||||
category: typeof(IComputeShader).FullName,
|
||||
defaultSeverity: DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: "The WarpIds type can only be used within the main body of a compute shader.",
|
||||
description: "The GridIds type can only be used within the main body of a compute shader.",
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
knownKeywords.Add(nameof(ThreadIds));
|
||||
knownKeywords.Add(nameof(GroupIds));
|
||||
knownKeywords.Add(nameof(GroupSize));
|
||||
knownKeywords.Add(nameof(WarpIds));
|
||||
knownKeywords.Add(nameof(GridIds));
|
||||
|
||||
// HLSL intrinsics method names
|
||||
foreach (var method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static))
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
{
|
||||
typeof(ThreadIds),
|
||||
typeof(GroupIds),
|
||||
typeof(WarpIds)
|
||||
typeof(GridIds)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
_ when typeName == typeof(ThreadIds).FullName => InvalidThreadIdsUsage,
|
||||
_ when typeName == typeof(GroupIds).FullName => InvalidGroupIdsUsage,
|
||||
_ when typeName == typeof(GroupSize).FullName => InvalidGroupSizeUsage,
|
||||
_ when typeName == typeof(WarpIds).FullName => InvalidWarpIdsUsage,
|
||||
_ when typeName == typeof(GridIds).FullName => InvalidGridIdsUsage,
|
||||
_ => null
|
||||
};
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint __{nameof(GroupIds)}__get_Index : SV_GroupIndex")));
|
||||
}
|
||||
|
||||
if (this.shaderSourceRewriter.IsWarpIdsUsed)
|
||||
if (this.shaderSourceRewriter.IsGridIdsUsed)
|
||||
{
|
||||
updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(WarpIds)} : SV_GroupID")));
|
||||
updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(GridIds)} : SV_GroupID")));
|
||||
}
|
||||
|
||||
return updatedNode;
|
||||
|
||||
@@ -118,9 +118,9 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
public bool IsGroupIdsIndexUsed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether or not the shader uses <see cref="WarpIds"/> at least once.
|
||||
/// Gets whether or not the shader uses <see cref="GridIds"/> at least once.
|
||||
/// </summary>
|
||||
public bool IsWarpIdsUsed { get; set; }
|
||||
public bool IsGridIdsUsed { get; set; }
|
||||
|
||||
/// <inheritdoc cref="CSharpSyntaxRewriter.Visit(SyntaxNode?)"/>
|
||||
public MethodDeclarationSyntax? Visit(MethodDeclarationSyntax? node)
|
||||
@@ -277,7 +277,7 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
|
||||
if (mapping == $"__{nameof(GroupIds)}__get_Index") IsGroupIdsIndexUsed = true;
|
||||
else if (typeName == typeof(GroupIds).FullName) IsGroupIdsUsed = true;
|
||||
else if (typeName == typeof(WarpIds).FullName) IsWarpIdsUsed = true;
|
||||
else if (typeName == typeof(GridIds).FullName) IsGridIdsUsed = true;
|
||||
|
||||
// Check that the dispatch info types are only used from the main shader body
|
||||
if (!this.isEntryPoint || this.localFunctionDepth > 0)
|
||||
@@ -287,7 +287,7 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
_ when typeName == typeof(ThreadIds).FullName => InvalidThreadIdsUsage,
|
||||
_ when typeName == typeof(GroupIds).FullName => InvalidGroupIdsUsage,
|
||||
_ when typeName == typeof(GroupSize).FullName => InvalidGroupSizeUsage,
|
||||
_ when typeName == typeof(WarpIds).FullName => InvalidWarpIdsUsage,
|
||||
_ when typeName == typeof(GridIds).FullName => InvalidGridIdsUsage,
|
||||
_ => null
|
||||
};
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする