diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/compute/static-const-array.slang | 23 | ||||
| -rw-r--r-- | tests/compute/static-const-array.slang.expected.txt | 4 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/compute/static-const-array.slang b/tests/compute/static-const-array.slang new file mode 100644 index 000000000..242cfb096 --- /dev/null +++ b/tests/compute/static-const-array.slang @@ -0,0 +1,23 @@ +// static-const-array.slang + +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute +//TEST_DISABLED(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute + + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out +RWStructuredBuffer<int> outputBuffer; + +static const int kArray[] = { 16, 1, 32, 2 }; + +int test(int val) +{ + return kArray[val]; +} + +[numthreads(4, 1, 1)] +void computeMain(uint3 tid : SV_DispatchThreadID) +{ + int inVal = tid.x; + int outVal = test(inVal); + outputBuffer[inVal] = outVal; +}
\ No newline at end of file diff --git a/tests/compute/static-const-array.slang.expected.txt b/tests/compute/static-const-array.slang.expected.txt new file mode 100644 index 000000000..88c4cd187 --- /dev/null +++ b/tests/compute/static-const-array.slang.expected.txt @@ -0,0 +1,4 @@ +10 +1 +20 +2 |
