summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cross-compile/multiview.slang11
-rw-r--r--tests/cross-compile/multiview.slang.glsl11
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/cross-compile/multiview.slang b/tests/cross-compile/multiview.slang
new file mode 100644
index 000000000..86d80cd51
--- /dev/null
+++ b/tests/cross-compile/multiview.slang
@@ -0,0 +1,11 @@
+// multiview.slang
+
+// Confirm that the SPV_KHR_multiview and EXT_multiview extensions are compiled
+// correctly
+
+//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage vertex
+
+void main(uint viewId : SV_ViewID, out float4 p : SV_Position)
+{
+ p = float4(viewId, 0, 0, 0);
+}
diff --git a/tests/cross-compile/multiview.slang.glsl b/tests/cross-compile/multiview.slang.glsl
new file mode 100644
index 000000000..04476cada
--- /dev/null
+++ b/tests/cross-compile/multiview.slang.glsl
@@ -0,0 +1,11 @@
+// multiview.slang.glsl
+#version 450
+#extension GL_EXT_multiview : require
+
+void main()
+{
+ // Cast to uint as the GLSL extension types gl_ViewIndex as `highp int`
+ gl_Position = vec4(float(uint(gl_ViewIndex)), 0, 0, 0);
+ return;
+}
+