flare-slang/shader/hello-world.slang

12 lines
282 B
Plaintext
Raw Normal View History

2025-01-01 17:32:11 -05:00
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];
}