blob: 09cc86706257d5c6529b8e3629e65a2c0e83720f (
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
|
//TEST:SIMPLE:-target cpp -stage compute -entry computeMain -obfuscate -line-directive-mode none
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
#if 0
[DllExport]
String getString()
{
return "Hello!";
}
#endif
int silly(int a)
{
int t = 0;
[ForceUnroll(10)]
while ( a > 0)
{
t = t + t + a;
}
return t;
}
[numthreads(1, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
int x = int(dispatchThreadID.x);
//String v = getString();
int v = silly(x);
outputBuffer[x] = v;
}
|