blob: 50845bbdd3ba9b4781f48b8ae5c0e3888ff75151 (
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
|
//TEST(compute):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
void writeArray(inout float3 a[4])
{
a[0] = float3(1, 1, 1);
a[1] = float3(1, 1, 1);
a[2] = float3(1, 1, 1);
a[3] = float3(1, 1, 1);
}
[numthreads(4, 1, 1)]
void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
float3 b[4];
writeArray(b);
outputBuffer[dispatchThreadID.x] = int(b[0].x);
}
|