summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
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/diagnostics
parent21bbebb19dfdbbee107b9fd9830e18d5fb6a573a (diff)
Fix `GetAttributeAtVertex` for spirv and glsl targets. (#4334)
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/get-vertex-attribute.slang13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/diagnostics/get-vertex-attribute.slang b/tests/diagnostics/get-vertex-attribute.slang
new file mode 100644
index 000000000..613a5a7c8
--- /dev/null
+++ b/tests/diagnostics/get-vertex-attribute.slang
@@ -0,0 +1,13 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+struct VertexOutput
+{
+ float color;
+}
+
+[shader("fragment")]
+float4 fsmain(VertexOutput vout) : SV_Target
+{
+ // CHECK: ([[# @LINE+1]]): error 39027
+ return GetAttributeAtVertex(vout.color, 0); // error: color must be decorated with `nointerpolation`.
+}