Don't rewrite 'ConstantBuffer<T>.Length'

このコミットが含まれているのは:
Sergio Pedri committed 2024-06-05 19:32:00 -07:00
1 親 908d691b2a
コミット 94a1f85415
2ファイル変更
+12

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

+8
ファイルの表示
@@ -451,6 +451,14 @@ internal sealed partial class ShaderSourceRewriter(
if (!this.staticMethods.TryGetValue(key, out MethodDeclarationSyntax? methodSyntax))
{
INamedTypeSymbol resourceType = (INamedTypeSymbol)SemanticModel.For(node).GetTypeInfo(node.Expression, CancellationToken).Type!;
// Explicitly ignore 'ConstantBuffer<T>.Length', as that is not valid in HLSL.
// The type should just be reworked entirely at some point, but not today.
if (resourceType.Name == "ConstantBuffer")
{
return updatedNode;
}
string resourceName = HlslKnownTypes.GetMappedName(resourceType);
// Create a static method to get a specified dimension for a target resource type.