summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-04-18 23:01:45 -0700
committerGitHub <noreply@github.com>2024-04-18 23:01:45 -0700
commita3a5e7ea4e2ec15dd385c169578f5770f49b6e1c (patch)
tree3c7a75a3ca0f8c38f5f92871629947b812865234 /tests
parenta2b9e376b2d54283000a0fe0c48e6e1912d8a333 (diff)
Metal: rewrite global variables as explicit context. (#3981)
* Metal: rewrite global variables as explicit context. * Small tweaks.
Diffstat (limited to 'tests')
-rw-r--r--tests/metal/simple-compute.slang15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/metal/simple-compute.slang b/tests/metal/simple-compute.slang
index e099704be..fe797dc2c 100644
--- a/tests/metal/simple-compute.slang
+++ b/tests/metal/simple-compute.slang
@@ -1,10 +1,17 @@
//TEST:SIMPLE(filecheck=CHECK): -target metal
-RWStructuredBuffer<float> outputBuffer;
+uniform RWStructuredBuffer<float> outputBuffer;
+
+// CHECK: {{.*}}kernel{{.*}} void main_kernel(float device* {{.*}})
+
+void func(float v)
+{
+ outputBuffer[0] = v;
+ outputBuffer[1] = outputBuffer.Load(0);
+}
-// CHECK: {{.*}}kernel{{.*}} void main()
[numthreads(1,1,1)]
-void main()
+void main_kernel()
{
- outputBuffer[0] = 1.0f;
+ func(3.0f);
} \ No newline at end of file