diff options
| author | Yong He <yonghe@outlook.com> | 2024-04-15 23:28:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-15 23:28:28 -0700 |
| commit | 3192f34f57abd3245995342a0a5971ebbbbd945c (patch) | |
| tree | dc139be9fe9f4995bac96513571cc9e0526ce547 /tools/gfx-unit-test/uint16-buffer.slang | |
| parent | 030d7f45726187b5b23a3cfb9743166aa60fae30 (diff) | |
[GFX] Fix d3d12 buffer view creation logic for StructuredBuffers. (#3954)
Diffstat (limited to 'tools/gfx-unit-test/uint16-buffer.slang')
| -rw-r--r-- | tools/gfx-unit-test/uint16-buffer.slang | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/gfx-unit-test/uint16-buffer.slang b/tools/gfx-unit-test/uint16-buffer.slang new file mode 100644 index 000000000..bdc09c7d8 --- /dev/null +++ b/tools/gfx-unit-test/uint16-buffer.slang @@ -0,0 +1,14 @@ +// uint16-buffer.slang - Simple shader that takes a buffer of uint16 type and increments all elements by 1. + +// This is to verify that GFX can correct set correct buffer strides for structured buffer bindings. + +uniform RWStructuredBuffer<uint16_t> buffer; + +[shader("compute")] +[numthreads(4,1,1)] +void computeMain( + uint3 sv_dispatchThreadID : SV_DispatchThreadID) +{ + var input = buffer[sv_dispatchThreadID.x]; + buffer[sv_dispatchThreadID.x] = input + 1; +} |
