summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorDarren Wihandi <65404740+fairywreath@users.noreply.github.com>2025-03-13 06:28:03 -0400
committerGitHub <noreply@github.com>2025-03-13 18:28:03 +0800
commit395302d2404e3429f3cdfa406e89fa76bc0d444b (patch)
tree0114009e9573cd94007dc3c4c1dfcad844cc33f8 /tests/diagnostics
parentee1995ba397c4f670c991aeeb05d3fcaaebb6771 (diff)
Add mesh shader output topology checks (#6592)
* initial wip * more wip * add test * add unexpected for invalid target * fixups and improve error message * fixups and improve error message * remove incorrect comment --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/mesh-shader-invalid-output-topology.slang48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/diagnostics/mesh-shader-invalid-output-topology.slang b/tests/diagnostics/mesh-shader-invalid-output-topology.slang
new file mode 100644
index 000000000..62f6a8ca7
--- /dev/null
+++ b/tests/diagnostics/mesh-shader-invalid-output-topology.slang
@@ -0,0 +1,48 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_HLSL): -entry main1 -stage mesh -target hlsl
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main1 -stage mesh -target spirv
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main1 -stage mesh -target glsl
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main1 -stage mesh -target metal
+
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_POINT_HLSL): -entry main2 -stage mesh -target hlsl
+//TEST:SIMPLE(filecheck=CHECK_POINT): -entry main2 -stage mesh -target spirv
+//TEST:SIMPLE(filecheck=CHECK_POINT): -entry main2 -stage mesh -target glsl
+//TEST:SIMPLE(filecheck=CHECK_POINT): -entry main2 -stage mesh -target metal
+
+
+struct TaskPayload {
+ uint offset;
+};
+
+struct Output {
+ float4 position : SV_POSITION;
+};
+
+
+// CHECK_HLSL: 50060: Invalid{{.*}}asdqwe{{.*}}of: 'line', 'triangle'
+// CHECK: 50060: Invalid{{.*}}asdqwe{{.*}}of: 'point', 'line', 'triangle'
+[numthreads(32, 1, 1)]
+[outputtopology("asdqwe")]
+[shader("mesh")]
+void main1(
+ uint ThreadIndex: SV_GroupIndex,
+ uint GroupID: SV_GroupID,
+ out vertices Output Vertices[64],
+ out indices uint3 Triangles[124],
+ in payload TaskPayload Payload
+) {
+}
+
+// 'point' is not valid for HLSL only, other targets must compile successfully.
+// CHECK_POINT_HLSL: 50060: Invalid{{.*}}point{{.*}}of: 'line', 'triangle'
+// CHECK_POINT: main
+[numthreads(32, 1, 1)]
+[outputtopology("point")]
+[shader("mesh")]
+void main2(
+ uint ThreadIndex: SV_GroupIndex,
+ uint GroupID: SV_GroupID,
+ out vertices Output Vertices[64],
+ out indices uint Points[124],
+ in payload TaskPayload Payload
+) {
+}