diff options
| author | Darren Wihandi <65404740+fairywreath@users.noreply.github.com> | 2025-05-14 03:01:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-14 07:01:47 +0000 |
| commit | eb5648b41d0718648477cbcf941fb3c6edf6dfc7 (patch) | |
| tree | 73f19cd4b4f66d0ce6fbbd61c9a1253969cc3139 /tests | |
| parent | 04ba87e23435e76583c05d4530d63686f9af712f (diff) | |
Error out on invalid vector sizes (#7076)
* Error out on invalid vector sizes
* Remove unnecessary include
* Fix incorrect assert
* Add test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/diagnostics/invalid-vector-element-count.slang | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/diagnostics/invalid-vector-element-count.slang b/tests/diagnostics/invalid-vector-element-count.slang new file mode 100644 index 000000000..b801dfd07 --- /dev/null +++ b/tests/diagnostics/invalid-vector-element-count.slang @@ -0,0 +1,15 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target spirv + +RWStructuredBuffer<vector<float, 8>> bufferIn1; +RWStructuredBuffer<vector<float, 0>> bufferIn2; +RWStructuredBuffer<float> resultOut; + +[shader("compute")] +[numthreads(32,1,1)] +void computeMain(uint3 threadId : SV_DispatchThreadID) +{ + // CHECK: error 38203: vector has invalid element count '0', valid values are between '1' and '4' inclusive + // CHECK: error 38203: vector has invalid element count '8', valid values are between '1' and '4' inclusive + uint index = threadId.x; + resultOut[index] = bufferIn1[index][0] + bufferIn2[index][0]; +} |
