summaryrefslogtreecommitdiffstats
path: root/tests/spirv
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-11 00:01:12 -0700
committerGitHub <noreply@github.com>2024-06-11 00:01:12 -0700
commit6d5ef9b650a9db35f7774ca09d9225d0c30849e4 (patch)
treed8f812a52d937709efa23b17c1e36c51ee1b66f4 /tests/spirv
parent21bbebb19dfdbbee107b9fd9830e18d5fb6a573a (diff)
Fix `GetAttributeAtVertex` for spirv and glsl targets. (#4334)
Diffstat (limited to 'tests/spirv')
-rw-r--r--tests/spirv/get-vertex-attribute.slang15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/spirv/get-vertex-attribute.slang b/tests/spirv/get-vertex-attribute.slang
new file mode 100644
index 000000000..655b7ad03
--- /dev/null
+++ b/tests/spirv/get-vertex-attribute.slang
@@ -0,0 +1,15 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-via-glsl
+
+// CHECK: OpDecorate %vout_vertexID{{.*}} PerVertexKHR
+
+struct VertexOutput
+{
+ nointerpolation int vertexID;
+}
+
+[shader("fragment")]
+float4 fsmain(VertexOutput vout) : SV_Target
+{
+ return GetAttributeAtVertex(vout.vertexID, 0);
+}