diff options
| author | Yong He <yonghe@outlook.com> | 2024-06-10 11:45:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-10 11:45:36 -0700 |
| commit | b5cdd8322bd51603c217dfb7662306628b144c78 (patch) | |
| tree | 0c57a636e10bd39408ea74e0caa68d9c30d6e43b /tests/spirv | |
| parent | 6857dd57549f01daa025f45221a693259e474958 (diff) | |
Support all integer typed indices in StructuredBuffer Load/Store/[]. (#4311)
* Support all integer typed indices in StructuredBuffer Load/Store/[].
* Fix tests.
---------
Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/i64-structured-buffer.slang | 16 | ||||
| -rw-r--r-- | tests/spirv/subgroup-size-2.slang | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/spirv/i64-structured-buffer.slang b/tests/spirv/i64-structured-buffer.slang new file mode 100644 index 000000000..10cd220f6 --- /dev/null +++ b/tests/spirv/i64-structured-buffer.slang @@ -0,0 +1,16 @@ +//TEST:SIMPLE(filecheck=CHECK): -stage compute -target spirv -emit-spirv-directly -entry main + +RWStructuredBuffer<float> output; + +// Check that 64bit integer index can be used in structured buffers without conversion to int. + +// CHECK: %[[INDEX:[A-Za-z0-9_]+]] = OpLoad %long %{{.*}} +// CHECK: OpAccessChain %_ptr_StorageBuffer_float %output %int_0 %[[INDEX]] + +uniform int64_t index; + +[numthreads(1,1,1)] +void main() +{ + output[index] = 1; +} diff --git a/tests/spirv/subgroup-size-2.slang b/tests/spirv/subgroup-size-2.slang index 68fee6fe6..bd5ae5eec 100644 --- a/tests/spirv/subgroup-size-2.slang +++ b/tests/spirv/subgroup-size-2.slang @@ -19,7 +19,7 @@ void compute1() const int x = f().x; outputBuffer[0] = x; - // CHECK-DAG: %[[PTR:[A-Za-z0-9_]+]] = OpAccessChain %_ptr_StorageBuffer_int %outputBuffer %int_0 %uint_1 + // CHECK-DAG: %[[PTR:[A-Za-z0-9_]+]] = OpAccessChain %_ptr_StorageBuffer_int %outputBuffer %int_0 %int_1 // CHECK: OpStore %[[PTR]] %int_2 outputBuffer[1] = WorkgroupSize().y; } |
