https://github.com/shader-slang/slang
Raw File
Tip revision: f94b2f7a328a898c5e3dc1389d08e0b7ce6e092e authored by Yong He on 18 August 2023, 19:48:46 UTC
Allow loop counters to be used as constexpr arguments. (#3139)
Tip revision: f94b2f7
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