skia2/tests/sksl/runtime/PrecisionQualifiers.skvm
Ethan Nicholas f393067c37 Made SkSL type aliases into first-class objects
Previously, type aliases ('vec2') were just an additional name which
could be used to refer to a type ('float2'). This was simple and worked,
except that error messages would be wrong - any type-related error
message would refer to the type as 'float2' rather than the 'vec2' that
the user actually typed.

This CL adds an AliasType class so that we can track which name was
used to refer to an aliased type and report messages using the correct
type name.

Bug: skia:12737

Change-Id: I40e234239ab47557033e0695e4fbbd5f01da354e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/490256
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-01-05 16:20:19 +00:00

421 lines
14 KiB
Plaintext

$0 = colorGreen (float4 : slot 1/4, L3)
$1 = colorGreen (float4 : slot 2/4, L3)
$2 = colorGreen (float4 : slot 3/4, L3)
$3 = colorGreen (float4 : slot 4/4, L3)
$4 = colorRed (float4 : slot 1/4, L3)
$5 = colorRed (float4 : slot 2/4, L3)
$6 = colorRed (float4 : slot 3/4, L3)
$7 = colorRed (float4 : slot 4/4, L3)
$8 = [main].result (float4 : slot 1/4, L57)
$9 = [main].result (float4 : slot 2/4, L57)
$10 = [main].result (float4 : slot 3/4, L57)
$11 = [main].result (float4 : slot 4/4, L57)
$12 = coords (float2 : slot 1/2, L57)
$13 = coords (float2 : slot 2/2, L57)
$14 = zero (float4 : slot 1/4, L58)
$15 = zero (float4 : slot 2/4, L58)
$16 = zero (float4 : slot 3/4, L58)
$17 = zero (float4 : slot 4/4, L58)
$18 = one (float4 : slot 1/4, L59)
$19 = one (float4 : slot 2/4, L59)
$20 = one (float4 : slot 3/4, L59)
$21 = one (float4 : slot 4/4, L59)
$22 = green (float4 : slot 1/4, L60)
$23 = green (float4 : slot 2/4, L60)
$24 = green (float4 : slot 3/4, L60)
$25 = green (float4 : slot 4/4, L60)
$26 = red (float4 : slot 1/4, L63)
$27 = red (float4 : slot 2/4, L63)
$28 = red (float4 : slot 3/4, L63)
$29 = red (float4 : slot 4/4, L63)
$30 = [test_scalar].result (bool, L5)
$31 = mp (float, L6)
$32 = hp (float, L7)
$33 = ihp (int, L8)
$34 = imp (int, L9)
$35 = [test_vector].result (bool, L14)
$36 = mp2 (float2 : slot 1/2, L15)
$37 = mp2 (float2 : slot 2/2, L15)
$38 = hp2 (float2 : slot 1/2, L16)
$39 = hp2 (float2 : slot 2/2, L16)
$40 = mp3 (float3 : slot 1/3, L17)
$41 = mp3 (float3 : slot 2/3, L17)
$42 = mp3 (float3 : slot 3/3, L17)
$43 = hp3 (float3 : slot 1/3, L18)
$44 = hp3 (float3 : slot 2/3, L18)
$45 = hp3 (float3 : slot 3/3, L18)
$46 = mp4 (float4 : slot 1/4, L19)
$47 = mp4 (float4 : slot 2/4, L19)
$48 = mp4 (float4 : slot 3/4, L19)
$49 = mp4 (float4 : slot 4/4, L19)
$50 = hp4 (float4 : slot 1/4, L20)
$51 = hp4 (float4 : slot 2/4, L20)
$52 = hp4 (float4 : slot 3/4, L20)
$53 = hp4 (float4 : slot 4/4, L20)
$54 = ihp2 (int2 : slot 1/2, L22)
$55 = ihp2 (int2 : slot 2/2, L22)
$56 = imp2 (int2 : slot 1/2, L23)
$57 = imp2 (int2 : slot 2/2, L23)
$58 = ihp3 (int3 : slot 1/3, L24)
$59 = ihp3 (int3 : slot 2/3, L24)
$60 = ihp3 (int3 : slot 3/3, L24)
$61 = imp3 (int3 : slot 1/3, L25)
$62 = imp3 (int3 : slot 2/3, L25)
$63 = imp3 (int3 : slot 3/3, L25)
$64 = ihp4 (int4 : slot 1/4, L26)
$65 = ihp4 (int4 : slot 2/4, L26)
$66 = ihp4 (int4 : slot 3/4, L26)
$67 = ihp4 (int4 : slot 4/4, L26)
$68 = imp4 (int4 : slot 1/4, L27)
$69 = imp4 (int4 : slot 2/4, L27)
$70 = imp4 (int4 : slot 3/4, L27)
$71 = imp4 (int4 : slot 4/4, L27)
$72 = [test_matrix].result (bool, L33)
$73 = mp2 (float2x2 : slot 1/4, L34)
$74 = mp2 (float2x2 : slot 2/4, L34)
$75 = mp2 (float2x2 : slot 3/4, L34)
$76 = mp2 (float2x2 : slot 4/4, L34)
$77 = hp2 (float2x2 : slot 1/4, L35)
$78 = hp2 (float2x2 : slot 2/4, L35)
$79 = hp2 (float2x2 : slot 3/4, L35)
$80 = hp2 (float2x2 : slot 4/4, L35)
$81 = mp3 (float3x3 : slot 1/9, L36)
$82 = mp3 (float3x3 : slot 2/9, L36)
$83 = mp3 (float3x3 : slot 3/9, L36)
$84 = mp3 (float3x3 : slot 4/9, L36)
$85 = mp3 (float3x3 : slot 5/9, L36)
$86 = mp3 (float3x3 : slot 6/9, L36)
$87 = mp3 (float3x3 : slot 7/9, L36)
$88 = mp3 (float3x3 : slot 8/9, L36)
$89 = mp3 (float3x3 : slot 9/9, L36)
$90 = hp3 (float3x3 : slot 1/9, L37)
$91 = hp3 (float3x3 : slot 2/9, L37)
$92 = hp3 (float3x3 : slot 3/9, L37)
$93 = hp3 (float3x3 : slot 4/9, L37)
$94 = hp3 (float3x3 : slot 5/9, L37)
$95 = hp3 (float3x3 : slot 6/9, L37)
$96 = hp3 (float3x3 : slot 7/9, L37)
$97 = hp3 (float3x3 : slot 8/9, L37)
$98 = hp3 (float3x3 : slot 9/9, L37)
$99 = mp4 (float4x4 : slot 1/16, L38)
$100 = mp4 (float4x4 : slot 2/16, L38)
$101 = mp4 (float4x4 : slot 3/16, L38)
$102 = mp4 (float4x4 : slot 4/16, L38)
$103 = mp4 (float4x4 : slot 5/16, L38)
$104 = mp4 (float4x4 : slot 6/16, L38)
$105 = mp4 (float4x4 : slot 7/16, L38)
$106 = mp4 (float4x4 : slot 8/16, L38)
$107 = mp4 (float4x4 : slot 9/16, L38)
$108 = mp4 (float4x4 : slot 10/16, L38)
$109 = mp4 (float4x4 : slot 11/16, L38)
$110 = mp4 (float4x4 : slot 12/16, L38)
$111 = mp4 (float4x4 : slot 13/16, L38)
$112 = mp4 (float4x4 : slot 14/16, L38)
$113 = mp4 (float4x4 : slot 15/16, L38)
$114 = mp4 (float4x4 : slot 16/16, L38)
$115 = hp4 (float4x4 : slot 1/16, L39)
$116 = hp4 (float4x4 : slot 2/16, L39)
$117 = hp4 (float4x4 : slot 3/16, L39)
$118 = hp4 (float4x4 : slot 4/16, L39)
$119 = hp4 (float4x4 : slot 5/16, L39)
$120 = hp4 (float4x4 : slot 6/16, L39)
$121 = hp4 (float4x4 : slot 7/16, L39)
$122 = hp4 (float4x4 : slot 8/16, L39)
$123 = hp4 (float4x4 : slot 9/16, L39)
$124 = hp4 (float4x4 : slot 10/16, L39)
$125 = hp4 (float4x4 : slot 11/16, L39)
$126 = hp4 (float4x4 : slot 12/16, L39)
$127 = hp4 (float4x4 : slot 13/16, L39)
$128 = hp4 (float4x4 : slot 14/16, L39)
$129 = hp4 (float4x4 : slot 15/16, L39)
$130 = hp4 (float4x4 : slot 16/16, L39)
$131 = [test_array].result (bool, L44)
$132 = mf[0] (float, L45)
$133 = hf[0] (float, L46)
$134 = mv[0] (float2 : slot 1/2, L47)
$135 = mv[0] (float2 : slot 2/2, L47)
$136 = mv[1] (float2 : slot 1/2, L47)
$137 = mv[1] (float2 : slot 2/2, L47)
$138 = hv[0] (float2 : slot 1/2, L48)
$139 = hv[0] (float2 : slot 2/2, L48)
$140 = hv[1] (float2 : slot 1/2, L48)
$141 = hv[1] (float2 : slot 2/2, L48)
$142 = [highp_param].result (bool, L53)
$143 = value (float, L53)
$144 = [mediump_param].result (bool, L54)
$145 = value (float, L54)
$146 = [lowp_param].result (bool, L55)
$147 = value (float, L55)
F0 = vec4 main(vec2 coords)
F1 = bool test_scalar()
F2 = bool test_vector()
F3 = bool test_matrix()
F4 = bool test_array()
F5 = bool highp_param(float value)
F6 = bool mediump_param(half value)
F7 = bool lowp_param(half value)
22 registers, 261 instructions:
0 r0 = uniform32 ptr0 0
1 r1 = uniform32 ptr0 4
2 r2 = uniform32 ptr0 8
3 r3 = uniform32 ptr0 C
4 r4 = uniform32 ptr0 10
5 r5 = uniform32 ptr0 14
6 r6 = uniform32 ptr0 18
7 r7 = uniform32 ptr0 1C
8 r8 = uniform32 ptr0 20
9 r9 = splat 0 (0)
10 r10 = splat FFFFFFFF (nan)
11 r11 = splat 3F000000 (0.5)
12 r12 = eq_f32 r0 r11
13 r13 = splat 3F800000 (1)
14 r14 = splat 2 (2.8025969e-45)
15 r15 = splat 40000000 (2)
16 r16 = splat 40400000 (3)
17 r17 = splat 40800000 (4)
18 r18 = splat 3 (4.2038954e-45)
19 r19 = splat 4 (5.6051939e-45)
loop:
20 r20 = index
21 r21 = eq_f32 r20 r11
22 r21 = bit_and r21 r12
23 trace_var 0 r21 r21 $0 = r1
24 trace_var 0 r21 r21 $1 = r2
25 trace_var 0 r21 r21 $2 = r3
26 trace_var 0 r21 r21 $3 = r4
27 trace_var 0 r21 r21 $4 = r5
28 trace_var 0 r21 r21 $5 = r6
29 trace_var 0 r21 r21 $6 = r7
30 trace_var 0 r21 r21 $7 = r8
31 trace_enter 0 r21 r21 F0
32 trace_var 0 r21 r21 $12 = r20
33 trace_var 0 r21 r21 $13 = r0
34 trace_scope 0 r21 r21 1
35 trace_line 0 r21 r21 L58
36 trace_var 0 r21 r21 $14 = r9
37 trace_var 0 r21 r21 $15 = r9
38 trace_var 0 r21 r21 $16 = r9
39 trace_var 0 r21 r21 $17 = r9
40 trace_line 0 r21 r21 L59
41 trace_var 0 r21 r21 $18 = r13
42 trace_var 0 r21 r21 $19 = r13
43 trace_var 0 r21 r21 $20 = r13
44 trace_var 0 r21 r21 $21 = r13
45 trace_line 0 r21 r21 L60
46 trace_var 0 r21 r21 $22 = r1
47 trace_var 0 r21 r21 $23 = r2
48 trace_var 0 r21 r21 $24 = r3
49 trace_var 0 r21 r21 $25 = r4
50 trace_line 0 r21 r21 L61
51 trace_line 0 r21 r21 L63
52 trace_var 0 r21 r21 $26 = r5
53 trace_var 0 r21 r21 $27 = r6
54 trace_var 0 r21 r21 $28 = r7
55 trace_var 0 r21 r21 $29 = r8
56 trace_line 0 r21 r21 L64
57 trace_line 0 r21 r21 L66
58 trace_enter 0 r21 r21 F1
59 trace_scope 0 r21 r21 1
60 trace_line 0 r21 r21 L6
61 trace_var 0 r21 r21 $31 = r11
62 trace_line 0 r21 r21 L7
63 trace_var 0 r21 r21 $32 = r11
64 trace_line 0 r21 r21 L8
65 trace_var 0 r21 r21 $33 = r14
66 trace_line 0 r21 r21 L9
67 trace_var 0 r21 r21 $34 = r14
68 trace_line 0 r21 r21 L11
69 trace_var 0 r21 r21 $30 = r10
70 trace_scope 0 r21 r21 -1
71 trace_exit 0 r21 r21 F1
72 trace_enter 0 r21 r21 F2
73 trace_scope 0 r21 r21 1
74 trace_line 0 r21 r21 L15
75 trace_var 0 r21 r21 $36 = r15
76 trace_var 0 r21 r21 $37 = r15
77 trace_line 0 r21 r21 L16
78 trace_var 0 r21 r21 $38 = r15
79 trace_var 0 r21 r21 $39 = r15
80 trace_line 0 r21 r21 L17
81 trace_var 0 r21 r21 $40 = r16
82 trace_var 0 r21 r21 $41 = r16
83 trace_var 0 r21 r21 $42 = r16
84 trace_line 0 r21 r21 L18
85 trace_var 0 r21 r21 $43 = r16
86 trace_var 0 r21 r21 $44 = r16
87 trace_var 0 r21 r21 $45 = r16
88 trace_line 0 r21 r21 L19
89 trace_var 0 r21 r21 $46 = r17
90 trace_var 0 r21 r21 $47 = r17
91 trace_var 0 r21 r21 $48 = r17
92 trace_var 0 r21 r21 $49 = r17
93 trace_line 0 r21 r21 L20
94 trace_var 0 r21 r21 $50 = r17
95 trace_var 0 r21 r21 $51 = r17
96 trace_var 0 r21 r21 $52 = r17
97 trace_var 0 r21 r21 $53 = r17
98 trace_line 0 r21 r21 L22
99 trace_var 0 r21 r21 $54 = r14
100 trace_var 0 r21 r21 $55 = r14
101 trace_line 0 r21 r21 L23
102 trace_var 0 r21 r21 $56 = r14
103 trace_var 0 r21 r21 $57 = r14
104 trace_line 0 r21 r21 L24
105 trace_var 0 r21 r21 $58 = r18
106 trace_var 0 r21 r21 $59 = r18
107 trace_var 0 r21 r21 $60 = r18
108 trace_line 0 r21 r21 L25
109 trace_var 0 r21 r21 $61 = r18
110 trace_var 0 r21 r21 $62 = r18
111 trace_var 0 r21 r21 $63 = r18
112 trace_line 0 r21 r21 L26
113 trace_var 0 r21 r21 $64 = r19
114 trace_var 0 r21 r21 $65 = r19
115 trace_var 0 r21 r21 $66 = r19
116 trace_var 0 r21 r21 $67 = r19
117 trace_line 0 r21 r21 L27
118 trace_var 0 r21 r21 $68 = r19
119 trace_var 0 r21 r21 $69 = r19
120 trace_var 0 r21 r21 $70 = r19
121 trace_var 0 r21 r21 $71 = r19
122 trace_line 0 r21 r21 L29
123 trace_var 0 r21 r21 $35 = r10
124 trace_scope 0 r21 r21 -1
125 trace_exit 0 r21 r21 F2
126 trace_enter 0 r21 r21 F3
127 trace_scope 0 r21 r21 1
128 trace_line 0 r21 r21 L34
129 trace_var 0 r21 r21 $73 = r15
130 trace_var 0 r21 r21 $74 = r9
131 trace_var 0 r21 r21 $75 = r9
132 trace_var 0 r21 r21 $76 = r15
133 trace_line 0 r21 r21 L35
134 trace_var 0 r21 r21 $77 = r15
135 trace_var 0 r21 r21 $78 = r9
136 trace_var 0 r21 r21 $79 = r9
137 trace_var 0 r21 r21 $80 = r15
138 trace_line 0 r21 r21 L36
139 trace_var 0 r21 r21 $81 = r16
140 trace_var 0 r21 r21 $82 = r9
141 trace_var 0 r21 r21 $83 = r9
142 trace_var 0 r21 r21 $84 = r9
143 trace_var 0 r21 r21 $85 = r16
144 trace_var 0 r21 r21 $86 = r9
145 trace_var 0 r21 r21 $87 = r9
146 trace_var 0 r21 r21 $88 = r9
147 trace_var 0 r21 r21 $89 = r16
148 trace_line 0 r21 r21 L37
149 trace_var 0 r21 r21 $90 = r16
150 trace_var 0 r21 r21 $91 = r9
151 trace_var 0 r21 r21 $92 = r9
152 trace_var 0 r21 r21 $93 = r9
153 trace_var 0 r21 r21 $94 = r16
154 trace_var 0 r21 r21 $95 = r9
155 trace_var 0 r21 r21 $96 = r9
156 trace_var 0 r21 r21 $97 = r9
157 trace_var 0 r21 r21 $98 = r16
158 trace_line 0 r21 r21 L38
159 trace_var 0 r21 r21 $99 = r17
160 trace_var 0 r21 r21 $100 = r9
161 trace_var 0 r21 r21 $101 = r9
162 trace_var 0 r21 r21 $102 = r9
163 trace_var 0 r21 r21 $103 = r9
164 trace_var 0 r21 r21 $104 = r17
165 trace_var 0 r21 r21 $105 = r9
166 trace_var 0 r21 r21 $106 = r9
167 trace_var 0 r21 r21 $107 = r9
168 trace_var 0 r21 r21 $108 = r9
169 trace_var 0 r21 r21 $109 = r17
170 trace_var 0 r21 r21 $110 = r9
171 trace_var 0 r21 r21 $111 = r9
172 trace_var 0 r21 r21 $112 = r9
173 trace_var 0 r21 r21 $113 = r9
174 trace_var 0 r21 r21 $114 = r17
175 trace_line 0 r21 r21 L39
176 trace_var 0 r21 r21 $115 = r17
177 trace_var 0 r21 r21 $116 = r9
178 trace_var 0 r21 r21 $117 = r9
179 trace_var 0 r21 r21 $118 = r9
180 trace_var 0 r21 r21 $119 = r9
181 trace_var 0 r21 r21 $120 = r17
182 trace_var 0 r21 r21 $121 = r9
183 trace_var 0 r21 r21 $122 = r9
184 trace_var 0 r21 r21 $123 = r9
185 trace_var 0 r21 r21 $124 = r9
186 trace_var 0 r21 r21 $125 = r17
187 trace_var 0 r21 r21 $126 = r9
188 trace_var 0 r21 r21 $127 = r9
189 trace_var 0 r21 r21 $128 = r9
190 trace_var 0 r21 r21 $129 = r9
191 trace_var 0 r21 r21 $130 = r17
192 trace_line 0 r21 r21 L41
193 trace_var 0 r21 r21 $72 = r10
194 trace_scope 0 r21 r21 -1
195 trace_exit 0 r21 r21 F3
196 trace_enter 0 r21 r21 F4
197 trace_scope 0 r21 r21 1
198 trace_line 0 r21 r21 L45
199 trace_var 0 r21 r21 $132 = r9
200 trace_line 0 r21 r21 L45
201 trace_var 0 r21 r21 $132 = r13
202 trace_line 0 r21 r21 L46
203 trace_var 0 r21 r21 $133 = r9
204 trace_line 0 r21 r21 L46
205 trace_var 0 r21 r21 $133 = r13
206 trace_line 0 r21 r21 L47
207 trace_var 0 r21 r21 $134 = r9
208 trace_var 0 r21 r21 $135 = r9
209 trace_var 0 r21 r21 $136 = r9
210 trace_var 0 r21 r21 $137 = r9
211 trace_line 0 r21 r21 L47
212 trace_var 0 r21 r21 $135 = r13
213 trace_line 0 r21 r21 L47
214 trace_var 0 r21 r21 $136 = r15
215 trace_var 0 r21 r21 $137 = r16
216 trace_line 0 r21 r21 L48
217 trace_var 0 r21 r21 $138 = r9
218 trace_var 0 r21 r21 $139 = r9
219 trace_var 0 r21 r21 $140 = r9
220 trace_var 0 r21 r21 $141 = r9
221 trace_line 0 r21 r21 L48
222 trace_var 0 r21 r21 $139 = r13
223 trace_line 0 r21 r21 L48
224 trace_var 0 r21 r21 $140 = r15
225 trace_var 0 r21 r21 $141 = r16
226 trace_line 0 r21 r21 L50
227 trace_var 0 r21 r21 $131 = r10
228 trace_scope 0 r21 r21 -1
229 trace_exit 0 r21 r21 F4
230 trace_enter 0 r21 r21 F5
231 trace_var 0 r21 r21 $143 = r13
232 trace_scope 0 r21 r21 1
233 trace_line 0 r21 r21 L53
234 trace_var 0 r21 r21 $142 = r10
235 trace_scope 0 r21 r21 -1
236 trace_exit 0 r21 r21 F5
237 trace_enter 0 r21 r21 F6
238 trace_var 0 r21 r21 $145 = r15
239 trace_scope 0 r21 r21 1
240 trace_line 0 r21 r21 L54
241 trace_var 0 r21 r21 $144 = r10
242 trace_scope 0 r21 r21 -1
243 trace_exit 0 r21 r21 F6
244 trace_enter 0 r21 r21 F7
245 trace_var 0 r21 r21 $147 = r16
246 trace_scope 0 r21 r21 1
247 trace_line 0 r21 r21 L55
248 trace_var 0 r21 r21 $146 = r10
249 trace_scope 0 r21 r21 -1
250 trace_exit 0 r21 r21 F7
251 trace_var 0 r21 r21 $8 = r1
252 trace_var 0 r21 r21 $9 = r2
253 trace_var 0 r21 r21 $10 = r3
254 trace_var 0 r21 r21 $11 = r4
255 trace_scope 0 r21 r21 -1
256 trace_exit 0 r21 r21 F0
257 store32 ptr1 r1
258 store32 ptr2 r2
259 store32 ptr3 r3
260 store32 ptr4 r4