blob: f7525e6fd2f487189827b3315267ada0731a38db (
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
|
//TEST(compute):COMPARE_COMPUTE: -shaderobj -output-using-type
struct PlusOne<let v : int>
{
static const int value = v > 0? v + 1 : v - 1;
}
struct GetConst<let v : int, let u : int>
{
static const int value = (u/2+v)*(u+v) / PlusOne<u-1>.value;
int arr[value];
}
//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;
int inVal = tid;
int arr[GetConst<5, 2>.value + 1];
GetConst<5, 3> obj;
obj.arr[0] = GetConst<5, 3>.value + 1;
outputBuffer[tid] = obj.arr[0];
}
|