summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-01-27 18:17:16 -0800
committerGitHub <noreply@github.com>2025-01-27 18:17:16 -0800
commitf030a5ab62235152055fe8a616dd6d0d7ba1c275 (patch)
treee4851bd271a04feaa8c3dc9eeb228d3550b9b56e /tests
parentda3dc98f96cc7be2accb5c6f86aa6f6e5502bada (diff)
Properly plumbing layout for global varyings. (#6198)
* Properly plumbing layout for global varyings. * Fix test.
Diffstat (limited to 'tests')
-rw-r--r--tests/glsl/in-layout.slang23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/glsl/in-layout.slang b/tests/glsl/in-layout.slang
new file mode 100644
index 000000000..651948c69
--- /dev/null
+++ b/tests/glsl/in-layout.slang
@@ -0,0 +1,23 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry main -stage fragment
+
+// Test that we can mix explicit and implicit locations for global varyings.
+
+#version 450
+layout(location=1) in vec4 color_0;
+in vec2 texcoord_0;
+in vec2 texCoord_1;
+
+out vec4 out1;
+
+// CHECK-DAG: OpDecorate %color_0 Location 1
+
+// CHECK-DAG: OpDecorate %texcoord_0 Location 0
+
+// CHECK-DAG: OpDecorate %texCoord_1 Location 2
+
+// CHECK-DAG: OpDecorate %entryPointParam_main_out1 Location 0
+
+void main()
+{
+ out1 = vec4(color_0.rg, texcoord_0 + texCoord_1);
+} \ No newline at end of file