Fixed build errors in the unit test projects

このコミットが含まれているのは:
Sergio Pedri committed 2021-02-18 00:37:55 +01:00
1 親 707f0be5c4
コミット 103f3abbe1
4ファイル変更
+25 -5

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

+1 -1
ファイルの表示
@@ -48,7 +48,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.9.0-4.final" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3-beta1.21116.13" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3-beta1.21117.2" PrivateAssets="all" Pack="false" />
</ItemGroup>
</Project>
+6 -3
ファイルの表示
@@ -121,13 +121,16 @@ namespace ComputeSharp.SourceGenerators
continue;
}
string metadataName = typeSymbol.GetFullMetadataName();
// Track the type of items in the current buffer
if (HlslKnownTypes.IsTypedResourceType(typeSymbol.GetFullMetadataName()) &&
typeSymbol.TypeArguments.Length == 1)
if (HlslKnownTypes.IsStructuredBufferType(metadataName))
{
types.Add((INamedTypeSymbol)typeSymbol.TypeArguments[0]);
}
else if (!typeSymbol.IsUnmanagedType)
else if (!HlslKnownTypes.IsTypedResourceType(metadataName) &&
!typeSymbol.IsUnmanagedType &&
typeSymbol.TypeKind != TypeKind.Delegate)
{
// Shaders can only capture valid HLSL resource types or unmanaged types
context.ReportDiagnostic(Diagnostic.Create(
+17
ファイルの表示
@@ -66,6 +66,23 @@ namespace ComputeSharp.SourceGenerators.Mappings
typeof(WarpIds)
};
/// <summary>
/// Checks whether or not a given type name matches a structured buffer type.
/// </summary>
/// <param name="typeName">The input type name to check.</param>
/// <returns>Whether or not <paramref name="typeName"/> represents a structured buffer type.</returns>
public static bool IsStructuredBufferType(string typeName)
{
switch (typeName)
{
case "ComputeSharp.ConstantBuffer`1":
case "ComputeSharp.ReadOnlyBuffer`1":
case "ComputeSharp.ReadWriteBuffer`1":
return true;
default: return false;
};
}
/// <summary>
/// Checks whether or not a given type name matches a typed resource type.
/// </summary>
@@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.9.0-4.final" />
</ItemGroup>
<ItemGroup>