yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Darren WihandiAdd mesh shader output topology checks (#6592)395302d24

master
1.6 KiB48 linesraw
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_HLSL): -entry main1 -stage mesh -target hlsl
2//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main1 -stage mesh -target spirv
3//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main1 -stage mesh -target glsl
4//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main1 -stage mesh -target metal
5
6//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_POINT_HLSL): -entry main2 -stage mesh -target hlsl
7//TEST:SIMPLE(filecheck=CHECK_POINT): -entry main2 -stage mesh -target spirv
8//TEST:SIMPLE(filecheck=CHECK_POINT): -entry main2 -stage mesh -target glsl
9//TEST:SIMPLE(filecheck=CHECK_POINT): -entry main2 -stage mesh -target metal
10
11
12struct TaskPayload {
13    uint offset;
14};
15
16struct Output {
17    float4 position : SV_POSITION;
18};
19
20
21// CHECK_HLSL: 50060: Invalid{{.*}}asdqwe{{.*}}of: 'line', 'triangle'
22// CHECK: 50060: Invalid{{.*}}asdqwe{{.*}}of: 'point', 'line', 'triangle'
23[numthreads(32, 1, 1)]
24[outputtopology("asdqwe")]
25[shader("mesh")]
26void main1(
27    uint ThreadIndex: SV_GroupIndex,
28    uint GroupID: SV_GroupID,
29    out vertices Output Vertices[64],
30    out indices uint3 Triangles[124],
31    in payload TaskPayload Payload
32) {
33}
34
35// 'point' is not valid for HLSL only, other targets must compile successfully.
36// CHECK_POINT_HLSL: 50060: Invalid{{.*}}point{{.*}}of: 'line', 'triangle'
37// CHECK_POINT: main
38[numthreads(32, 1, 1)]
39[outputtopology("point")]
40[shader("mesh")]
41void main2(
42    uint ThreadIndex: SV_GroupIndex,
43    uint GroupID: SV_GroupID,
44    out vertices Output Vertices[64],
45    out indices uint Points[124],
46    in payload TaskPayload Payload
47) {
48}