summaryrefslogtreecommitdiff
path: root/tests/spirv/i64-structured-buffer.slang
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/spirv/i64-structured-buffer.slang
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/spirv/i64-structured-buffer.slang')
-rw-r--r--tests/spirv/i64-structured-buffer.slang16
1 files changed, 16 insertions, 0 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;
+}