summaryrefslogtreecommitdiffstats
path: root/examples/hello-world/hello-world.slang
blob: 565924035c731a704af67e373abae8a669cc7e27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// hello-world.slang
StructuredBuffer<float> buffer0;
StructuredBuffer<float> buffer1;
RWStructuredBuffer<float> result;

[shader("compute")]
[numthreads(1,1,1)]
void computeMain(uint3 threadId : SV_DispatchThreadID)
{
    uint index = threadId.x;
    result[index] = buffer0[index] + buffer1[index];
}