Rename HlslKnownMembers to HlslKnownProperties
このコミットが含まれているのは:
1 親
1de2962ae3
コミット
e6673bf7c0
9ファイル変更
+46
-46
検索条件に一致するファイルはありません
@@ -231,7 +231,7 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter
|
||||
|
||||
// Rewrite texture resource indices taking individual indices a vector argument, as per HLSL spec.
|
||||
// For instance: texture[ThreadIds.X, ThreadIds.Y] will be rewritten as texture[int2(ThreadIds.X, ThreadIds.Y)].
|
||||
if (HlslKnownMembers.TryGetMappedResourceIndexerTypeName(propertyName, out string? mapping))
|
||||
if (HlslKnownProperties.TryGetMappedResourceIndexerTypeName(propertyName, out string? mapping))
|
||||
{
|
||||
var index = InvocationExpression(IdentifierName(mapping!), ArgumentList(updatedNode.ArgumentList.Arguments));
|
||||
|
||||
@@ -239,7 +239,7 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter
|
||||
}
|
||||
|
||||
// Rewrite texture resource sampled accesses, if needed
|
||||
if (HlslKnownMembers.TryGetMappedResourceSamplerAccessType(propertyName, out mapping))
|
||||
if (HlslKnownProperties.TryGetMappedResourceSamplerAccessType(propertyName, out mapping))
|
||||
{
|
||||
IsSamplerUsed = true;
|
||||
|
||||
@@ -266,7 +266,7 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter
|
||||
|
||||
// If the current property is a swizzled matrix indexer, ensure all the arguments are constants, and rewrite
|
||||
// the property access to the corresponding HLSL syntax. For instance, m[M11, M12] will become m._m00_m01.
|
||||
if (HlslKnownMembers.IsKnownMatrixIndexer(propertyName))
|
||||
if (HlslKnownProperties.IsKnownMatrixIndexer(propertyName))
|
||||
{
|
||||
bool isValid = true;
|
||||
|
||||
@@ -274,7 +274,7 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter
|
||||
foreach (ArgumentSyntax argument in node.ArgumentList.Arguments)
|
||||
{
|
||||
if (SemanticModel.For(node).GetOperation(argument.Expression) is not IFieldReferenceOperation fieldReference ||
|
||||
!HlslKnownMembers.IsKnownMatrixIndex(fieldReference.Field.GetFullMetadataName()))
|
||||
!HlslKnownProperties.IsKnownMatrixIndex(fieldReference.Field.GetFullMetadataName()))
|
||||
{
|
||||
Diagnostics.Add(NonConstantMatrixSwizzledIndex, argument);
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter
|
||||
|
||||
// If the current member access is a field or property access, check the lookup table
|
||||
// to see if the member should be rewritten for HLSL compliance, and rewrite if needed.
|
||||
if (HlslKnownMembers.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping))
|
||||
if (HlslKnownProperties.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping))
|
||||
{
|
||||
// Mark which dispatch properties have been used, to optimize the declaration afterwards
|
||||
if (operation.Member.IsStatic)
|
||||
@@ -326,7 +326,7 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter
|
||||
// property access into an invocation of an autogenerated static helper method to get the target
|
||||
// dimension for the buffer in use. The helper method is added to the list of static helpers.
|
||||
if (operation is IPropertyReferenceOperation propertyOperation &&
|
||||
HlslKnownMembers.TryGetAccessorRankAndAxis(propertyOperation.Property.GetFullMetadataName(), out int rank, out int axis))
|
||||
HlslKnownProperties.TryGetAccessorRankAndAxis(propertyOperation.Property.GetFullMetadataName(), out int rank, out int axis))
|
||||
{
|
||||
IMethodSymbol key = propertyOperation.Property.GetMethod!;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ internal sealed class StaticFieldRewriter : HlslSourceRewriter
|
||||
return IdentifierName(constantName);
|
||||
}
|
||||
|
||||
if (HlslKnownMembers.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping))
|
||||
if (HlslKnownProperties.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping))
|
||||
{
|
||||
if (operation.Member.IsStatic)
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする