diff options
Diffstat (limited to 'tests/compute/byte-address-buffer-align-error.slang')
| -rw-r--r-- | tests/compute/byte-address-buffer-align-error.slang | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/compute/byte-address-buffer-align-error.slang b/tests/compute/byte-address-buffer-align-error.slang new file mode 100644 index 000000000..34300d7c3 --- /dev/null +++ b/tests/compute/byte-address-buffer-align-error.slang @@ -0,0 +1,24 @@ +// byte-address-buffer-align-error.slang + +//TEST:SIMPLE(filecheck=CHECK):-target glsl -entry computeMain -stage compute +//TEST:SIMPLE(filecheck=CHECK):-target hlsl -entry computeMain -stage compute +//TEST:SIMPLE(filecheck=CHECK):-target spirv -entry computeMain -stage compute +//TEST:SIMPLE(filecheck=CHECK):-target spirv -emit-spirv-directly -entry computeMain -stage compute + +// Confirm compilation of `(RW)ByteAddressBuffer` with aligned load / stores to wider data types. + +[vk::binding(2, 3)] RWByteAddressBuffer buffer; +struct Block { + float4 val[2]; +}; +[shader("compute")] +[numthreads(1,1,1)] +void computeMain(uint3 threadId : SV_DispatchThreadID) +{ + // CHECK: error 41300: invalid alignment `{{.*}}` specified for the byte address buffer resource with the element size of `{{.*}}` + // CHECK: error 41300: invalid alignment `{{.*}}` specified for the byte address buffer resource with the element size of `{{.*}}` + buffer.Store<Block>(0, buffer.Load<Block>(1, 5)); + buffer.Store<Block>(1, buffer.Load<Block>(0), 3); + +} + |
