diff options
| author | Yong He <yonghe@outlook.com> | 2024-06-10 12:32:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-10 12:32:17 -0700 |
| commit | 38c0baccac70ca36a2c90218d6a92b8c036b1a5e (patch) | |
| tree | 0bc29bad69dc988777e1275b707c1d92737dcd7f /tests/spirv/flat.slang | |
| parent | b5cdd8322bd51603c217dfb7662306628b144c78 (diff) | |
Fix SPIRV emit for `Flat` decoration and TessLevel builtin. (#4318)
Diffstat (limited to 'tests/spirv/flat.slang')
| -rw-r--r-- | tests/spirv/flat.slang | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/spirv/flat.slang b/tests/spirv/flat.slang new file mode 100644 index 000000000..660f61216 --- /dev/null +++ b/tests/spirv/flat.slang @@ -0,0 +1,27 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv + +// Check that we don't emit duplicate Flat decorations for the same variable. + +// CHECK: OpDecorate %vo_a Flat +// CHECK-NOT: OpDecorate %vo_a Flat + +struct VertexOutput +{ + nointerpolation int a : SOME_VALUE; + float4 b : SV_Position; +}; + +[shader("vertex")] +VertexOutput Vertex() +{ + VertexOutput out; + out.a = 0; + out.b = float4(0, 0, 0, 1); + return out; +} + +[shader("fragment")] +float4 Fragment(in VertexOutput vo) +{ + return float4(float(vo.a), 0, 0, 1); +}
\ No newline at end of file |
