https://github.com/shader-slang/slang
Raw File
Tip revision: 39fb45484996f9d71b6551239dbf55eaaaf8db1f authored by Theresa Foley on 17 May 2022, 17:56:36 UTC
More proposals (#2232)
Tip revision: 39fb454
hello-world.slang
// 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];
}
back to top