Fixed non public static methods in shaders
このコミットが含まれているのは:
1 親
a16ca5b2ad
コミット
68acc46bb1
2ファイル変更
+19
検索条件に一致するファイルはありません
@@ -95,6 +95,10 @@ namespace ComputeSharp.Shaders.Extensions
|
||||
isReadonly = !propertyInfo.CanWrite;
|
||||
memberInfo = propertyInfo;
|
||||
break;
|
||||
case MethodInfo methodInfo:
|
||||
string methodName = $"{methodInfo.DeclaringType.Name}_{methodInfo.Name}";
|
||||
method = (methodName, methodInfo);
|
||||
return SyntaxFactory.IdentifierName(methodName).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia());
|
||||
default: throw new InvalidOperationException($"Invalid symbol kind: {memberInfos.First().GetType()}");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace ComputeSharp.Tests
|
||||
[Pure]
|
||||
public static float Square(float x) => x * x;
|
||||
|
||||
[Pure]
|
||||
internal static float InternalSquare(float x) => x * x;
|
||||
|
||||
[Pure]
|
||||
public static Float4 Range(float x) => new Float4(x, x + 1, x + 2, x + 3);
|
||||
|
||||
@@ -39,6 +42,18 @@ namespace ComputeSharp.Tests
|
||||
Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void InternalFloatToFloatFunc()
|
||||
{
|
||||
using ReadWriteBuffer<float> buffer = Gpu.Default.AllocateReadWriteBuffer<float>(1);
|
||||
|
||||
Gpu.Default.For(1, id => buffer[0] = StaticMethodsContainer.InternalSquare(3));
|
||||
|
||||
float[] result = buffer.GetData();
|
||||
|
||||
Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void FloatToFloat4Func()
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする