blob: 3895c984aef124bd3484dfe207eb3ae7bb4f7db1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
//TEST(compute):COMPARE_COMPUTE: -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE: -vk -shaderobj -output-using-type
struct MyGenType<T : IArithmetic, let n : int>
{
T value;
T compute() { return value * T(n); }
}
typealias IntMyGenType<let n : int> = MyGenType<int, n>;
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<int> outputBuffer;
[numthreads(4, 1, 1)]
void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
int tid = dispatchThreadID.x;
IntMyGenType<2> obj;
obj.value = 2;
outputBuffer[tid] = obj.compute();
}
|