summaryrefslogtreecommitdiff
path: root/tests/spirv
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spirv')
-rw-r--r--tests/spirv/block-decoration.slang18
-rw-r--r--tests/spirv/varying-out-index.slang6
2 files changed, 21 insertions, 3 deletions
diff --git a/tests/spirv/block-decoration.slang b/tests/spirv/block-decoration.slang
new file mode 100644
index 000000000..e6d350dcd
--- /dev/null
+++ b/tests/spirv/block-decoration.slang
@@ -0,0 +1,18 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+// Check that we don't produce duplicate `Block` decorations.
+
+// CHECK: OpDecorate %RWStructuredBuffer Block
+// CHECK-NOT: OpDecorate %RWStructuredBuffer Block
+
+struct Particle {
+ float4 _m0;
+};
+
+[[vk::binding(0)]]
+RWStructuredBuffer<Particle> particleOut;
+
+[shader("fragment")]
+float4 main() : SV_TARGET {
+ return particleOut[0]._m0;
+} \ No newline at end of file
diff --git a/tests/spirv/varying-out-index.slang b/tests/spirv/varying-out-index.slang
index 6448f2266..e4c4400f5 100644
--- a/tests/spirv/varying-out-index.slang
+++ b/tests/spirv/varying-out-index.slang
@@ -12,9 +12,9 @@ struct PS_OUTPUT
};
-// CHECK: OpDecorate %MainPS_vColor Location 0
-// CHECK: OpDecorate %MainPS_vColor2 Location 0
-// CHECK: OpDecorate %MainPS_vColor2 Index 1
+// CHECK: OpDecorate %{{.*}}MainPS_vColor Location 0
+// CHECK: OpDecorate %{{.*}}MainPS_vColor2 Location 0
+// CHECK: OpDecorate %{{.*}}MainPS_vColor2 Index 1
PS_OUTPUT MainPS()
{