Use explicit types for static builder methods
このコミットが含まれているのは:
1 親
11efdfdb1f
コミット
263b5e26db
7ファイル変更
+11
-13
検索条件に一致するファイルはありません
@@ -15,9 +15,9 @@ internal static partial class HlslKnownFields
|
||||
/// <summary>
|
||||
/// Builds the mapping of supported known fields to HLSL names.
|
||||
/// </summary>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownFieldsMap()
|
||||
private static Dictionary<string, string> BuildKnownFieldsMap()
|
||||
{
|
||||
Dictionary<string, string> knownMembers = new()
|
||||
return new()
|
||||
{
|
||||
[$"float.{nameof(float.NaN)}"] = "asfloat(0xFFC00000)",
|
||||
[$"float.{nameof(float.PositiveInfinity)}"] = "asfloat(0x7F800000)",
|
||||
@@ -27,8 +27,6 @@ internal static partial class HlslKnownFields
|
||||
[$"double.{nameof(double.PositiveInfinity)}"] = "asdouble(0x00000000, 0x7FF00000)",
|
||||
[$"double.{nameof(double.NegativeInfinity)}"] = "asdouble(0x00000000, 0xFFF00000)"
|
||||
};
|
||||
|
||||
return knownMembers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -21,7 +21,7 @@ internal static partial class HlslKnownKeywords
|
||||
/// <summary>
|
||||
/// Builds the mapping of all known HLSL keywords.
|
||||
/// </summary>
|
||||
private static IReadOnlyCollection<string> BuildKnownKeywordsMap()
|
||||
private static HashSet<string> BuildKnownKeywordsMap()
|
||||
{
|
||||
// HLSL keywords
|
||||
HashSet<string> knownKeywords = new(
|
||||
|
||||
@@ -25,7 +25,7 @@ internal static partial class HlslKnownMethods
|
||||
/// <summary>
|
||||
/// Builds the mapping of supported known methods to HLSL names.
|
||||
/// </summary>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownMethodsMap()
|
||||
private static Dictionary<string, string> BuildKnownMethodsMap()
|
||||
{
|
||||
Dictionary<string, string> knownMethods = new()
|
||||
{
|
||||
@@ -162,7 +162,7 @@ internal static partial class HlslKnownMethods
|
||||
/// <summary>
|
||||
/// Builds the mapping of supported known methods that require parameters mapping to HLSL names.
|
||||
/// </summary>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownMethodsParametersMappingMap()
|
||||
private static Dictionary<string, string> BuildKnownMethodsParametersMappingMap()
|
||||
{
|
||||
ILookup<string, MethodInfo> methodsLookup = typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static).ToLookup(static method => method.Name);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ internal static partial class HlslKnownOperators
|
||||
/// Builds the mapping of supported known operators to HLSL names.
|
||||
/// </summary>
|
||||
/// <returns>The mapping of supported known operators to HLSL names.</returns>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownOperatorsMap()
|
||||
private static Dictionary<string, string> BuildKnownOperatorsMap()
|
||||
{
|
||||
Dictionary<string, string> knownOperators = [];
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ internal static partial class HlslKnownProperties
|
||||
/// <summary>
|
||||
/// Builds the mapping of supported known properties to HLSL names.
|
||||
/// </summary>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownPropertiesMap()
|
||||
private static Dictionary<string, string> BuildKnownPropertiesMap()
|
||||
{
|
||||
Dictionary<string, string> knownProperties = new()
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ internal static class HlslKnownSizes
|
||||
/// <summary>
|
||||
/// Builds the mapping of known type sizes and alignments.
|
||||
/// </summary>
|
||||
private static IReadOnlyDictionary<string, (int, int)> BuildKnownSizesMap()
|
||||
private static Dictionary<string, (int, int)> BuildKnownSizesMap()
|
||||
{
|
||||
Dictionary<string, (int, int)> knownSizes = new()
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ internal static partial class HlslKnownTypes
|
||||
/// Builds the mapping of known HLSL vector types.
|
||||
/// </summary>
|
||||
/// <returns>The mapping of known HLSL vector types.</returns>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownVectorTypeMetadataNames()
|
||||
private static Dictionary<string, string> BuildKnownVectorTypeMetadataNames()
|
||||
{
|
||||
return KnownVectorTypes.ToDictionary(
|
||||
keySelector: static type => type.FullName,
|
||||
@@ -86,7 +86,7 @@ internal static partial class HlslKnownTypes
|
||||
/// Builds the mapping of known HLSL matrix types.
|
||||
/// </summary>
|
||||
/// <returns>The mapping of known HLSL matrix types.</returns>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownMatrixTypeMetadataNames()
|
||||
private static Dictionary<string, string> BuildKnownMatrixTypeMetadataNames()
|
||||
{
|
||||
return KnownMatrixTypes.ToDictionary(
|
||||
keySelector: static type => type.FullName,
|
||||
@@ -97,7 +97,7 @@ internal static partial class HlslKnownTypes
|
||||
/// Builds the mapping of known primitive types.
|
||||
/// </summary>
|
||||
/// <returns>The mapping of known primitive types.</returns>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownHlslTypeMetadataNames()
|
||||
private static Dictionary<string, string> BuildKnownHlslTypeMetadataNames()
|
||||
{
|
||||
Dictionary<string, string> knownTypes = new()
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする