summaryrefslogtreecommitdiffstats
path: root/tests/spirv/pointer-data-marshal.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-07-25 15:00:14 -0700
committerGitHub <noreply@github.com>2024-07-25 15:00:14 -0700
commitc9d89a40775a055873adf82cfb0ee1cb6bdcb93c (patch)
tree2438f353e87b30febe966ca23976793637c018d2 /tests/spirv/pointer-data-marshal.slang
parent1343ab79fcd0ff9e5ffebbcf95414e51ab19e9cd (diff)
Overhaul IR lowering of pointer types. (#4710)
* Overhaul IR lowering of pointer types. * Propagate address space in IRBuilder. * Fixup. * Fix. * Fix. * Change how Ptr type is printed to text. * Fix.
Diffstat (limited to 'tests/spirv/pointer-data-marshal.slang')
-rw-r--r--tests/spirv/pointer-data-marshal.slang21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/spirv/pointer-data-marshal.slang b/tests/spirv/pointer-data-marshal.slang
new file mode 100644
index 000000000..3ad6c373b
--- /dev/null
+++ b/tests/spirv/pointer-data-marshal.slang
@@ -0,0 +1,21 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly
+
+struct Foo {
+ column_major float3x2 m;
+};
+
+struct Params {
+ Foo *foo;
+};
+
+// CHECK: %[[PTR0:[A-Za-z0-9_]+]] = OpAccessChain %_ptr_PhysicalStorageBuffer__arr_v3float_int_2 %{{.*}} %int_0
+// CHECK: %[[PTR1:[A-Za-z0-9_]+]] = OpAccessChain %_ptr_PhysicalStorageBuffer_v3float %[[PTR0]] %int_1
+// CHECK: %[[PTR2:[A-Za-z0-9_]+]] = OpAccessChain %_ptr_PhysicalStorageBuffer_float %[[PTR1]] %int_2
+
+ConstantBuffer<Params> params;
+
+[shader("compute")]
+[numthreads(1,1,1)]
+void main() {
+ params.foo.m[2][1] += 1.0;
+} \ No newline at end of file