yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong He[GFX] Fix d3d12 buffer view creation logic for StructuredBuffers. (#3954)3192f34f5

master
466 B14 linesraw
1// uint16-buffer.slang - Simple shader that takes a buffer of uint16 type and increments all elements by 1.
2
3// This is to verify that GFX can correct set correct buffer strides for structured buffer bindings.
4
5uniform RWStructuredBuffer<uint16_t> buffer;
6
7[shader("compute")]
8[numthreads(4,1,1)]
9void computeMain(
10    uint3 sv_dispatchThreadID : SV_DispatchThreadID)
11{
12    var input = buffer[sv_dispatchThreadID.x];
13    buffer[sv_dispatchThreadID.x] = input + 1;
14}