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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
use std::collections::HashMap;

use once_cell::sync::Lazy;

use crate::types::type_names::TypeNameAtom;

#[macro_use]
pub mod names;

use names::ExtNameAtom;

pub struct ExtensionSpec {
    name: ExtNameAtom,
    type_names: Vec<TypeNameAtom>,
}

impl ExtensionSpec {
    pub fn new(name: ExtNameAtom, type_names: Vec<TypeNameAtom>) -> Self {
        Self { name, type_names }
    }

    pub fn name(&self) -> &ExtNameAtom {
        &self.name
    }

    pub fn type_names(&self) -> &[TypeNameAtom] {
        &self.type_names
    }
}

pub struct Registry {
    extensions: HashMap<ExtNameAtom, ExtensionSpec>,
}

impl Registry {
    pub fn new() -> Self {
        Self {
            extensions: Default::default(),
        }
    }

    pub fn all(&self) -> impl Iterator<Item = &ExtensionSpec> {
        self.extensions.values()
    }

    pub fn get(&self, name: &ExtNameAtom) -> Option<&ExtensionSpec> {
        self.extensions.get(name)
    }

    pub fn add(&mut self, spec: ExtensionSpec) {
        self.extensions.insert(spec.name.clone(), spec);
    }
}

// TODO: Fill registry with extension data from Khronos

