blob: 19ab0bd636f66fc7ac006610ae52fe075704eae6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-compute -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -compute -output-using-type
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<int> outputBuffer;
int g(int arr[])
{
int tmp[] = arr;
return tmp.getCount();
}
int test(int arr[])
{
return arr[0] + g(arr);
}
int test2<T>(inout T arr[])
{
unmodified(arr);
return arr.getCount();
}
[numthreads(1, 1, 1)]
void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
{
int arr[3] = {1, 2, 3};
// CHECK: 4
outputBuffer[0] = test(arr);
// CHECK: 3
outputBuffer[1] = test2(arr);
int arr2[2] = { 1, 2 };
// CHECK: 3
outputBuffer[2] = test(arr2);
// CHECK: 2
outputBuffer[3] = test2(arr2);
}
|