Remove unnecessary [Pure] attributes

このコミットが含まれているのは:
Sergio Pedri committed 2021-12-19 17:55:06 +01:00
1 親 30fea918cf
コミット 4d51d8d05b
53ファイル変更
+70 -2093

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

-3
ファイルの表示
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Reflection;
using ComputeSharp.Core.Intrinsics.Attributes;
@@ -19,7 +18,6 @@ internal static class HlslKnownKeywords
/// <summary>
/// Builds the mapping of all known HLSL keywords.
/// </summary>
[Pure]
private static IReadOnlyCollection<string> BuildKnownKeywordsMap()
{
// HLSL keywords
@@ -58,7 +56,6 @@ internal static class HlslKnownKeywords
/// <param name="name">The input identifier name.</param>
/// <param name="mapped">The mapped identifier name, if a replacement is needed.</param>
/// <returns>The HLSL-compatible identifier name that can be used in an HLSL shader.</returns>
[Pure]
public static bool TryGetMappedName(string name, out string? mapped)
{
mapped = KnownKeywords.Contains(name) switch
-10
ファイルの表示
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Numerics;
using System.Reflection;
@@ -79,7 +78,6 @@ internal static class HlslKnownMembers
/// <summary>
/// Builds the mapping of supported known members to HLSL names.
/// </summary>
[Pure]
private static IReadOnlyDictionary<string, string> BuildKnownMembersMap()
{
Dictionary<string, string> knownMembers = new()
@@ -325,7 +323,6 @@ internal static class HlslKnownMembers
/// <summary>
/// Builds the mapping of swizzled matrix indexer properties.
/// </summary>
[Pure]
private static IReadOnlyCollection<string> BuildKnownMatrixIndexers()
{
return (
@@ -347,7 +344,6 @@ internal static class HlslKnownMembers
/// <summary>
/// Builds the mapping of swizzled matrix indices.
/// </summary>
[Pure]
private static IReadOnlyCollection<string> BuildKnownMatrixIndices()
{
return (
@@ -360,7 +356,6 @@ internal static class HlslKnownMembers
/// </summary>
/// <param name="name">The input fully qualified member name.</param>
/// <returns>Whether or not <paramref name="name"/> is a matrix swizzled indexer.</returns>
[Pure]
public static bool IsKnownMatrixIndexer(string name)
{
return KnownMatrixIndexers.Contains(name);
@@ -371,7 +366,6 @@ internal static class HlslKnownMembers
/// </summary>
/// <param name="name">The input fully qualified member name.</param>
/// <returns>Whether or not <paramref name="name"/> is a matrix swizzled index.</returns>
[Pure]
public static bool IsKnownMatrixIndex(string name)
{
return KnownMatrixIndices.Contains(name);
@@ -383,7 +377,6 @@ internal static class HlslKnownMembers
/// <param name="name">The input fully qualified member name.</param>
/// <param name="mapped">The mapped name, if one is found.</param>
/// <returns>The HLSL-compatible member name that can be used in an HLSL shader.</returns>
[Pure]
public static bool TryGetMappedName(string name, out string? mapped)
{
return KnownMembers.TryGetValue(name, out mapped);
@@ -395,7 +388,6 @@ internal static class HlslKnownMembers
/// <param name="name">The input fully qualified indexer name.</param>
/// <param name="mapped">The mapped type name, if one is found.</param>
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader for the given indexer.</returns>
[Pure]
public static bool TryGetMappedResourceIndexerTypeName(string name, out string? mapped)
{
return KnownResourceIndexers.TryGetValue(name, out mapped);
@@ -407,7 +399,6 @@ internal static class HlslKnownMembers
/// <param name="name">The input fully qualified indexer name.</param>
/// <param name="mapped">The mapped type name, if one is found.</param>
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader for the given sampler.</returns>
[Pure]
public static bool TryGetMappedResourceSamplerAccessType(string name, out string? mapped)
{
return KnownResourceSamplers.TryGetValue(name, out mapped);
@@ -420,7 +411,6 @@ internal static class HlslKnownMembers
/// <param name="rank">The resulting indexer rank, if found.</param>
/// <param name="axis">The resulting indexer axis, if found.</param>
/// <returns>Whether or not a rank and axis could be resolved by the input indexer name.</returns>
[Pure]
public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis)
{
if (KnownSizeAccessors.TryGetValue(name, out var info))
-3
ファイルの表示
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Numerics;
using System.Reflection;
@@ -21,7 +20,6 @@ internal static class HlslKnownMethods
/// <summary>
/// Builds the mapping of supported known methods to HLSL names.
/// </summary>
[Pure]
private static IReadOnlyDictionary<string, string> BuildKnownMethodsMap()
{
Dictionary<string, string> knownMethods = new()
@@ -148,7 +146,6 @@ internal static class HlslKnownMethods
/// <param name="name">The input fully qualified method name.</param>
/// <param name="mapped">The mapped name, if one is found.</param>
/// <returns>The HLSL-compatible member name that can be used in an HLSL shader.</returns>
[Pure]
public static bool TryGetMappedName(string name, out string? mapped)
{
return KnownMethods.TryGetValue(name, out mapped);
-3
ファイルの表示
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Numerics;
using System.Reflection;
@@ -20,7 +19,6 @@ internal static class HlslKnownSizes
/// <summary>
/// Builds the mapping of known type sizes and alignments.
/// </summary>
[Pure]
private static IReadOnlyDictionary<string, (int, int)> BuildKnownSizesMap()
{
Dictionary<string, (int, int)> knownSizes = new()
@@ -53,7 +51,6 @@ internal static class HlslKnownSizes
/// </summary>
/// <param name="typeName">The type name to get info for.</param>
/// <returns>The size and and alignment for the input type.</returns>
[Pure]
public static (int Size, int Pack) GetTypeInfo(string typeName)
{
return KnownSizes[typeName];
-6
ファイルの表示
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Numerics;
using System.Text.RegularExpressions;
@@ -73,7 +72,6 @@ internal static class HlslKnownTypes
/// <summary>
/// Builds the mapping of known primitive types.
/// </summary>
[Pure]
private static IReadOnlyDictionary<string, string> BuildKnownHlslTypes()
{
Dictionary<string, string> knownTypes = new()
@@ -263,7 +261,6 @@ internal static class HlslKnownTypes
/// </summary>
/// <param name="typeSymbol">The input type to map.</param>
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader.</returns>
[Pure]
public static string GetMappedName(INamedTypeSymbol typeSymbol)
{
// Delegate types just return an empty string, as they're not actually
@@ -320,7 +317,6 @@ internal static class HlslKnownTypes
/// </summary>
/// <param name="typeSymbol">The pixel shader type to map.</param>
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader.</returns>
[Pure]
public static string GetMappedNameForPixelShaderType(INamedTypeSymbol typeSymbol)
{
string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments.First()).GetFullMetadataName();
@@ -340,7 +336,6 @@ internal static class HlslKnownTypes
/// </summary>
/// <param name="typeSymbol">The input type to map.</param>
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader.</returns>
[Pure]
public static string GetMappedElementName(IArrayTypeSymbol typeSymbol)
{
string elementTypeName = ((INamedTypeSymbol)typeSymbol.ElementType).GetFullMetadataName();
@@ -402,7 +397,6 @@ internal static class HlslKnownTypes
/// </summary>
/// <param name="types">The input collection of types to declare.</param>
/// <returns>The same list as input, but in a valid HLSL declaration order.</returns>
[Pure]
private static IEnumerable<INamedTypeSymbol> OrderByDependency(IEnumerable<INamedTypeSymbol> types)
{
Queue<(INamedTypeSymbol Type, HashSet<INamedTypeSymbol> Fields)> queue = new();