impl Default for Registry {
    fn default() -> Self {
        Self {
            extensions: [
                ExtensionSpec::new(ExtNameAtom::from("GL_3DL_array_objects"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_AMD_gpu_shader_int16"),
                    vec![
                        TypeNameAtom::from("int16_t"),
                        TypeNameAtom::from("i16vec2"),
                        TypeNameAtom::from("i16vec3"),
                        TypeNameAtom::from("i16vec4"),
                        TypeNameAtom::from("uint16_t"),
                        TypeNameAtom::from("u16vec2"),
                        TypeNameAtom::from("u16vec3"),
                        TypeNameAtom::from("u16vec4"),
                    ],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_compute_shader"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_derivative_control"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_enhanced_layouts"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_explicit_attrib_location"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_explicit_uniform_location"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_gpu_shader5"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_gpu_shader_fp64"),
                    vec![
                        type_name!("double"),
                        type_name!("dvec2"),
                        type_name!("dvec3"),
                        type_name!("dvec4"),
                        type_name!("dmat2"),
                        type_name!("dmat3"),
                        type_name!("dmat4"),
                        type_name!("dmat2x2"),
                        type_name!("dmat2x3"),
                        type_name!("dmat2x4"),
                        type_name!("dmat3x2"),
                        type_name!("dmat3x3"),
                        type_name!("dmat3x4"),
                        type_name!("dmat4x2"),
                        type_name!("dmat4x3"),
                        type_name!("dmat4x4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_gpu_shader_int64"),
                    vec![
                        TypeNameAtom::from("int64_t"),
                        TypeNameAtom::from("i64vec2"),
                        TypeNameAtom::from("i64vec3"),
                        TypeNameAtom::from("i64vec4"),
                        TypeNameAtom::from("uint64_t"),
                        TypeNameAtom::from("u64vec2"),
                        TypeNameAtom::from("u64vec3"),
                        TypeNameAtom::from("u64vec4"),
                    ],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_sample_shading"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_separate_shader_objects"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_shader_bit_encoding"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_shader_draw_parameters"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_shader_image_load_store"),
                    vec![
                        type_name!("image1D"),
                        type_name!("iimage1D"),
                        type_name!("uimage1D"),
                        type_name!("image2D"),
                        type_name!("iimage2D"),
                        type_name!("uimage2D"),
                        type_name!("image3D"),
                        type_name!("iimage3D"),
                        type_name!("uimage3D"),
                        type_name!("image2DRect"),
                        type_name!("iimage2DRect"),
                        type_name!("uimage2DRect"),
                        type_name!("imageCube"),
                        type_name!("iimageCube"),
                        type_name!("uimageCube"),
                        type_name!("imageBuffer"),
                        type_name!("iimageBuffer"),
                        type_name!("uimageBuffer"),
                        type_name!("image1DArray"),
                        type_name!("iimage1DArray"),
                        type_name!("uimage1DArray"),
                        type_name!("image2DArray"),
                        type_name!("iimage2DArray"),
                        type_name!("uimage2DArray"),
                        type_name!("imageCubeArray"),
                        type_name!("iimageCubeArray"),
                        type_name!("uimageCubeArray"),
                        type_name!("image2DMS"),
                        type_name!("iimage2DMS"),
                        type_name!("uimage2DMS"),
                        type_name!("image2DMSArray"),
                        type_name!("iimage2DMSArray"),
                        type_name!("uimage2DMSArray"),
                    ],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_shader_image_size"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_shader_storage_buffer_object"),
                    vec![],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_shader_texture_image_samples"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_shader_texture_lod"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_shading_language_420pack"), vec![]),
                ExtensionSpec::new(ext_name!("GL_ARB_shading_language_include"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_shading_language_packing"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_sparse_texture2"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_tessellation_shader"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_texture_cube_map_array"),
                    vec![
                        type_name!("samplerCubeArray"),
                        type_name!("samplerCubeArrayShadow"),
                        type_name!("isamplerCubeArray"),
                        type_name!("usamplerCubeArray"),
                    ],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_texture_gather"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_texture_multisample"),
                    vec![
                        type_name!("sampler2DMS"),
                        type_name!("isampler2DMS"),
                        type_name!("usampler2DMS"),
                        type_name!("sampler2DMSArray"),
                        type_name!("isampler2DMSArray"),
                        type_name!("usampler2DMSArray"),
                    ],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_texture_query_lod"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_ARB_texture_rectangle"),
                    vec![
                        type_name!("sampler2DRect"),
                        type_name!("sampler2DRectShadow"),
                    ],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_uniform_buffer_object"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_vertex_attrib_64bit"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_ARB_viewport_array"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_YUV_target"),
                    vec![TypeNameAtom::from("__samplerExternal2DY2YEXT")],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_blend_func_extended"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_control_flow_attributes"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_device_group"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_frag_depth"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_geometry_shader"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_gpu_shader5"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_multiview"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_nonuniform_qualifier"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_null_initializer"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_primitive_bounding_box"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_ray_flags_primitive_culling"),
                    vec![],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_ray_query"),
                    vec![
                        TypeNameAtom::from("accelerationStructureEXT"),
                        TypeNameAtom::from("rayQueryEXT"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_samplerless_texture_functions"),
                    vec![],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types"),
                    vec![
                        TypeNameAtom::from("float64_t"),
                        TypeNameAtom::from("f64vec2"),
                        TypeNameAtom::from("f64vec3"),
                        TypeNameAtom::from("f64vec4"),
                        TypeNameAtom::from("f64mat2"),
                        TypeNameAtom::from("f64mat3"),
                        TypeNameAtom::from("f64mat4"),
                        TypeNameAtom::from("f64mat2x2"),
                        TypeNameAtom::from("f64mat2x3"),
                        TypeNameAtom::from("f64mat2x4"),
                        TypeNameAtom::from("f64mat3x2"),
                        TypeNameAtom::from("f64mat3x3"),
                        TypeNameAtom::from("f64mat3x4"),
                        TypeNameAtom::from("f64mat4x2"),
                        TypeNameAtom::from("f64mat4x3"),
                        TypeNameAtom::from("f64mat4x4"),
                        TypeNameAtom::from("float32_t"),
                        TypeNameAtom::from("f32vec2"),
                        TypeNameAtom::from("f32vec3"),
                        TypeNameAtom::from("f32vec4"),
                        TypeNameAtom::from("f32mat2"),
                        TypeNameAtom::from("f32mat3"),
                        TypeNameAtom::from("f32mat4"),
                        TypeNameAtom::from("f32mat2x2"),
                        TypeNameAtom::from("f32mat2x3"),
                        TypeNameAtom::from("f32mat2x4"),
                        TypeNameAtom::from("f32mat3x2"),
                        TypeNameAtom::from("f32mat3x3"),
                        TypeNameAtom::from("f32mat3x4"),
                        TypeNameAtom::from("f32mat4x2"),
                        TypeNameAtom::from("f32mat4x3"),
                        TypeNameAtom::from("f32mat4x4"),
                        TypeNameAtom::from("float16_t"),
                        TypeNameAtom::from("f16vec2"),
                        TypeNameAtom::from("f16vec3"),
                        TypeNameAtom::from("f16vec4"),
                        TypeNameAtom::from("f16mat2"),
                        TypeNameAtom::from("f16mat3"),
                        TypeNameAtom::from("f16mat4"),
                        TypeNameAtom::from("f16mat2x2"),
                        TypeNameAtom::from("f16mat2x3"),
                        TypeNameAtom::from("f16mat2x4"),
                        TypeNameAtom::from("f16mat3x2"),
                        TypeNameAtom::from("f16mat3x3"),
                        TypeNameAtom::from("f16mat3x4"),
                        TypeNameAtom::from("f16mat4x2"),
                        TypeNameAtom::from("f16mat4x3"),
                        TypeNameAtom::from("f16mat4x4"),
                        TypeNameAtom::from("int64_t"),
                        TypeNameAtom::from("i64vec2"),
                        TypeNameAtom::from("i64vec3"),
                        TypeNameAtom::from("i64vec4"),
                        TypeNameAtom::from("uint64_t"),
                        TypeNameAtom::from("u64vec2"),
                        TypeNameAtom::from("u64vec3"),
                        TypeNameAtom::from("u64vec4"),
                        TypeNameAtom::from("int32_t"),
                        TypeNameAtom::from("i32vec2"),
                        TypeNameAtom::from("i32vec3"),
                        TypeNameAtom::from("i32vec4"),
                        TypeNameAtom::from("uint32_t"),
                        TypeNameAtom::from("u32vec2"),
                        TypeNameAtom::from("u32vec3"),
                        TypeNameAtom::from("u32vec4"),
                        TypeNameAtom::from("int16_t"),
                        TypeNameAtom::from("i16vec2"),
                        TypeNameAtom::from("i16vec3"),
                        TypeNameAtom::from("i16vec4"),
                        TypeNameAtom::from("uint16_t"),
                        TypeNameAtom::from("u16vec2"),
                        TypeNameAtom::from("u16vec3"),
                        TypeNameAtom::from("u16vec4"),
                        TypeNameAtom::from("int8_t"),
                        TypeNameAtom::from("i8vec2"),
                        TypeNameAtom::from("i8vec3"),
                        TypeNameAtom::from("i8vec4"),
                        TypeNameAtom::from("uint8_t"),
                        TypeNameAtom::from("u8vec2"),
                        TypeNameAtom::from("u8vec3"),
                        TypeNameAtom::from("u8vec4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types_float16"),
                    vec![
                        TypeNameAtom::from("float16_t"),
                        TypeNameAtom::from("f16vec2"),
                        TypeNameAtom::from("f16vec3"),
                        TypeNameAtom::from("f16vec4"),
                        TypeNameAtom::from("f16mat2"),
                        TypeNameAtom::from("f16mat3"),
                        TypeNameAtom::from("f16mat4"),
                        TypeNameAtom::from("f16mat2x2"),
                        TypeNameAtom::from("f16mat2x3"),
                        TypeNameAtom::from("f16mat2x4"),
                        TypeNameAtom::from("f16mat3x2"),
                        TypeNameAtom::from("f16mat3x3"),
                        TypeNameAtom::from("f16mat3x4"),
                        TypeNameAtom::from("f16mat4x2"),
                        TypeNameAtom::from("f16mat4x3"),
                        TypeNameAtom::from("f16mat4x4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types_float32"),
                    vec![
                        TypeNameAtom::from("float32_t"),
                        TypeNameAtom::from("f32vec2"),
                        TypeNameAtom::from("f32vec3"),
                        TypeNameAtom::from("f32vec4"),
                        TypeNameAtom::from("f32mat2"),
                        TypeNameAtom::from("f32mat3"),
                        TypeNameAtom::from("f32mat4"),
                        TypeNameAtom::from("f32mat2x2"),
                        TypeNameAtom::from("f32mat2x3"),
                        TypeNameAtom::from("f32mat2x4"),
                        TypeNameAtom::from("f32mat3x2"),
                        TypeNameAtom::from("f32mat3x3"),
                        TypeNameAtom::from("f32mat3x4"),
                        TypeNameAtom::from("f32mat4x2"),
                        TypeNameAtom::from("f32mat4x3"),
                        TypeNameAtom::from("f32mat4x4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types_float64"),
                    vec![
                        TypeNameAtom::from("float64_t"),
                        TypeNameAtom::from("f64vec2"),
                        TypeNameAtom::from("f64vec3"),
                        TypeNameAtom::from("f64vec4"),
                        TypeNameAtom::from("f64mat2"),
                        TypeNameAtom::from("f64mat3"),
                        TypeNameAtom::from("f64mat4"),
                        TypeNameAtom::from("f64mat2x2"),
                        TypeNameAtom::from("f64mat2x3"),
                        TypeNameAtom::from("f64mat2x4"),
                        TypeNameAtom::from("f64mat3x2"),
                        TypeNameAtom::from("f64mat3x3"),
                        TypeNameAtom::from("f64mat3x4"),
                        TypeNameAtom::from("f64mat4x2"),
                        TypeNameAtom::from("f64mat4x3"),
                        TypeNameAtom::from("f64mat4x4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types_int16"),
                    vec![
                        TypeNameAtom::from("int16_t"),
                        TypeNameAtom::from("i16vec2"),
                        TypeNameAtom::from("i16vec3"),
                        TypeNameAtom::from("i16vec4"),
                        TypeNameAtom::from("uint16_t"),
                        TypeNameAtom::from("u16vec2"),
                        TypeNameAtom::from("u16vec3"),
                        TypeNameAtom::from("u16vec4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types_int32"),
                    vec![
                        TypeNameAtom::from("int32_t"),
                        TypeNameAtom::from("i32vec2"),
                        TypeNameAtom::from("i32vec3"),
                        TypeNameAtom::from("i32vec4"),
                        TypeNameAtom::from("uint32_t"),
                        TypeNameAtom::from("u32vec2"),
                        TypeNameAtom::from("u32vec3"),
                        TypeNameAtom::from("u32vec4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types_int64"),
                    vec![
                        TypeNameAtom::from("int64_t"),
                        TypeNameAtom::from("i64vec2"),
                        TypeNameAtom::from("i64vec3"),
                        TypeNameAtom::from("i64vec4"),
                        TypeNameAtom::from("uint64_t"),
                        TypeNameAtom::from("u64vec2"),
                        TypeNameAtom::from("u64vec3"),
                        TypeNameAtom::from("u64vec4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_explicit_arithmetic_types_int8"),
                    vec![
                        TypeNameAtom::from("int8_t"),
                        TypeNameAtom::from("i8vec2"),
                        TypeNameAtom::from("i8vec3"),
                        TypeNameAtom::from("i8vec4"),
                        TypeNameAtom::from("uint8_t"),
                        TypeNameAtom::from("u8vec2"),
                        TypeNameAtom::from("u8vec3"),
                        TypeNameAtom::from("u8vec4"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_implicit_conversions"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_shader_integer_mix"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_shader_io_blocks"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_non_constant_global_initializers"),
                    vec![],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_shader_texture_image_samples"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_shader_texture_lod"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_terminate_invocation"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_EXT_tessellation_shader"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_texture_buffer"),
                    vec![
                        type_name!("samplerBuffer"),
                        type_name!("isamplerBuffer"),
                        type_name!("usamplerBuffer"),
                        type_name!("imageBuffer"),
                        type_name!("iimageBuffer"),
                        type_name!("uimageBuffer"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_EXT_texture_cube_map_array"),
                    vec![
                        type_name!("samplerCubeArray"),
                        type_name!("samplerCubeArrayShadow"),
                        type_name!("isamplerCubeArray"),
                        type_name!("usamplerCubeArray"),
                        type_name!("imageCubeArray"),
                        type_name!("iimageCubeArray"),
                        type_name!("uimageCubeArray"),
                    ],
                ),
                ExtensionSpec::new(ext_name!("GL_GOOGLE_include_directive"), vec![]),
                ExtensionSpec::new(ext_name!("GL_GOOGLE_cpp_style_line_directive"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_KHR_blend_equation_advanced"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_KHR_shader_subgroup_arithmetic"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_KHR_shader_subgroup_ballot"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_KHR_shader_subgroup_basic"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_KHR_shader_subgroup_clustered"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_KHR_shader_subgroup_quad"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_KHR_shader_subgroup_shuffle"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_KHR_shader_subgroup_shuffle_relative"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_KHR_shader_subgroup_vote"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_NV_mesh_shader"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_NV_ray_tracing"),
                    vec![
                        TypeNameAtom::from("accelerationStructureNV"),
                        TypeNameAtom::from("rayPayloadNV"),
                        TypeNameAtom::from("rayPayloadInNV"),
                        TypeNameAtom::from("hitAttributeNV"),
                        TypeNameAtom::from("callableDataNV"),
                        TypeNameAtom::from("callableDataInNV"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_NV_shader_noperspective_interpolation"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_NV_shader_sm_builtins"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_NV_shader_subgroup_partitioned"),
                    vec![],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_OES_EGL_image_external"),
                    vec![TypeNameAtom::from("samplerExternalOES")],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_OES_EGL_image_external_essl3"),
                    vec![TypeNameAtom::from("samplerExternalOES")],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_geometry_point_size"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_geometry_shader"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_gpu_shader5"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_primitive_bounding_box"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_sample_variables"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_shader_image_atomic"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_shader_io_blocks"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_OES_shader_multisample_interpolation"),
                    vec![],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_standard_derivatives"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_tessellation_point_size"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OES_tessellation_shader"), vec![]),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_OES_texture_buffer"),
                    vec![
                        type_name!("samplerBuffer"),
                        type_name!("isamplerBuffer"),
                        type_name!("usamplerBuffer"),
                        type_name!("imageBuffer"),
                        type_name!("iimageBuffer"),
                        type_name!("uimageBuffer"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_OES_texture_cube_map_array"),
                    vec![
                        type_name!("samplerCubeArray"),
                        type_name!("samplerCubeArrayShadow"),
                        type_name!("isamplerCubeArray"),
                        type_name!("usamplerCubeArray"),
                        type_name!("imageCubeArray"),
                        type_name!("iimageCubeArray"),
                        type_name!("uimageCubeArray"),
                    ],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_OES_texture_3D"),
                    vec![type_name!("sampler3D")],
                ),
                ExtensionSpec::new(
                    ExtNameAtom::from("GL_OES_texture_storage_multisample_2d_array"),
                    vec![
                        type_name!("sampler2DMSArray"),
                        type_name!("isampler2DMSArray"),
                        type_name!("usampler2DMSArray"),
                    ],
                ),
                ExtensionSpec::new(ExtNameAtom::from("GL_OVR_multiview"), vec![]),
                ExtensionSpec::new(ExtNameAtom::from("GL_OVR_multiview2"), vec![]),
            ]
            .into_iter()
            .map(|spec| (spec.name.clone(), spec))
            .collect(),
        }
    }
}

pub static DEFAULT_REGISTRY: Lazy<Registry> = Lazy::new(Registry::default);
pub static EMPTY_REGISTRY: Lazy<Registry> = Lazy::new(Registry::new);