1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
use naga::Expression;

// Expression does not implement PartialEq except for internal testing (cfg_attr(test)), so we must use our own version.
// This implementation is tweaked from the output of `cargo expand`
#[inline]
pub fn expression_eq(lhs: &Expression, rhs: &Expression) -> bool {
    let __lhs_tag = std::mem::discriminant(lhs);
    let __arg1_tag = std::mem::discriminant(rhs);
    __lhs_tag == __arg1_tag
        && match (lhs, rhs) {
            (Expression::Literal(__lhs_0), Expression::Literal(__arg1_0)) => *__lhs_0 == *__arg1_0,
            (Expression::Constant(__lhs_0), Expression::Constant(__arg1_0)) => {
                *__lhs_0 == *__arg1_0
            }
            (Expression::ZeroValue(__lhs_0), Expression::ZeroValue(__arg1_0)) => {
                *__lhs_0 == *__arg1_0
            }
            (
                Expression::Compose {
                    ty: __lhs_0,
                    components: __lhs_1,
                },
                Expression::Compose {
                    ty: __arg1_0,
                    components: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::Access {
                    base: __lhs_0,
                    index: __lhs_1,
                },
                Expression::Access {
                    base: __arg1_0,
                    index: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::AccessIndex {
                    base: __lhs_0,
                    index: __lhs_1,
                },
                Expression::AccessIndex {
                    base: __arg1_0,
                    index: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::Splat {
                    size: __lhs_0,
                    value: __lhs_1,
                },
                Expression::Splat {
                    size: __arg1_0,
                    value: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::Swizzle {
                    size: __lhs_0,
                    vector: __lhs_1,
                    pattern: __lhs_2,
                },
                Expression::Swizzle {
                    size: __arg1_0,
                    vector: __arg1_1,
                    pattern: __arg1_2,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1 && *__lhs_2 == *__arg1_2,
            (Expression::FunctionArgument(__lhs_0), Expression::FunctionArgument(__arg1_0)) => {
                *__lhs_0 == *__arg1_0
            }
            (Expression::GlobalVariable(__lhs_0), Expression::GlobalVariable(__arg1_0)) => {
                *__lhs_0 == *__arg1_0
            }
            (Expression::LocalVariable(__lhs_0), Expression::LocalVariable(__arg1_0)) => {
                *__lhs_0 == *__arg1_0
            }
            (Expression::Load { pointer: __lhs_0 }, Expression::Load { pointer: __arg1_0 }) => {
                *__lhs_0 == *__arg1_0
            }
            (
                Expression::ImageSample {
                    image: __lhs_0,
                    sampler: __lhs_1,
                    gather: __lhs_2,
                    coordinate: __lhs_3,
                    array_index: __lhs_4,
                    offset: __lhs_5,
                    level: __lhs_6,
                    depth_ref: __lhs_7,
                },
                Expression::ImageSample {
                    image: __arg1_0,
                    sampler: __arg1_1,
                    gather: __arg1_2,
                    coordinate: __arg1_3,
                    array_index: __arg1_4,
                    offset: __arg1_5,
                    level: __arg1_6,
                    depth_ref: __arg1_7,
                },
            ) => {
                *__lhs_0 == *__arg1_0
                    && *__lhs_1 == *__arg1_1
                    && *__lhs_2 == *__arg1_2
                    && *__lhs_3 == *__arg1_3
                    && *__lhs_4 == *__arg1_4
                    && *__lhs_5 == *__arg1_5
                    && *__lhs_6 == *__arg1_6
                    && *__lhs_7 == *__arg1_7
            }
            (
                Expression::ImageLoad {
                    image: __lhs_0,
                    coordinate: __lhs_1,
                    array_index: __lhs_2,
                    sample: __lhs_3,
                    level: __lhs_4,
                },
                Expression::ImageLoad {
                    image: __arg1_0,
                    coordinate: __arg1_1,
                    array_index: __arg1_2,
                    sample: __arg1_3,
                    level: __arg1_4,
                },
            ) => {
                *__lhs_0 == *__arg1_0
                    && *__lhs_1 == *__arg1_1
                    && *__lhs_2 == *__arg1_2
                    && *__lhs_3 == *__arg1_3
                    && *__lhs_4 == *__arg1_4
            }
            (
                Expression::ImageQuery {
                    image: __lhs_0,
                    query: __lhs_1,
                },
                Expression::ImageQuery {
                    image: __arg1_0,
                    query: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::Unary {
                    op: __lhs_0,
                    expr: __lhs_1,
                },
                Expression::Unary {
                    op: __arg1_0,
                    expr: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::Binary {
                    op: __lhs_0,
                    left: __lhs_1,
                    right: __lhs_2,
                },
                Expression::Binary {
                    op: __arg1_0,
                    left: __arg1_1,
                    right: __arg1_2,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1 && *__lhs_2 == *__arg1_2,
            (
                Expression::Select {
                    condition: __lhs_0,
                    accept: __lhs_1,
                    reject: __lhs_2,
                },
                Expression::Select {
                    condition: __arg1_0,
                    accept: __arg1_1,
                    reject: __arg1_2,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1 && *__lhs_2 == *__arg1_2,
            (
                Expression::Derivative {
                    axis: __lhs_0,
                    ctrl: __lhs_1,
                    expr: __lhs_2,
                },
                Expression::Derivative {
                    axis: __arg1_0,
                    ctrl: __arg1_1,
                    expr: __arg1_2,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1 && *__lhs_2 == *__arg1_2,
            (
                Expression::Relational {
                    fun: __lhs_0,
                    argument: __lhs_1,
                },
                Expression::Relational {
                    fun: __arg1_0,
                    argument: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::Math {
                    fun: __lhs_0,
                    arg: __lhs_1,
                    arg1: __lhs_2,
                    arg2: __lhs_3,
                    arg3: __lhs_4,
                },
                Expression::Math {
                    fun: __arg1_0,
                    arg: __arg1_1,
                    arg1: __arg1_2,
                    arg2: __arg1_3,
                    arg3: __arg1_4,
                },
            ) => {
                *__lhs_0 == *__arg1_0
                    && *__lhs_1 == *__arg1_1
                    && *__lhs_2 == *__arg1_2
                    && *__lhs_3 == *__arg1_3
                    && *__lhs_4 == *__arg1_4
            }
            (
                Expression::As {
                    expr: __lhs_0,
                    kind: __lhs_1,
                    convert: __lhs_2,
                },
                Expression::As {
                    expr: __arg1_0,
                    kind: __arg1_1,
                    convert: __arg1_2,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1 && *__lhs_2 == *__arg1_2,
            (Expression::CallResult(__lhs_0), Expression::CallResult(__arg1_0)) => {
                *__lhs_0 == *__arg1_0
            }
            (
                Expression::AtomicResult {
                    ty: __lhs_0,
                    comparison: __lhs_1,
                },
                Expression::AtomicResult {
                    ty: __arg1_0,
                    comparison: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            (
                Expression::WorkGroupUniformLoadResult { ty: __lhs_0 },
                Expression::WorkGroupUniformLoadResult { ty: __arg1_0 },
            ) => *__lhs_0 == *__arg1_0,
            (Expression::ArrayLength(__lhs_0), Expression::ArrayLength(__arg1_0)) => {
                *__lhs_0 == *__arg1_0
            }
            (
                Expression::RayQueryGetIntersection {
                    query: __lhs_0,
                    committed: __lhs_1,
                },
                Expression::RayQueryGetIntersection {
                    query: __arg1_0,
                    committed: __arg1_1,
                },
            ) => *__lhs_0 == *__arg1_0 && *__lhs_1 == *__arg1_1,
            _ => unreachable!(),
        }
}