summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-10 11:45:36 -0700
committerGitHub <noreply@github.com>2024-06-10 11:45:36 -0700
commitb5cdd8322bd51603c217dfb7662306628b144c78 (patch)
tree0c57a636e10bd39408ea74e0caa68d9c30d6e43b /tests
parent6857dd57549f01daa025f45221a693259e474958 (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')
-rw-r--r--tests/language-feature/overload-resolution.slang8
-rw-r--r--tests/spirv/i64-structured-buffer.slang16
-rw-r--r--tests/spirv/subgroup-size-2.slang2
3 files changed, 21 insertions, 5 deletions
diff --git a/tests/language-feature/overload-resolution.slang b/tests/language-feature/overload-resolution.slang
index 9c135137a..c95269477 100644
--- a/tests/language-feature/overload-resolution.slang
+++ b/tests/language-feature/overload-resolution.slang
@@ -25,10 +25,10 @@ T myGenF<T : __BuiltinIntegerType>(inout T a, T b)
return a - b;
}
}
-// CHECK: result{{.*}}[0{{U?}}] = 1
-// CHECK: result{{.*}}[1{{U?}}] = 4
-// CHECK: result{{.*}}[2{{U?}}] = 1
-// CHECK: result{{.*}}[3{{U?}}] = 4
+// CHECK: result{{.*}}[int(0)] = 1
+// CHECK: result{{.*}}[int(1)] = 4
+// CHECK: result{{.*}}[int(2)] = 1
+// CHECK: result{{.*}}[int(3)] = 4
[numthreads(1,1,1)]
void main()
{
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;
}