Initial support for static delegates in shaders
このコミットが含まれているのは:
1 親
68acc46bb1
コミット
4da6f12e7e
1ファイル変更
+24
-1
@@ -13,7 +13,6 @@ using ComputeSharp.Shaders.Renderer.Models.Functions;
|
||||
using ComputeSharp.Shaders.Translation.Enums;
|
||||
using ComputeSharp.Shaders.Translation.Models;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Vortice.Direct3D12;
|
||||
using ParameterInfo = ComputeSharp.Shaders.Renderer.Models.Functions.ParameterInfo;
|
||||
@@ -247,6 +246,30 @@ namespace ComputeSharp.Shaders.Translation
|
||||
LoadFieldInfo(fieldInfo, null, updatedParents);
|
||||
}
|
||||
}
|
||||
else if (fieldType.IsClass && fieldType.IsGenericType &&
|
||||
fieldType.IsSubclassOf(typeof(Delegate)) &&
|
||||
memberInfo.GetValue(Action.Target) is Delegate func && func.Method.IsStatic &&
|
||||
fieldType.GetGenericTypeDefinition() is Type fieldTypeDefinition && (
|
||||
fieldTypeDefinition == typeof(Func<>) ||
|
||||
fieldTypeDefinition == typeof(Func<,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,,,,,,,>) ||
|
||||
fieldTypeDefinition == typeof(Func<,,,,,,,,,,,,,,,,>)))
|
||||
{
|
||||
LoadStaticMethodSource(fieldName, func.Method);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする