1
1
//TEST:SIMPLE(filecheck=METAL): -target metal -stage fragment -entry fragmentMain
2
- //TEST:SIMPLE(filecheck=METALLIB): -target metallib -stage fragment -entry fragmentMain
3
2
//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage fragment -entry fragmentMain
3
+ //TEST:SIMPLE(filecheck=METALLIB): -target metallib -stage fragment -entry fragmentMain
4
+ //TEST:SIMPLE(filecheck=WGSLSPIRV): -target wgsl-spirv-asm -stage fragment -entry fragmentMain
4
5
5
6
// METAL: COARSEVERTEX_7
6
7
// METAL: COARSEVERTEX_6
21
22
// METAL-NOT: [[ATTR3]]
22
23
// METAL-DAG: [[ATTR4:COARSEVERTEX_(1|2|3|4)]]
23
24
25
+ // WGSL:struct FragmentStageInput
26
+ // WGSL-DAG:@location(0) [[VAR0:[A-Za-z_0-9]+]]
27
+ // WGSL-DAG:@location(1) [[VAR1:[A-Za-z_0-9]+]]
28
+ // WGSL-DAG:@location(2) [[VAR2:[A-Za-z_0-9]+]]
29
+ // WGSL-DAG:@location(3) [[VAR3:[A-Za-z_0-9]+]]
30
+ // WGSL-DAG:@location(4) [[VAR4:[A-Za-z_0-9]+]]
31
+ // WGSL-DAG:@location(6) [[VAR6:[A-Za-z_0-9]+]]
32
+ // WGSL-DAG:@location(7) [[VAR7:[A-Za-z_0-9]+]]
33
+ // WGSL-NOT:@location(8)
34
+ // WGSL:}
35
+
24
36
// METALLIB: @fragmentMain
37
+ // WGSLSPIRV: %fragmentMain = OpFunction %void None
25
38
26
39
RWStructuredBuffer<float> outputBuffer;
27
40
@@ -52,6 +65,7 @@ struct FragmentStageInput
52
65
TopFragment coarseVertex : CoarseVertex;
53
66
};
54
67
68
+ // WGSL: fn fragmentMain{{[( ]*}}[[InputVar:[A-Za-z_0-9]+]]
55
69
float4 fragmentMain(FragmentStageInput input)
56
70
{
57
71
// METAL-DAG: {{.*}}->p1{{.*}}=
@@ -64,15 +78,16 @@ float4 fragmentMain(FragmentStageInput input)
64
78
// METAL-DAG: {{.*}}->p3{{.*}}->p2{{.*}}->p1{{.*}}=
65
79
// METAL-DAG: {{.*}}->p3{{.*}}->p3{{.*}}->p1{{.*}}=
66
80
67
- // WGSL-DAG: {{.*}}._S{{.*}}=
81
+ // WGSL: var [[UnpackedInput:[A-Za-z_0-9]+]] : FragmentStageInput
82
+ // WGSL-DAG: [[UnpackedInput]].{{[A-Za-z_0-9]+}}.{{[A-Za-z_0-9]+}} = [[InputVar]].[[VAR7]];
68
83
69
- // WGSL-DAG: {{.* }}.p2{{.* }}._S{{.*}}=
70
- // WGSL-DAG: {{.* }}.p2{{.* }}.p2{{.* }}._S{{.*}}=
71
- // WGSL-DAG: {{.* }}.p2{{.* }}.p3{{.* }}._S{{.*}}=
84
+ // WGSL-DAG: [[UnpackedInput]].{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+}} = [[InputVar]].[[VAR6]];
85
+ // WGSL-DAG: [[UnpackedInput]].{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+}} = [[InputVar]].[[VAR1]];
86
+ // WGSL-DAG: [[UnpackedInput]].{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+}} = [[InputVar]].[[VAR2]];
72
87
73
- // WGSL-DAG: {{.* }}.p3{{.* }}._S{{.*}}=
74
- // WGSL-DAG: {{.* }}.p3{{.* }}.p2{{.* }}._S{{.*}}=
75
- // WGSL-DAG: {{.* }}.p3{{.* }}.p3{{.* }}._S{{.*}}=
88
+ // WGSL-DAG: [[UnpackedInput]].{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+}} = [[InputVar]].[[VAR0]];
89
+ // WGSL-DAG: [[UnpackedInput]].{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+}} = [[InputVar]].[[VAR3]];
90
+ // WGSL-DAG: [[UnpackedInput]].{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+ }}.{{[A-Za-z_0-9]+}} = [[InputVar]].[[VAR4]];
76
91
77
92
outputBuffer[0] = input.coarseVertex.p1 + input.coarseVertex.p2.p1 + +input.coarseVertex.p3.p1;
78
93
return float4(0, 0, 0, 0);
0 commit comments