summaryrefslogtreecommitdiffstats
path: root/tests/metal
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-18 15:34:52 -0800
committerGitHub <noreply@github.com>2024-12-18 15:34:52 -0800
commitabeb3758f35a48c2012dd3c39d704409c679a652 (patch)
treec26e8e0c88ab0b1d60c78a4b764b8a891bb37cf2 /tests/metal
parent0f5a2ce2ecf79fba79a9d20c9e3bcd4c31ee45bb (diff)
Support explicit `[vk::location(n)]` binding on metal/wgsl. (#5907)
Diffstat (limited to 'tests/metal')
-rw-r--r--tests/metal/explicit-location.slang17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/metal/explicit-location.slang b/tests/metal/explicit-location.slang
new file mode 100644
index 000000000..35930cfce
--- /dev/null
+++ b/tests/metal/explicit-location.slang
@@ -0,0 +1,17 @@
+//TEST:SIMPLE(filecheck=MTL): -target metal
+//TEST:SIMPLE(filecheck=WGSL): -target wgsl -entry vertMain -stage vertex
+
+// MTL: attribute(3)
+// WGSL: @location(3)
+
+struct Vertex
+{
+ [vk::location(0)] float4 pos;
+ [vk::location(3)] float2 uv;
+}
+
+[shader("vertex")]
+float4 vertMain(Vertex vin) : SV_Position
+{
+ return vin.pos + vin.uv.x;
+} \ No newline at end of file