summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-08-30 07:35:01 -0700
committerGitHub <noreply@github.com>2024-08-30 07:35:01 -0700
commit12137e9b00436eee3bf27f7a2fc5106513af8981 (patch)
tree002703d3251e5280cd1fe62978ac88fa1716c1c4 /tests
parentddf4a323be5ae4e59dce742f618dbbdee4ed28d8 (diff)
Fix redundant decorations in IRParam (#4964)
* Fix redundant decorations in IRParam Closes #4922 The problem was that same decorations were added to an IRParam multiple times while running `specializeIRForEntryPoint()`. `cloneGlobalValueWithCodeCommon()` kept cloning decorations for the params that were already processed.
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/gh-4922-nointerpolation.slang15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/bugs/gh-4922-nointerpolation.slang b/tests/bugs/gh-4922-nointerpolation.slang
new file mode 100644
index 000000000..3619aae0b
--- /dev/null
+++ b/tests/bugs/gh-4922-nointerpolation.slang
@@ -0,0 +1,15 @@
+//TEST:SIMPLE(filecheck=HLSL): -target hlsl -entry main
+//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry main
+
+// This test checks if `nointerpolation` is emitted more than once
+//HLSL-NOT:nointerpolation nointerpolation
+//GLSL-NOT:flat flat
+
+[shader("pixel")]
+void main(out float4 SV_Target : SV_Target, const in nointerpolation float4 color : color)
+{
+ for (int i = 0; i < 10; ++i)
+ {}
+
+ SV_Target = color;
+}