Added forward declarations for shader methods
Fixes https://github.com/Sergio0694/ComputeSharp/issues/117
このコミットが含まれているのは:
1 親
979b89dba2
コミット
003a322912
8ファイル変更
+118
-16
検索条件に一致するファイルはありません
@@ -120,5 +120,38 @@ namespace ComputeSharp.Tests
|
||||
buffer[ThreadIds.X] = ExternalStructType.Sum(type);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void OutOfOrderMethods_Ok()
|
||||
{
|
||||
ReflectionServices.GetShaderInfo<OutOfOrderMethodsShader>(out var info);
|
||||
}
|
||||
|
||||
[AutoConstructor]
|
||||
public readonly partial struct OutOfOrderMethodsShader : IComputeShader
|
||||
{
|
||||
public readonly ReadWriteBuffer<float> buffer;
|
||||
|
||||
static int A() => B();
|
||||
|
||||
static int B() => 1 + C();
|
||||
|
||||
static int C() => 1;
|
||||
|
||||
int D() => A() + E() + F();
|
||||
|
||||
int E() => 1;
|
||||
|
||||
static int F() => 1;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Execute()
|
||||
{
|
||||
float value = buffer[ThreadIds.X];
|
||||
ExternalStructType type = ExternalStructType.New((int)value, Hlsl.Abs(value));
|
||||
|
||||
buffer[ThreadIds.X] = ExternalStructType.Sum(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする