From abeb3758f35a48c2012dd3c39d704409c679a652 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 18 Dec 2024 15:34:52 -0800 Subject: Support explicit `[vk::location(n)]` binding on metal/wgsl. (#5907) --- tests/metal/explicit-location.slang | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/metal/explicit-location.slang (limited to 'tests') 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 -- cgit v1.2.3