@zephyr3d/device 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/base_types.js +602 -0
  2. package/dist/base_types.js.map +1 -0
  3. package/dist/builder/ast.js +2135 -0
  4. package/dist/builder/ast.js.map +1 -0
  5. package/dist/builder/base.js +477 -0
  6. package/dist/builder/base.js.map +1 -0
  7. package/dist/builder/builtinfunc.js +4101 -0
  8. package/dist/builder/builtinfunc.js.map +1 -0
  9. package/dist/builder/constructors.js +173 -0
  10. package/dist/builder/constructors.js.map +1 -0
  11. package/dist/builder/errors.js +148 -0
  12. package/dist/builder/errors.js.map +1 -0
  13. package/dist/builder/programbuilder.js +2323 -0
  14. package/dist/builder/programbuilder.js.map +1 -0
  15. package/dist/builder/reflection.js +60 -0
  16. package/dist/builder/reflection.js.map +1 -0
  17. package/dist/builder/types.js +1563 -0
  18. package/dist/builder/types.js.map +1 -0
  19. package/dist/device.js +515 -0
  20. package/dist/device.js.map +1 -0
  21. package/dist/gpuobject.js +2047 -0
  22. package/dist/gpuobject.js.map +1 -0
  23. package/dist/helpers/drawtext.js +187 -0
  24. package/dist/helpers/drawtext.js.map +1 -0
  25. package/dist/helpers/font.js +189 -0
  26. package/dist/helpers/font.js.map +1 -0
  27. package/dist/helpers/glyphmanager.js +121 -0
  28. package/dist/helpers/glyphmanager.js.map +1 -0
  29. package/dist/helpers/textureatlas.js +170 -0
  30. package/dist/helpers/textureatlas.js.map +1 -0
  31. package/dist/index.d.ts +3873 -0
  32. package/dist/index.js +16 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/timer.js +38 -0
  35. package/dist/timer.js.map +1 -0
  36. package/dist/uniformdata.js +147 -0
  37. package/dist/uniformdata.js.map +1 -0
  38. package/dist/vertexdata.js +135 -0
  39. package/dist/vertexdata.js.map +1 -0
  40. package/package.json +69 -0
@@ -0,0 +1,2047 @@
1
+ import { PBPrimitiveType, PBStructTypeInfo, PBArrayTypeInfo, PBPrimitiveTypeInfo } from './builder/types.js';
2
+
3
+ /** @internal */ const MAX_VERTEX_ATTRIBUTES = 16;
4
+ /** @internal */ const MAX_BINDING_GROUPS = 4;
5
+ /** @internal */ const MAX_TEXCOORD_INDEX_COUNT = 8;
6
+ /** @internal */ const VERTEX_ATTRIB_POSITION = 0;
7
+ /** @internal */ const VERTEX_ATTRIB_NORMAL = 1;
8
+ /** @internal */ const VERTEX_ATTRIB_DIFFUSE = 2;
9
+ /** @internal */ const VERTEX_ATTRIB_TANGENT = 3;
10
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD0 = 4;
11
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD1 = 5;
12
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD2 = 6;
13
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD3 = 7;
14
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD4 = 8;
15
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD5 = 9;
16
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD6 = 10;
17
+ /** @internal */ const VERTEX_ATTRIB_TEXCOORD7 = 11;
18
+ /** @internal */ const VERTEX_ATTRIB_BLEND_WEIGHT = 12;
19
+ /** @internal */ const VERTEX_ATTRIB_BLEND_INDICES = 13;
20
+ const vertexAttribFormatMap = {
21
+ position_u8normx2: [
22
+ VERTEX_ATTRIB_POSITION,
23
+ PBPrimitiveType.U8VEC2_NORM,
24
+ 2,
25
+ 'u8norm',
26
+ 2
27
+ ],
28
+ position_u8normx4: [
29
+ VERTEX_ATTRIB_POSITION,
30
+ PBPrimitiveType.U8VEC4_NORM,
31
+ 4,
32
+ 'u8norm',
33
+ 4
34
+ ],
35
+ position_i8normx2: [
36
+ VERTEX_ATTRIB_POSITION,
37
+ PBPrimitiveType.I8VEC2_NORM,
38
+ 2,
39
+ 'i8norm',
40
+ 2
41
+ ],
42
+ position_i8normx4: [
43
+ VERTEX_ATTRIB_POSITION,
44
+ PBPrimitiveType.I8VEC4_NORM,
45
+ 4,
46
+ 'i8norm',
47
+ 4
48
+ ],
49
+ position_u16x2: [
50
+ VERTEX_ATTRIB_POSITION,
51
+ PBPrimitiveType.U16VEC2,
52
+ 4,
53
+ 'u16',
54
+ 2
55
+ ],
56
+ position_u16x4: [
57
+ VERTEX_ATTRIB_POSITION,
58
+ PBPrimitiveType.U16VEC4,
59
+ 8,
60
+ 'u16',
61
+ 4
62
+ ],
63
+ position_i16x2: [
64
+ VERTEX_ATTRIB_POSITION,
65
+ PBPrimitiveType.I16VEC2,
66
+ 4,
67
+ 'i16',
68
+ 2
69
+ ],
70
+ position_i16x4: [
71
+ VERTEX_ATTRIB_POSITION,
72
+ PBPrimitiveType.I16VEC4,
73
+ 8,
74
+ 'i16',
75
+ 4
76
+ ],
77
+ position_u16normx2: [
78
+ VERTEX_ATTRIB_POSITION,
79
+ PBPrimitiveType.U16VEC2_NORM,
80
+ 4,
81
+ 'u16norm',
82
+ 2
83
+ ],
84
+ position_u16normx4: [
85
+ VERTEX_ATTRIB_POSITION,
86
+ PBPrimitiveType.U16VEC4_NORM,
87
+ 8,
88
+ 'u16norm',
89
+ 4
90
+ ],
91
+ position_i16normx2: [
92
+ VERTEX_ATTRIB_POSITION,
93
+ PBPrimitiveType.I16VEC2_NORM,
94
+ 4,
95
+ 'i16norm',
96
+ 2
97
+ ],
98
+ position_i16normx4: [
99
+ VERTEX_ATTRIB_POSITION,
100
+ PBPrimitiveType.I16VEC4_NORM,
101
+ 8,
102
+ 'i16norm',
103
+ 4
104
+ ],
105
+ position_f16x2: [
106
+ VERTEX_ATTRIB_POSITION,
107
+ PBPrimitiveType.F16VEC2,
108
+ 4,
109
+ 'f16',
110
+ 2
111
+ ],
112
+ position_f16x4: [
113
+ VERTEX_ATTRIB_POSITION,
114
+ PBPrimitiveType.F16VEC4,
115
+ 8,
116
+ 'f16',
117
+ 4
118
+ ],
119
+ position_f32: [
120
+ VERTEX_ATTRIB_POSITION,
121
+ PBPrimitiveType.F32,
122
+ 4,
123
+ 'f32',
124
+ 1
125
+ ],
126
+ position_f32x2: [
127
+ VERTEX_ATTRIB_POSITION,
128
+ PBPrimitiveType.F32VEC2,
129
+ 8,
130
+ 'f32',
131
+ 2
132
+ ],
133
+ position_f32x3: [
134
+ VERTEX_ATTRIB_POSITION,
135
+ PBPrimitiveType.F32VEC3,
136
+ 12,
137
+ 'f32',
138
+ 3
139
+ ],
140
+ position_f32x4: [
141
+ VERTEX_ATTRIB_POSITION,
142
+ PBPrimitiveType.F32VEC4,
143
+ 16,
144
+ 'f32',
145
+ 4
146
+ ],
147
+ position_i32: [
148
+ VERTEX_ATTRIB_POSITION,
149
+ PBPrimitiveType.I32,
150
+ 4,
151
+ 'i32',
152
+ 1
153
+ ],
154
+ position_i32x2: [
155
+ VERTEX_ATTRIB_POSITION,
156
+ PBPrimitiveType.I32VEC2,
157
+ 8,
158
+ 'i32',
159
+ 2
160
+ ],
161
+ position_i32x3: [
162
+ VERTEX_ATTRIB_POSITION,
163
+ PBPrimitiveType.I32VEC3,
164
+ 12,
165
+ 'i32',
166
+ 3
167
+ ],
168
+ position_i32x4: [
169
+ VERTEX_ATTRIB_POSITION,
170
+ PBPrimitiveType.I32VEC4,
171
+ 16,
172
+ 'i32',
173
+ 4
174
+ ],
175
+ position_u32: [
176
+ VERTEX_ATTRIB_POSITION,
177
+ PBPrimitiveType.U32,
178
+ 4,
179
+ 'u32',
180
+ 1
181
+ ],
182
+ position_u32x2: [
183
+ VERTEX_ATTRIB_POSITION,
184
+ PBPrimitiveType.U32VEC2,
185
+ 8,
186
+ 'u32',
187
+ 2
188
+ ],
189
+ position_u32x3: [
190
+ VERTEX_ATTRIB_POSITION,
191
+ PBPrimitiveType.U32VEC3,
192
+ 12,
193
+ 'u32',
194
+ 3
195
+ ],
196
+ position_u32x4: [
197
+ VERTEX_ATTRIB_POSITION,
198
+ PBPrimitiveType.U32VEC4,
199
+ 16,
200
+ 'u32',
201
+ 4
202
+ ],
203
+ normal_f16x4: [
204
+ VERTEX_ATTRIB_NORMAL,
205
+ PBPrimitiveType.F16VEC4,
206
+ 8,
207
+ 'f16',
208
+ 4
209
+ ],
210
+ normal_f32x3: [
211
+ VERTEX_ATTRIB_NORMAL,
212
+ PBPrimitiveType.F32VEC3,
213
+ 12,
214
+ 'f32',
215
+ 3
216
+ ],
217
+ normal_f32x4: [
218
+ VERTEX_ATTRIB_NORMAL,
219
+ PBPrimitiveType.F32VEC4,
220
+ 16,
221
+ 'f32',
222
+ 4
223
+ ],
224
+ diffuse_u8normx4: [
225
+ VERTEX_ATTRIB_DIFFUSE,
226
+ PBPrimitiveType.U8VEC4_NORM,
227
+ 4,
228
+ 'u8norm',
229
+ 4
230
+ ],
231
+ diffuse_u16x4: [
232
+ VERTEX_ATTRIB_DIFFUSE,
233
+ PBPrimitiveType.U16VEC4,
234
+ 8,
235
+ 'u16',
236
+ 4
237
+ ],
238
+ diffuse_u16normx4: [
239
+ VERTEX_ATTRIB_DIFFUSE,
240
+ PBPrimitiveType.U16VEC4_NORM,
241
+ 8,
242
+ 'u16norm',
243
+ 4
244
+ ],
245
+ diffuse_f16x4: [
246
+ VERTEX_ATTRIB_DIFFUSE,
247
+ PBPrimitiveType.F16VEC4,
248
+ 8,
249
+ 'f16',
250
+ 4
251
+ ],
252
+ diffuse_f32x3: [
253
+ VERTEX_ATTRIB_DIFFUSE,
254
+ PBPrimitiveType.F32VEC3,
255
+ 12,
256
+ 'f32',
257
+ 3
258
+ ],
259
+ diffuse_f32x4: [
260
+ VERTEX_ATTRIB_DIFFUSE,
261
+ PBPrimitiveType.F32VEC4,
262
+ 16,
263
+ 'f32',
264
+ 4
265
+ ],
266
+ diffuse_u32x3: [
267
+ VERTEX_ATTRIB_DIFFUSE,
268
+ PBPrimitiveType.U32VEC3,
269
+ 12,
270
+ 'u32',
271
+ 3
272
+ ],
273
+ diffuse_u32x4: [
274
+ VERTEX_ATTRIB_DIFFUSE,
275
+ PBPrimitiveType.U32VEC4,
276
+ 16,
277
+ 'u32',
278
+ 4
279
+ ],
280
+ tangent_f16x4: [
281
+ VERTEX_ATTRIB_TANGENT,
282
+ PBPrimitiveType.F16VEC4,
283
+ 8,
284
+ 'f16',
285
+ 4
286
+ ],
287
+ tangent_f32x3: [
288
+ VERTEX_ATTRIB_TANGENT,
289
+ PBPrimitiveType.F32VEC3,
290
+ 12,
291
+ 'f32',
292
+ 3
293
+ ],
294
+ tangent_f32x4: [
295
+ VERTEX_ATTRIB_TANGENT,
296
+ PBPrimitiveType.F32VEC4,
297
+ 16,
298
+ 'f32',
299
+ 4
300
+ ],
301
+ tex0_u8normx2: [
302
+ VERTEX_ATTRIB_TEXCOORD0,
303
+ PBPrimitiveType.U8VEC2_NORM,
304
+ 2,
305
+ 'u8norm',
306
+ 2
307
+ ],
308
+ tex0_u8normx4: [
309
+ VERTEX_ATTRIB_TEXCOORD0,
310
+ PBPrimitiveType.U8VEC4_NORM,
311
+ 4,
312
+ 'u8norm',
313
+ 4
314
+ ],
315
+ tex0_i8normx2: [
316
+ VERTEX_ATTRIB_TEXCOORD0,
317
+ PBPrimitiveType.I8VEC2_NORM,
318
+ 2,
319
+ 'i8norm',
320
+ 2
321
+ ],
322
+ tex0_i8normx4: [
323
+ VERTEX_ATTRIB_TEXCOORD0,
324
+ PBPrimitiveType.I8VEC4_NORM,
325
+ 4,
326
+ 'i8norm',
327
+ 4
328
+ ],
329
+ tex0_u16x2: [
330
+ VERTEX_ATTRIB_TEXCOORD0,
331
+ PBPrimitiveType.U16VEC2,
332
+ 4,
333
+ 'u16',
334
+ 2
335
+ ],
336
+ tex0_u16x4: [
337
+ VERTEX_ATTRIB_TEXCOORD0,
338
+ PBPrimitiveType.U16VEC4,
339
+ 8,
340
+ 'u16',
341
+ 4
342
+ ],
343
+ tex0_i16x2: [
344
+ VERTEX_ATTRIB_TEXCOORD0,
345
+ PBPrimitiveType.I16VEC2,
346
+ 4,
347
+ 'i16',
348
+ 2
349
+ ],
350
+ tex0_i16x4: [
351
+ VERTEX_ATTRIB_TEXCOORD0,
352
+ PBPrimitiveType.I16VEC4,
353
+ 8,
354
+ 'i16',
355
+ 4
356
+ ],
357
+ tex0_u16normx2: [
358
+ VERTEX_ATTRIB_TEXCOORD0,
359
+ PBPrimitiveType.U16VEC2_NORM,
360
+ 4,
361
+ 'u16norm',
362
+ 2
363
+ ],
364
+ tex0_u16normx4: [
365
+ VERTEX_ATTRIB_TEXCOORD0,
366
+ PBPrimitiveType.U16VEC4_NORM,
367
+ 8,
368
+ 'u16norm',
369
+ 4
370
+ ],
371
+ tex0_i16normx2: [
372
+ VERTEX_ATTRIB_TEXCOORD0,
373
+ PBPrimitiveType.I16VEC2_NORM,
374
+ 4,
375
+ 'i16norm',
376
+ 2
377
+ ],
378
+ tex0_i16normx4: [
379
+ VERTEX_ATTRIB_TEXCOORD0,
380
+ PBPrimitiveType.I16VEC4_NORM,
381
+ 8,
382
+ 'i16norm',
383
+ 4
384
+ ],
385
+ tex0_f16x2: [
386
+ VERTEX_ATTRIB_TEXCOORD0,
387
+ PBPrimitiveType.F16VEC2,
388
+ 4,
389
+ 'f16',
390
+ 2
391
+ ],
392
+ tex0_f16x4: [
393
+ VERTEX_ATTRIB_TEXCOORD0,
394
+ PBPrimitiveType.F16VEC4,
395
+ 8,
396
+ 'f16',
397
+ 4
398
+ ],
399
+ tex0_f32: [
400
+ VERTEX_ATTRIB_TEXCOORD0,
401
+ PBPrimitiveType.F32,
402
+ 4,
403
+ 'f32',
404
+ 1
405
+ ],
406
+ tex0_f32x2: [
407
+ VERTEX_ATTRIB_TEXCOORD0,
408
+ PBPrimitiveType.F32VEC2,
409
+ 8,
410
+ 'f32',
411
+ 2
412
+ ],
413
+ tex0_f32x3: [
414
+ VERTEX_ATTRIB_TEXCOORD0,
415
+ PBPrimitiveType.F32VEC3,
416
+ 12,
417
+ 'f32',
418
+ 3
419
+ ],
420
+ tex0_f32x4: [
421
+ VERTEX_ATTRIB_TEXCOORD0,
422
+ PBPrimitiveType.F32VEC4,
423
+ 16,
424
+ 'f32',
425
+ 4
426
+ ],
427
+ tex0_i32: [
428
+ VERTEX_ATTRIB_TEXCOORD0,
429
+ PBPrimitiveType.I32,
430
+ 4,
431
+ 'i32',
432
+ 1
433
+ ],
434
+ tex0_i32x2: [
435
+ VERTEX_ATTRIB_TEXCOORD0,
436
+ PBPrimitiveType.I32VEC2,
437
+ 8,
438
+ 'i32',
439
+ 2
440
+ ],
441
+ tex0_i32x3: [
442
+ VERTEX_ATTRIB_TEXCOORD0,
443
+ PBPrimitiveType.I32VEC3,
444
+ 12,
445
+ 'i32',
446
+ 3
447
+ ],
448
+ tex0_i32x4: [
449
+ VERTEX_ATTRIB_TEXCOORD0,
450
+ PBPrimitiveType.I32VEC4,
451
+ 16,
452
+ 'i32',
453
+ 4
454
+ ],
455
+ tex0_u32: [
456
+ VERTEX_ATTRIB_TEXCOORD0,
457
+ PBPrimitiveType.U32,
458
+ 4,
459
+ 'u32',
460
+ 1
461
+ ],
462
+ tex0_u32x2: [
463
+ VERTEX_ATTRIB_TEXCOORD0,
464
+ PBPrimitiveType.U32VEC2,
465
+ 8,
466
+ 'u32',
467
+ 2
468
+ ],
469
+ tex0_u32x3: [
470
+ VERTEX_ATTRIB_TEXCOORD0,
471
+ PBPrimitiveType.U32VEC3,
472
+ 12,
473
+ 'u32',
474
+ 3
475
+ ],
476
+ tex0_u32x4: [
477
+ VERTEX_ATTRIB_TEXCOORD0,
478
+ PBPrimitiveType.U32VEC4,
479
+ 16,
480
+ 'u32',
481
+ 4
482
+ ],
483
+ tex1_u8normx2: [
484
+ VERTEX_ATTRIB_TEXCOORD1,
485
+ PBPrimitiveType.U8VEC2_NORM,
486
+ 2,
487
+ 'u8norm',
488
+ 2
489
+ ],
490
+ tex1_u8normx4: [
491
+ VERTEX_ATTRIB_TEXCOORD1,
492
+ PBPrimitiveType.U8VEC4_NORM,
493
+ 4,
494
+ 'u8norm',
495
+ 4
496
+ ],
497
+ tex1_i8normx2: [
498
+ VERTEX_ATTRIB_TEXCOORD1,
499
+ PBPrimitiveType.I8VEC2_NORM,
500
+ 2,
501
+ 'i8norm',
502
+ 2
503
+ ],
504
+ tex1_i8normx4: [
505
+ VERTEX_ATTRIB_TEXCOORD1,
506
+ PBPrimitiveType.I8VEC4_NORM,
507
+ 4,
508
+ 'i8norm',
509
+ 4
510
+ ],
511
+ tex1_u16x2: [
512
+ VERTEX_ATTRIB_TEXCOORD1,
513
+ PBPrimitiveType.U16VEC2,
514
+ 4,
515
+ 'u16',
516
+ 2
517
+ ],
518
+ tex1_u16x4: [
519
+ VERTEX_ATTRIB_TEXCOORD1,
520
+ PBPrimitiveType.U16VEC4,
521
+ 8,
522
+ 'u16',
523
+ 4
524
+ ],
525
+ tex1_i16x2: [
526
+ VERTEX_ATTRIB_TEXCOORD1,
527
+ PBPrimitiveType.I16VEC2,
528
+ 4,
529
+ 'i16',
530
+ 2
531
+ ],
532
+ tex1_i16x4: [
533
+ VERTEX_ATTRIB_TEXCOORD1,
534
+ PBPrimitiveType.I16VEC4,
535
+ 8,
536
+ 'i16',
537
+ 4
538
+ ],
539
+ tex1_u16normx2: [
540
+ VERTEX_ATTRIB_TEXCOORD1,
541
+ PBPrimitiveType.U16VEC2_NORM,
542
+ 4,
543
+ 'u16norm',
544
+ 2
545
+ ],
546
+ tex1_u16normx4: [
547
+ VERTEX_ATTRIB_TEXCOORD1,
548
+ PBPrimitiveType.U16VEC4_NORM,
549
+ 8,
550
+ 'u16norm',
551
+ 4
552
+ ],
553
+ tex1_i16normx2: [
554
+ VERTEX_ATTRIB_TEXCOORD1,
555
+ PBPrimitiveType.I16VEC2_NORM,
556
+ 4,
557
+ 'i16norm',
558
+ 2
559
+ ],
560
+ tex1_i16normx4: [
561
+ VERTEX_ATTRIB_TEXCOORD1,
562
+ PBPrimitiveType.I16VEC4_NORM,
563
+ 8,
564
+ 'i16norm',
565
+ 4
566
+ ],
567
+ tex1_f16x2: [
568
+ VERTEX_ATTRIB_TEXCOORD1,
569
+ PBPrimitiveType.F16VEC2,
570
+ 4,
571
+ 'f16',
572
+ 2
573
+ ],
574
+ tex1_f16x4: [
575
+ VERTEX_ATTRIB_TEXCOORD1,
576
+ PBPrimitiveType.F16VEC4,
577
+ 8,
578
+ 'f16',
579
+ 4
580
+ ],
581
+ tex1_f32: [
582
+ VERTEX_ATTRIB_TEXCOORD1,
583
+ PBPrimitiveType.F32,
584
+ 4,
585
+ 'f32',
586
+ 1
587
+ ],
588
+ tex1_f32x2: [
589
+ VERTEX_ATTRIB_TEXCOORD1,
590
+ PBPrimitiveType.F32VEC2,
591
+ 8,
592
+ 'f32',
593
+ 2
594
+ ],
595
+ tex1_f32x3: [
596
+ VERTEX_ATTRIB_TEXCOORD1,
597
+ PBPrimitiveType.F32VEC3,
598
+ 12,
599
+ 'f32',
600
+ 3
601
+ ],
602
+ tex1_f32x4: [
603
+ VERTEX_ATTRIB_TEXCOORD1,
604
+ PBPrimitiveType.F32VEC4,
605
+ 16,
606
+ 'f32',
607
+ 4
608
+ ],
609
+ tex1_i32: [
610
+ VERTEX_ATTRIB_TEXCOORD1,
611
+ PBPrimitiveType.I32,
612
+ 4,
613
+ 'i32',
614
+ 1
615
+ ],
616
+ tex1_i32x2: [
617
+ VERTEX_ATTRIB_TEXCOORD1,
618
+ PBPrimitiveType.I32VEC2,
619
+ 8,
620
+ 'i32',
621
+ 2
622
+ ],
623
+ tex1_i32x3: [
624
+ VERTEX_ATTRIB_TEXCOORD1,
625
+ PBPrimitiveType.I32VEC3,
626
+ 12,
627
+ 'i32',
628
+ 3
629
+ ],
630
+ tex1_i32x4: [
631
+ VERTEX_ATTRIB_TEXCOORD1,
632
+ PBPrimitiveType.I32VEC4,
633
+ 16,
634
+ 'i32',
635
+ 4
636
+ ],
637
+ tex1_u32: [
638
+ VERTEX_ATTRIB_TEXCOORD1,
639
+ PBPrimitiveType.U32,
640
+ 4,
641
+ 'u32',
642
+ 1
643
+ ],
644
+ tex1_u32x2: [
645
+ VERTEX_ATTRIB_TEXCOORD1,
646
+ PBPrimitiveType.U32VEC2,
647
+ 8,
648
+ 'u32',
649
+ 2
650
+ ],
651
+ tex1_u32x3: [
652
+ VERTEX_ATTRIB_TEXCOORD1,
653
+ PBPrimitiveType.U32VEC3,
654
+ 12,
655
+ 'u32',
656
+ 3
657
+ ],
658
+ tex1_u32x4: [
659
+ VERTEX_ATTRIB_TEXCOORD1,
660
+ PBPrimitiveType.U32VEC4,
661
+ 16,
662
+ 'u32',
663
+ 4
664
+ ],
665
+ tex2_u8normx2: [
666
+ VERTEX_ATTRIB_TEXCOORD2,
667
+ PBPrimitiveType.U8VEC2_NORM,
668
+ 2,
669
+ 'u8norm',
670
+ 2
671
+ ],
672
+ tex2_u8normx4: [
673
+ VERTEX_ATTRIB_TEXCOORD2,
674
+ PBPrimitiveType.U8VEC4_NORM,
675
+ 4,
676
+ 'u8norm',
677
+ 4
678
+ ],
679
+ tex2_i8normx2: [
680
+ VERTEX_ATTRIB_TEXCOORD2,
681
+ PBPrimitiveType.I8VEC2_NORM,
682
+ 2,
683
+ 'i8norm',
684
+ 2
685
+ ],
686
+ tex2_i8normx4: [
687
+ VERTEX_ATTRIB_TEXCOORD2,
688
+ PBPrimitiveType.I8VEC4_NORM,
689
+ 4,
690
+ 'i8norm',
691
+ 4
692
+ ],
693
+ tex2_u16x2: [
694
+ VERTEX_ATTRIB_TEXCOORD2,
695
+ PBPrimitiveType.U16VEC2,
696
+ 4,
697
+ 'u16',
698
+ 2
699
+ ],
700
+ tex2_u16x4: [
701
+ VERTEX_ATTRIB_TEXCOORD2,
702
+ PBPrimitiveType.U16VEC4,
703
+ 8,
704
+ 'u16',
705
+ 4
706
+ ],
707
+ tex2_i16x2: [
708
+ VERTEX_ATTRIB_TEXCOORD2,
709
+ PBPrimitiveType.I16VEC2,
710
+ 4,
711
+ 'i16',
712
+ 2
713
+ ],
714
+ tex2_i16x4: [
715
+ VERTEX_ATTRIB_TEXCOORD2,
716
+ PBPrimitiveType.I16VEC4,
717
+ 8,
718
+ 'i16',
719
+ 4
720
+ ],
721
+ tex2_u16normx2: [
722
+ VERTEX_ATTRIB_TEXCOORD2,
723
+ PBPrimitiveType.U16VEC2_NORM,
724
+ 4,
725
+ 'u16norm',
726
+ 2
727
+ ],
728
+ tex2_u16normx4: [
729
+ VERTEX_ATTRIB_TEXCOORD2,
730
+ PBPrimitiveType.U16VEC4_NORM,
731
+ 8,
732
+ 'u16norm',
733
+ 4
734
+ ],
735
+ tex2_i16normx2: [
736
+ VERTEX_ATTRIB_TEXCOORD2,
737
+ PBPrimitiveType.I16VEC2_NORM,
738
+ 4,
739
+ 'i16norm',
740
+ 2
741
+ ],
742
+ tex2_i16normx4: [
743
+ VERTEX_ATTRIB_TEXCOORD2,
744
+ PBPrimitiveType.I16VEC4_NORM,
745
+ 8,
746
+ 'i16norm',
747
+ 4
748
+ ],
749
+ tex2_f16x2: [
750
+ VERTEX_ATTRIB_TEXCOORD2,
751
+ PBPrimitiveType.F16VEC2,
752
+ 4,
753
+ 'f16',
754
+ 2
755
+ ],
756
+ tex2_f16x4: [
757
+ VERTEX_ATTRIB_TEXCOORD2,
758
+ PBPrimitiveType.F16VEC4,
759
+ 8,
760
+ 'f16',
761
+ 4
762
+ ],
763
+ tex2_f32: [
764
+ VERTEX_ATTRIB_TEXCOORD2,
765
+ PBPrimitiveType.F32,
766
+ 4,
767
+ 'f32',
768
+ 1
769
+ ],
770
+ tex2_f32x2: [
771
+ VERTEX_ATTRIB_TEXCOORD2,
772
+ PBPrimitiveType.F32VEC2,
773
+ 8,
774
+ 'f32',
775
+ 2
776
+ ],
777
+ tex2_f32x3: [
778
+ VERTEX_ATTRIB_TEXCOORD2,
779
+ PBPrimitiveType.F32VEC3,
780
+ 12,
781
+ 'f32',
782
+ 3
783
+ ],
784
+ tex2_f32x4: [
785
+ VERTEX_ATTRIB_TEXCOORD2,
786
+ PBPrimitiveType.F32VEC4,
787
+ 16,
788
+ 'f32',
789
+ 4
790
+ ],
791
+ tex2_i32: [
792
+ VERTEX_ATTRIB_TEXCOORD2,
793
+ PBPrimitiveType.I32,
794
+ 4,
795
+ 'i32',
796
+ 1
797
+ ],
798
+ tex2_i32x2: [
799
+ VERTEX_ATTRIB_TEXCOORD2,
800
+ PBPrimitiveType.I32VEC2,
801
+ 8,
802
+ 'i32',
803
+ 2
804
+ ],
805
+ tex2_i32x3: [
806
+ VERTEX_ATTRIB_TEXCOORD2,
807
+ PBPrimitiveType.I32VEC3,
808
+ 12,
809
+ 'i32',
810
+ 3
811
+ ],
812
+ tex2_i32x4: [
813
+ VERTEX_ATTRIB_TEXCOORD2,
814
+ PBPrimitiveType.I32VEC4,
815
+ 16,
816
+ 'i32',
817
+ 4
818
+ ],
819
+ tex2_u32: [
820
+ VERTEX_ATTRIB_TEXCOORD2,
821
+ PBPrimitiveType.U32,
822
+ 4,
823
+ 'u32',
824
+ 1
825
+ ],
826
+ tex2_u32x2: [
827
+ VERTEX_ATTRIB_TEXCOORD2,
828
+ PBPrimitiveType.U32VEC2,
829
+ 8,
830
+ 'u32',
831
+ 2
832
+ ],
833
+ tex2_u32x3: [
834
+ VERTEX_ATTRIB_TEXCOORD2,
835
+ PBPrimitiveType.U32VEC3,
836
+ 12,
837
+ 'u32',
838
+ 3
839
+ ],
840
+ tex2_u32x4: [
841
+ VERTEX_ATTRIB_TEXCOORD2,
842
+ PBPrimitiveType.U32VEC4,
843
+ 16,
844
+ 'u32',
845
+ 4
846
+ ],
847
+ tex3_u8normx2: [
848
+ VERTEX_ATTRIB_TEXCOORD3,
849
+ PBPrimitiveType.U8VEC2_NORM,
850
+ 2,
851
+ 'u8norm',
852
+ 2
853
+ ],
854
+ tex3_u8normx4: [
855
+ VERTEX_ATTRIB_TEXCOORD3,
856
+ PBPrimitiveType.U8VEC4_NORM,
857
+ 4,
858
+ 'u8norm',
859
+ 4
860
+ ],
861
+ tex3_i8normx2: [
862
+ VERTEX_ATTRIB_TEXCOORD3,
863
+ PBPrimitiveType.I8VEC2_NORM,
864
+ 2,
865
+ 'i8norm',
866
+ 2
867
+ ],
868
+ tex3_i8normx4: [
869
+ VERTEX_ATTRIB_TEXCOORD3,
870
+ PBPrimitiveType.I8VEC4_NORM,
871
+ 4,
872
+ 'i8norm',
873
+ 4
874
+ ],
875
+ tex3_u16x2: [
876
+ VERTEX_ATTRIB_TEXCOORD3,
877
+ PBPrimitiveType.U16VEC2,
878
+ 4,
879
+ 'u16',
880
+ 2
881
+ ],
882
+ tex3_u16x4: [
883
+ VERTEX_ATTRIB_TEXCOORD3,
884
+ PBPrimitiveType.U16VEC4,
885
+ 8,
886
+ 'u16',
887
+ 4
888
+ ],
889
+ tex3_i16x2: [
890
+ VERTEX_ATTRIB_TEXCOORD3,
891
+ PBPrimitiveType.I16VEC2,
892
+ 4,
893
+ 'i16',
894
+ 2
895
+ ],
896
+ tex3_i16x4: [
897
+ VERTEX_ATTRIB_TEXCOORD3,
898
+ PBPrimitiveType.I16VEC4,
899
+ 8,
900
+ 'i16',
901
+ 4
902
+ ],
903
+ tex3_u16normx2: [
904
+ VERTEX_ATTRIB_TEXCOORD3,
905
+ PBPrimitiveType.U16VEC2_NORM,
906
+ 4,
907
+ 'u16norm',
908
+ 2
909
+ ],
910
+ tex3_u16normx4: [
911
+ VERTEX_ATTRIB_TEXCOORD3,
912
+ PBPrimitiveType.U16VEC4_NORM,
913
+ 8,
914
+ 'u16norm',
915
+ 4
916
+ ],
917
+ tex3_i16normx2: [
918
+ VERTEX_ATTRIB_TEXCOORD3,
919
+ PBPrimitiveType.I16VEC2_NORM,
920
+ 4,
921
+ 'i16norm',
922
+ 2
923
+ ],
924
+ tex3_i16normx4: [
925
+ VERTEX_ATTRIB_TEXCOORD3,
926
+ PBPrimitiveType.I16VEC4_NORM,
927
+ 8,
928
+ 'i16norm',
929
+ 4
930
+ ],
931
+ tex3_f16x2: [
932
+ VERTEX_ATTRIB_TEXCOORD3,
933
+ PBPrimitiveType.F16VEC2,
934
+ 4,
935
+ 'f16',
936
+ 2
937
+ ],
938
+ tex3_f16x4: [
939
+ VERTEX_ATTRIB_TEXCOORD3,
940
+ PBPrimitiveType.F16VEC4,
941
+ 8,
942
+ 'f16',
943
+ 4
944
+ ],
945
+ tex3_f32: [
946
+ VERTEX_ATTRIB_TEXCOORD3,
947
+ PBPrimitiveType.F32,
948
+ 4,
949
+ 'f32',
950
+ 1
951
+ ],
952
+ tex3_f32x2: [
953
+ VERTEX_ATTRIB_TEXCOORD3,
954
+ PBPrimitiveType.F32VEC2,
955
+ 8,
956
+ 'f32',
957
+ 2
958
+ ],
959
+ tex3_f32x3: [
960
+ VERTEX_ATTRIB_TEXCOORD3,
961
+ PBPrimitiveType.F32VEC3,
962
+ 12,
963
+ 'f32',
964
+ 3
965
+ ],
966
+ tex3_f32x4: [
967
+ VERTEX_ATTRIB_TEXCOORD3,
968
+ PBPrimitiveType.F32VEC4,
969
+ 16,
970
+ 'f32',
971
+ 4
972
+ ],
973
+ tex3_i32: [
974
+ VERTEX_ATTRIB_TEXCOORD3,
975
+ PBPrimitiveType.I32,
976
+ 4,
977
+ 'i32',
978
+ 1
979
+ ],
980
+ tex3_i32x2: [
981
+ VERTEX_ATTRIB_TEXCOORD3,
982
+ PBPrimitiveType.I32VEC2,
983
+ 8,
984
+ 'i32',
985
+ 2
986
+ ],
987
+ tex3_i32x3: [
988
+ VERTEX_ATTRIB_TEXCOORD3,
989
+ PBPrimitiveType.I32VEC3,
990
+ 12,
991
+ 'i32',
992
+ 3
993
+ ],
994
+ tex3_i32x4: [
995
+ VERTEX_ATTRIB_TEXCOORD3,
996
+ PBPrimitiveType.I32VEC4,
997
+ 16,
998
+ 'i32',
999
+ 4
1000
+ ],
1001
+ tex3_u32: [
1002
+ VERTEX_ATTRIB_TEXCOORD3,
1003
+ PBPrimitiveType.U32,
1004
+ 4,
1005
+ 'u32',
1006
+ 1
1007
+ ],
1008
+ tex3_u32x2: [
1009
+ VERTEX_ATTRIB_TEXCOORD3,
1010
+ PBPrimitiveType.U32VEC2,
1011
+ 8,
1012
+ 'u32',
1013
+ 2
1014
+ ],
1015
+ tex3_u32x3: [
1016
+ VERTEX_ATTRIB_TEXCOORD3,
1017
+ PBPrimitiveType.U32VEC3,
1018
+ 12,
1019
+ 'u32',
1020
+ 3
1021
+ ],
1022
+ tex3_u32x4: [
1023
+ VERTEX_ATTRIB_TEXCOORD3,
1024
+ PBPrimitiveType.U32VEC4,
1025
+ 16,
1026
+ 'u32',
1027
+ 4
1028
+ ],
1029
+ tex4_u8normx2: [
1030
+ VERTEX_ATTRIB_TEXCOORD4,
1031
+ PBPrimitiveType.U8VEC2_NORM,
1032
+ 2,
1033
+ 'u8norm',
1034
+ 2
1035
+ ],
1036
+ tex4_u8normx4: [
1037
+ VERTEX_ATTRIB_TEXCOORD4,
1038
+ PBPrimitiveType.U8VEC4_NORM,
1039
+ 4,
1040
+ 'u8norm',
1041
+ 4
1042
+ ],
1043
+ tex4_i8normx2: [
1044
+ VERTEX_ATTRIB_TEXCOORD4,
1045
+ PBPrimitiveType.I8VEC2_NORM,
1046
+ 2,
1047
+ 'i8norm',
1048
+ 2
1049
+ ],
1050
+ tex4_i8normx4: [
1051
+ VERTEX_ATTRIB_TEXCOORD4,
1052
+ PBPrimitiveType.I8VEC4_NORM,
1053
+ 4,
1054
+ 'i8norm',
1055
+ 4
1056
+ ],
1057
+ tex4_u16x2: [
1058
+ VERTEX_ATTRIB_TEXCOORD4,
1059
+ PBPrimitiveType.U16VEC2,
1060
+ 4,
1061
+ 'u16',
1062
+ 2
1063
+ ],
1064
+ tex4_u16x4: [
1065
+ VERTEX_ATTRIB_TEXCOORD4,
1066
+ PBPrimitiveType.U16VEC4,
1067
+ 8,
1068
+ 'u16',
1069
+ 4
1070
+ ],
1071
+ tex4_i16x2: [
1072
+ VERTEX_ATTRIB_TEXCOORD4,
1073
+ PBPrimitiveType.I16VEC2,
1074
+ 4,
1075
+ 'i16',
1076
+ 2
1077
+ ],
1078
+ tex4_i16x4: [
1079
+ VERTEX_ATTRIB_TEXCOORD4,
1080
+ PBPrimitiveType.I16VEC4,
1081
+ 8,
1082
+ 'i16',
1083
+ 4
1084
+ ],
1085
+ tex4_u16normx2: [
1086
+ VERTEX_ATTRIB_TEXCOORD4,
1087
+ PBPrimitiveType.U16VEC2_NORM,
1088
+ 4,
1089
+ 'u16norm',
1090
+ 2
1091
+ ],
1092
+ tex4_u16normx4: [
1093
+ VERTEX_ATTRIB_TEXCOORD4,
1094
+ PBPrimitiveType.U16VEC4_NORM,
1095
+ 8,
1096
+ 'u16norm',
1097
+ 4
1098
+ ],
1099
+ tex4_i16normx2: [
1100
+ VERTEX_ATTRIB_TEXCOORD4,
1101
+ PBPrimitiveType.I16VEC2_NORM,
1102
+ 4,
1103
+ 'i16norm',
1104
+ 2
1105
+ ],
1106
+ tex4_i16normx4: [
1107
+ VERTEX_ATTRIB_TEXCOORD4,
1108
+ PBPrimitiveType.I16VEC4_NORM,
1109
+ 8,
1110
+ 'i16norm',
1111
+ 4
1112
+ ],
1113
+ tex4_f16x2: [
1114
+ VERTEX_ATTRIB_TEXCOORD4,
1115
+ PBPrimitiveType.F16VEC2,
1116
+ 4,
1117
+ 'f16',
1118
+ 2
1119
+ ],
1120
+ tex4_f16x4: [
1121
+ VERTEX_ATTRIB_TEXCOORD4,
1122
+ PBPrimitiveType.F16VEC4,
1123
+ 8,
1124
+ 'f16',
1125
+ 4
1126
+ ],
1127
+ tex4_f32: [
1128
+ VERTEX_ATTRIB_TEXCOORD4,
1129
+ PBPrimitiveType.F32,
1130
+ 4,
1131
+ 'f32',
1132
+ 1
1133
+ ],
1134
+ tex4_f32x2: [
1135
+ VERTEX_ATTRIB_TEXCOORD4,
1136
+ PBPrimitiveType.F32VEC2,
1137
+ 8,
1138
+ 'f32',
1139
+ 2
1140
+ ],
1141
+ tex4_f32x3: [
1142
+ VERTEX_ATTRIB_TEXCOORD4,
1143
+ PBPrimitiveType.F32VEC3,
1144
+ 12,
1145
+ 'f32',
1146
+ 3
1147
+ ],
1148
+ tex4_f32x4: [
1149
+ VERTEX_ATTRIB_TEXCOORD4,
1150
+ PBPrimitiveType.F32VEC4,
1151
+ 16,
1152
+ 'f32',
1153
+ 4
1154
+ ],
1155
+ tex4_i32: [
1156
+ VERTEX_ATTRIB_TEXCOORD4,
1157
+ PBPrimitiveType.I32,
1158
+ 4,
1159
+ 'i32',
1160
+ 1
1161
+ ],
1162
+ tex4_i32x2: [
1163
+ VERTEX_ATTRIB_TEXCOORD4,
1164
+ PBPrimitiveType.I32VEC2,
1165
+ 8,
1166
+ 'i32',
1167
+ 2
1168
+ ],
1169
+ tex4_i32x3: [
1170
+ VERTEX_ATTRIB_TEXCOORD4,
1171
+ PBPrimitiveType.I32VEC3,
1172
+ 12,
1173
+ 'i32',
1174
+ 3
1175
+ ],
1176
+ tex4_i32x4: [
1177
+ VERTEX_ATTRIB_TEXCOORD4,
1178
+ PBPrimitiveType.I32VEC4,
1179
+ 16,
1180
+ 'i32',
1181
+ 4
1182
+ ],
1183
+ tex4_u32: [
1184
+ VERTEX_ATTRIB_TEXCOORD4,
1185
+ PBPrimitiveType.U32,
1186
+ 4,
1187
+ 'u32',
1188
+ 1
1189
+ ],
1190
+ tex4_u32x2: [
1191
+ VERTEX_ATTRIB_TEXCOORD4,
1192
+ PBPrimitiveType.U32VEC2,
1193
+ 8,
1194
+ 'u32',
1195
+ 2
1196
+ ],
1197
+ tex4_u32x3: [
1198
+ VERTEX_ATTRIB_TEXCOORD4,
1199
+ PBPrimitiveType.U32VEC3,
1200
+ 12,
1201
+ 'u32',
1202
+ 3
1203
+ ],
1204
+ tex4_u32x4: [
1205
+ VERTEX_ATTRIB_TEXCOORD4,
1206
+ PBPrimitiveType.U32VEC4,
1207
+ 16,
1208
+ 'u32',
1209
+ 4
1210
+ ],
1211
+ tex5_u8normx2: [
1212
+ VERTEX_ATTRIB_TEXCOORD5,
1213
+ PBPrimitiveType.U8VEC2_NORM,
1214
+ 2,
1215
+ 'u8norm',
1216
+ 2
1217
+ ],
1218
+ tex5_u8normx4: [
1219
+ VERTEX_ATTRIB_TEXCOORD5,
1220
+ PBPrimitiveType.U8VEC4_NORM,
1221
+ 4,
1222
+ 'u8norm',
1223
+ 4
1224
+ ],
1225
+ tex5_i8normx2: [
1226
+ VERTEX_ATTRIB_TEXCOORD5,
1227
+ PBPrimitiveType.I8VEC2_NORM,
1228
+ 2,
1229
+ 'i8norm',
1230
+ 2
1231
+ ],
1232
+ tex5_i8normx4: [
1233
+ VERTEX_ATTRIB_TEXCOORD5,
1234
+ PBPrimitiveType.I8VEC4_NORM,
1235
+ 4,
1236
+ 'i8norm',
1237
+ 4
1238
+ ],
1239
+ tex5_u16x2: [
1240
+ VERTEX_ATTRIB_TEXCOORD5,
1241
+ PBPrimitiveType.U16VEC2,
1242
+ 4,
1243
+ 'u16',
1244
+ 2
1245
+ ],
1246
+ tex5_u16x4: [
1247
+ VERTEX_ATTRIB_TEXCOORD5,
1248
+ PBPrimitiveType.U16VEC4,
1249
+ 8,
1250
+ 'u16',
1251
+ 4
1252
+ ],
1253
+ tex5_i16x2: [
1254
+ VERTEX_ATTRIB_TEXCOORD5,
1255
+ PBPrimitiveType.I16VEC2,
1256
+ 4,
1257
+ 'i16',
1258
+ 2
1259
+ ],
1260
+ tex5_i16x4: [
1261
+ VERTEX_ATTRIB_TEXCOORD5,
1262
+ PBPrimitiveType.I16VEC4,
1263
+ 8,
1264
+ 'i16',
1265
+ 4
1266
+ ],
1267
+ tex5_u16normx2: [
1268
+ VERTEX_ATTRIB_TEXCOORD5,
1269
+ PBPrimitiveType.U16VEC2_NORM,
1270
+ 4,
1271
+ 'u16norm',
1272
+ 2
1273
+ ],
1274
+ tex5_u16normx4: [
1275
+ VERTEX_ATTRIB_TEXCOORD5,
1276
+ PBPrimitiveType.U16VEC4_NORM,
1277
+ 8,
1278
+ 'u16norm',
1279
+ 4
1280
+ ],
1281
+ tex5_i16normx2: [
1282
+ VERTEX_ATTRIB_TEXCOORD5,
1283
+ PBPrimitiveType.I16VEC2_NORM,
1284
+ 4,
1285
+ 'i16norm',
1286
+ 2
1287
+ ],
1288
+ tex5_i16normx4: [
1289
+ VERTEX_ATTRIB_TEXCOORD5,
1290
+ PBPrimitiveType.I16VEC4_NORM,
1291
+ 8,
1292
+ 'i16norm',
1293
+ 4
1294
+ ],
1295
+ tex5_f16x2: [
1296
+ VERTEX_ATTRIB_TEXCOORD5,
1297
+ PBPrimitiveType.F16VEC2,
1298
+ 4,
1299
+ 'f16',
1300
+ 2
1301
+ ],
1302
+ tex5_f16x4: [
1303
+ VERTEX_ATTRIB_TEXCOORD5,
1304
+ PBPrimitiveType.F16VEC4,
1305
+ 8,
1306
+ 'f16',
1307
+ 4
1308
+ ],
1309
+ tex5_f32: [
1310
+ VERTEX_ATTRIB_TEXCOORD5,
1311
+ PBPrimitiveType.F32,
1312
+ 4,
1313
+ 'f32',
1314
+ 1
1315
+ ],
1316
+ tex5_f32x2: [
1317
+ VERTEX_ATTRIB_TEXCOORD5,
1318
+ PBPrimitiveType.F32VEC2,
1319
+ 8,
1320
+ 'f32',
1321
+ 2
1322
+ ],
1323
+ tex5_f32x3: [
1324
+ VERTEX_ATTRIB_TEXCOORD5,
1325
+ PBPrimitiveType.F32VEC3,
1326
+ 12,
1327
+ 'f32',
1328
+ 3
1329
+ ],
1330
+ tex5_f32x4: [
1331
+ VERTEX_ATTRIB_TEXCOORD5,
1332
+ PBPrimitiveType.F32VEC4,
1333
+ 16,
1334
+ 'f32',
1335
+ 4
1336
+ ],
1337
+ tex5_i32: [
1338
+ VERTEX_ATTRIB_TEXCOORD5,
1339
+ PBPrimitiveType.I32,
1340
+ 4,
1341
+ 'i32',
1342
+ 1
1343
+ ],
1344
+ tex5_i32x2: [
1345
+ VERTEX_ATTRIB_TEXCOORD5,
1346
+ PBPrimitiveType.I32VEC2,
1347
+ 8,
1348
+ 'i32',
1349
+ 2
1350
+ ],
1351
+ tex5_i32x3: [
1352
+ VERTEX_ATTRIB_TEXCOORD5,
1353
+ PBPrimitiveType.I32VEC3,
1354
+ 12,
1355
+ 'i32',
1356
+ 3
1357
+ ],
1358
+ tex5_i32x4: [
1359
+ VERTEX_ATTRIB_TEXCOORD5,
1360
+ PBPrimitiveType.I32VEC4,
1361
+ 16,
1362
+ 'i32',
1363
+ 4
1364
+ ],
1365
+ tex5_u32: [
1366
+ VERTEX_ATTRIB_TEXCOORD5,
1367
+ PBPrimitiveType.U32,
1368
+ 4,
1369
+ 'u32',
1370
+ 1
1371
+ ],
1372
+ tex5_u32x2: [
1373
+ VERTEX_ATTRIB_TEXCOORD5,
1374
+ PBPrimitiveType.U32VEC2,
1375
+ 8,
1376
+ 'u32',
1377
+ 2
1378
+ ],
1379
+ tex5_u32x3: [
1380
+ VERTEX_ATTRIB_TEXCOORD5,
1381
+ PBPrimitiveType.U32VEC3,
1382
+ 12,
1383
+ 'u32',
1384
+ 3
1385
+ ],
1386
+ tex5_u32x4: [
1387
+ VERTEX_ATTRIB_TEXCOORD5,
1388
+ PBPrimitiveType.U32VEC4,
1389
+ 16,
1390
+ 'u32',
1391
+ 4
1392
+ ],
1393
+ tex6_u8normx2: [
1394
+ VERTEX_ATTRIB_TEXCOORD6,
1395
+ PBPrimitiveType.U8VEC2_NORM,
1396
+ 2,
1397
+ 'u8norm',
1398
+ 2
1399
+ ],
1400
+ tex6_u8normx4: [
1401
+ VERTEX_ATTRIB_TEXCOORD6,
1402
+ PBPrimitiveType.U8VEC4_NORM,
1403
+ 4,
1404
+ 'u8norm',
1405
+ 4
1406
+ ],
1407
+ tex6_i8normx2: [
1408
+ VERTEX_ATTRIB_TEXCOORD6,
1409
+ PBPrimitiveType.I8VEC2_NORM,
1410
+ 2,
1411
+ 'i8norm',
1412
+ 2
1413
+ ],
1414
+ tex6_i8normx4: [
1415
+ VERTEX_ATTRIB_TEXCOORD6,
1416
+ PBPrimitiveType.I8VEC4_NORM,
1417
+ 4,
1418
+ 'i8norm',
1419
+ 4
1420
+ ],
1421
+ tex6_u16x2: [
1422
+ VERTEX_ATTRIB_TEXCOORD6,
1423
+ PBPrimitiveType.U16VEC2,
1424
+ 4,
1425
+ 'u16',
1426
+ 2
1427
+ ],
1428
+ tex6_u16x4: [
1429
+ VERTEX_ATTRIB_TEXCOORD6,
1430
+ PBPrimitiveType.U16VEC4,
1431
+ 8,
1432
+ 'u16',
1433
+ 4
1434
+ ],
1435
+ tex6_i16x2: [
1436
+ VERTEX_ATTRIB_TEXCOORD6,
1437
+ PBPrimitiveType.I16VEC2,
1438
+ 4,
1439
+ 'i16',
1440
+ 2
1441
+ ],
1442
+ tex6_i16x4: [
1443
+ VERTEX_ATTRIB_TEXCOORD6,
1444
+ PBPrimitiveType.I16VEC4,
1445
+ 8,
1446
+ 'i16',
1447
+ 4
1448
+ ],
1449
+ tex6_u16normx2: [
1450
+ VERTEX_ATTRIB_TEXCOORD6,
1451
+ PBPrimitiveType.U16VEC2_NORM,
1452
+ 4,
1453
+ 'u16norm',
1454
+ 2
1455
+ ],
1456
+ tex6_u16normx4: [
1457
+ VERTEX_ATTRIB_TEXCOORD6,
1458
+ PBPrimitiveType.U16VEC4_NORM,
1459
+ 8,
1460
+ 'u16norm',
1461
+ 4
1462
+ ],
1463
+ tex6_i16normx2: [
1464
+ VERTEX_ATTRIB_TEXCOORD6,
1465
+ PBPrimitiveType.I16VEC2_NORM,
1466
+ 4,
1467
+ 'i16norm',
1468
+ 2
1469
+ ],
1470
+ tex6_i16normx4: [
1471
+ VERTEX_ATTRIB_TEXCOORD6,
1472
+ PBPrimitiveType.I16VEC4_NORM,
1473
+ 8,
1474
+ 'i16norm',
1475
+ 4
1476
+ ],
1477
+ tex6_f16x2: [
1478
+ VERTEX_ATTRIB_TEXCOORD6,
1479
+ PBPrimitiveType.F16VEC2,
1480
+ 4,
1481
+ 'f16',
1482
+ 2
1483
+ ],
1484
+ tex6_f16x4: [
1485
+ VERTEX_ATTRIB_TEXCOORD6,
1486
+ PBPrimitiveType.F16VEC4,
1487
+ 8,
1488
+ 'f16',
1489
+ 4
1490
+ ],
1491
+ tex6_f32: [
1492
+ VERTEX_ATTRIB_TEXCOORD6,
1493
+ PBPrimitiveType.F32,
1494
+ 4,
1495
+ 'f32',
1496
+ 1
1497
+ ],
1498
+ tex6_f32x2: [
1499
+ VERTEX_ATTRIB_TEXCOORD6,
1500
+ PBPrimitiveType.F32VEC2,
1501
+ 8,
1502
+ 'f32',
1503
+ 2
1504
+ ],
1505
+ tex6_f32x3: [
1506
+ VERTEX_ATTRIB_TEXCOORD6,
1507
+ PBPrimitiveType.F32VEC3,
1508
+ 12,
1509
+ 'f32',
1510
+ 3
1511
+ ],
1512
+ tex6_f32x4: [
1513
+ VERTEX_ATTRIB_TEXCOORD6,
1514
+ PBPrimitiveType.F32VEC4,
1515
+ 16,
1516
+ 'f32',
1517
+ 4
1518
+ ],
1519
+ tex6_i32: [
1520
+ VERTEX_ATTRIB_TEXCOORD6,
1521
+ PBPrimitiveType.I32,
1522
+ 4,
1523
+ 'i32',
1524
+ 1
1525
+ ],
1526
+ tex6_i32x2: [
1527
+ VERTEX_ATTRIB_TEXCOORD6,
1528
+ PBPrimitiveType.I32VEC2,
1529
+ 8,
1530
+ 'i32',
1531
+ 2
1532
+ ],
1533
+ tex6_i32x3: [
1534
+ VERTEX_ATTRIB_TEXCOORD6,
1535
+ PBPrimitiveType.I32VEC3,
1536
+ 12,
1537
+ 'i32',
1538
+ 3
1539
+ ],
1540
+ tex6_i32x4: [
1541
+ VERTEX_ATTRIB_TEXCOORD6,
1542
+ PBPrimitiveType.I32VEC4,
1543
+ 16,
1544
+ 'i32',
1545
+ 4
1546
+ ],
1547
+ tex6_u32: [
1548
+ VERTEX_ATTRIB_TEXCOORD6,
1549
+ PBPrimitiveType.U32,
1550
+ 4,
1551
+ 'u32',
1552
+ 1
1553
+ ],
1554
+ tex6_u32x2: [
1555
+ VERTEX_ATTRIB_TEXCOORD6,
1556
+ PBPrimitiveType.U32VEC2,
1557
+ 8,
1558
+ 'u32',
1559
+ 2
1560
+ ],
1561
+ tex6_u32x3: [
1562
+ VERTEX_ATTRIB_TEXCOORD6,
1563
+ PBPrimitiveType.U32VEC3,
1564
+ 12,
1565
+ 'u32',
1566
+ 3
1567
+ ],
1568
+ tex6_u32x4: [
1569
+ VERTEX_ATTRIB_TEXCOORD6,
1570
+ PBPrimitiveType.U32VEC4,
1571
+ 16,
1572
+ 'u32',
1573
+ 4
1574
+ ],
1575
+ tex7_u8normx2: [
1576
+ VERTEX_ATTRIB_TEXCOORD7,
1577
+ PBPrimitiveType.U8VEC2_NORM,
1578
+ 2,
1579
+ 'u8norm',
1580
+ 2
1581
+ ],
1582
+ tex7_u8normx4: [
1583
+ VERTEX_ATTRIB_TEXCOORD7,
1584
+ PBPrimitiveType.U8VEC4_NORM,
1585
+ 4,
1586
+ 'u8norm',
1587
+ 4
1588
+ ],
1589
+ tex7_i8normx2: [
1590
+ VERTEX_ATTRIB_TEXCOORD7,
1591
+ PBPrimitiveType.I8VEC2_NORM,
1592
+ 2,
1593
+ 'i8norm',
1594
+ 2
1595
+ ],
1596
+ tex7_i8normx4: [
1597
+ VERTEX_ATTRIB_TEXCOORD7,
1598
+ PBPrimitiveType.I8VEC4_NORM,
1599
+ 4,
1600
+ 'i8norm',
1601
+ 4
1602
+ ],
1603
+ tex7_u16x2: [
1604
+ VERTEX_ATTRIB_TEXCOORD7,
1605
+ PBPrimitiveType.U16VEC2,
1606
+ 4,
1607
+ 'u16',
1608
+ 2
1609
+ ],
1610
+ tex7_u16x4: [
1611
+ VERTEX_ATTRIB_TEXCOORD7,
1612
+ PBPrimitiveType.U16VEC4,
1613
+ 8,
1614
+ 'u16',
1615
+ 4
1616
+ ],
1617
+ tex7_i16x2: [
1618
+ VERTEX_ATTRIB_TEXCOORD7,
1619
+ PBPrimitiveType.I16VEC2,
1620
+ 4,
1621
+ 'i16',
1622
+ 2
1623
+ ],
1624
+ tex7_i16x4: [
1625
+ VERTEX_ATTRIB_TEXCOORD7,
1626
+ PBPrimitiveType.I16VEC4,
1627
+ 8,
1628
+ 'i16',
1629
+ 4
1630
+ ],
1631
+ tex7_u16normx2: [
1632
+ VERTEX_ATTRIB_TEXCOORD7,
1633
+ PBPrimitiveType.U16VEC2_NORM,
1634
+ 4,
1635
+ 'u16norm',
1636
+ 2
1637
+ ],
1638
+ tex7_u16normx4: [
1639
+ VERTEX_ATTRIB_TEXCOORD7,
1640
+ PBPrimitiveType.U16VEC4_NORM,
1641
+ 8,
1642
+ 'u16norm',
1643
+ 4
1644
+ ],
1645
+ tex7_i16normx2: [
1646
+ VERTEX_ATTRIB_TEXCOORD7,
1647
+ PBPrimitiveType.I16VEC2_NORM,
1648
+ 4,
1649
+ 'i16norm',
1650
+ 2
1651
+ ],
1652
+ tex7_i16normx4: [
1653
+ VERTEX_ATTRIB_TEXCOORD7,
1654
+ PBPrimitiveType.I16VEC4_NORM,
1655
+ 8,
1656
+ 'i16norm',
1657
+ 4
1658
+ ],
1659
+ tex7_f16x2: [
1660
+ VERTEX_ATTRIB_TEXCOORD7,
1661
+ PBPrimitiveType.F16VEC2,
1662
+ 4,
1663
+ 'f16',
1664
+ 2
1665
+ ],
1666
+ tex7_f16x4: [
1667
+ VERTEX_ATTRIB_TEXCOORD7,
1668
+ PBPrimitiveType.F16VEC4,
1669
+ 8,
1670
+ 'f16',
1671
+ 4
1672
+ ],
1673
+ tex7_f32: [
1674
+ VERTEX_ATTRIB_TEXCOORD7,
1675
+ PBPrimitiveType.F32,
1676
+ 4,
1677
+ 'f32',
1678
+ 1
1679
+ ],
1680
+ tex7_f32x2: [
1681
+ VERTEX_ATTRIB_TEXCOORD7,
1682
+ PBPrimitiveType.F32VEC2,
1683
+ 8,
1684
+ 'f32',
1685
+ 2
1686
+ ],
1687
+ tex7_f32x3: [
1688
+ VERTEX_ATTRIB_TEXCOORD7,
1689
+ PBPrimitiveType.F32VEC3,
1690
+ 12,
1691
+ 'f32',
1692
+ 3
1693
+ ],
1694
+ tex7_f32x4: [
1695
+ VERTEX_ATTRIB_TEXCOORD7,
1696
+ PBPrimitiveType.F32VEC4,
1697
+ 16,
1698
+ 'f32',
1699
+ 4
1700
+ ],
1701
+ tex7_i32: [
1702
+ VERTEX_ATTRIB_TEXCOORD7,
1703
+ PBPrimitiveType.I32,
1704
+ 4,
1705
+ 'i32',
1706
+ 1
1707
+ ],
1708
+ tex7_i32x2: [
1709
+ VERTEX_ATTRIB_TEXCOORD7,
1710
+ PBPrimitiveType.I32VEC2,
1711
+ 8,
1712
+ 'i32',
1713
+ 2
1714
+ ],
1715
+ tex7_i32x3: [
1716
+ VERTEX_ATTRIB_TEXCOORD7,
1717
+ PBPrimitiveType.I32VEC3,
1718
+ 12,
1719
+ 'i32',
1720
+ 3
1721
+ ],
1722
+ tex7_i32x4: [
1723
+ VERTEX_ATTRIB_TEXCOORD7,
1724
+ PBPrimitiveType.I32VEC4,
1725
+ 16,
1726
+ 'i32',
1727
+ 4
1728
+ ],
1729
+ tex7_u32: [
1730
+ VERTEX_ATTRIB_TEXCOORD7,
1731
+ PBPrimitiveType.U32,
1732
+ 4,
1733
+ 'u32',
1734
+ 1
1735
+ ],
1736
+ tex7_u32x2: [
1737
+ VERTEX_ATTRIB_TEXCOORD7,
1738
+ PBPrimitiveType.U32VEC2,
1739
+ 8,
1740
+ 'u32',
1741
+ 2
1742
+ ],
1743
+ tex7_u32x3: [
1744
+ VERTEX_ATTRIB_TEXCOORD7,
1745
+ PBPrimitiveType.U32VEC3,
1746
+ 12,
1747
+ 'u32',
1748
+ 3
1749
+ ],
1750
+ tex7_u32x4: [
1751
+ VERTEX_ATTRIB_TEXCOORD7,
1752
+ PBPrimitiveType.U32VEC4,
1753
+ 16,
1754
+ 'u32',
1755
+ 4
1756
+ ],
1757
+ blendweights_f16x4: [
1758
+ VERTEX_ATTRIB_BLEND_WEIGHT,
1759
+ PBPrimitiveType.F16VEC4,
1760
+ 8,
1761
+ 'f16',
1762
+ 4
1763
+ ],
1764
+ blendweights_f32x4: [
1765
+ VERTEX_ATTRIB_BLEND_WEIGHT,
1766
+ PBPrimitiveType.F32VEC4,
1767
+ 16,
1768
+ 'f32',
1769
+ 4
1770
+ ],
1771
+ blendindices_u16x4: [
1772
+ VERTEX_ATTRIB_BLEND_INDICES,
1773
+ PBPrimitiveType.U16VEC4,
1774
+ 8,
1775
+ 'u16',
1776
+ 4
1777
+ ],
1778
+ blendindices_f16x4: [
1779
+ VERTEX_ATTRIB_BLEND_INDICES,
1780
+ PBPrimitiveType.F16VEC4,
1781
+ 8,
1782
+ 'f16',
1783
+ 4
1784
+ ],
1785
+ blendindices_f32x4: [
1786
+ VERTEX_ATTRIB_BLEND_INDICES,
1787
+ PBPrimitiveType.F32VEC4,
1788
+ 16,
1789
+ 'f32',
1790
+ 4
1791
+ ],
1792
+ blendindices_u32x4: [
1793
+ VERTEX_ATTRIB_BLEND_INDICES,
1794
+ PBPrimitiveType.U32VEC4,
1795
+ 16,
1796
+ 'u32',
1797
+ 4
1798
+ ]
1799
+ };
1800
+ const vertexAttribNameMap = {
1801
+ position: VERTEX_ATTRIB_POSITION,
1802
+ normal: VERTEX_ATTRIB_NORMAL,
1803
+ diffuse: VERTEX_ATTRIB_DIFFUSE,
1804
+ tangent: VERTEX_ATTRIB_TANGENT,
1805
+ blendIndices: VERTEX_ATTRIB_BLEND_INDICES,
1806
+ blendWeights: VERTEX_ATTRIB_BLEND_WEIGHT,
1807
+ texCoord0: VERTEX_ATTRIB_TEXCOORD0,
1808
+ texCoord1: VERTEX_ATTRIB_TEXCOORD1,
1809
+ texCoord2: VERTEX_ATTRIB_TEXCOORD2,
1810
+ texCoord3: VERTEX_ATTRIB_TEXCOORD3,
1811
+ texCoord4: VERTEX_ATTRIB_TEXCOORD4,
1812
+ texCoord5: VERTEX_ATTRIB_TEXCOORD5,
1813
+ texCoord6: VERTEX_ATTRIB_TEXCOORD6,
1814
+ texCoord7: VERTEX_ATTRIB_TEXCOORD7
1815
+ };
1816
+ const vertexAttribNameRevMap = {
1817
+ [VERTEX_ATTRIB_POSITION]: 'position',
1818
+ [VERTEX_ATTRIB_NORMAL]: 'normal',
1819
+ [VERTEX_ATTRIB_DIFFUSE]: 'diffuse',
1820
+ [VERTEX_ATTRIB_TANGENT]: 'tangent',
1821
+ [VERTEX_ATTRIB_BLEND_INDICES]: 'blendIndices',
1822
+ [VERTEX_ATTRIB_BLEND_WEIGHT]: 'blendWeights',
1823
+ [VERTEX_ATTRIB_TEXCOORD0]: 'texCoord0',
1824
+ [VERTEX_ATTRIB_TEXCOORD1]: 'texCoord1',
1825
+ [VERTEX_ATTRIB_TEXCOORD2]: 'texCoord2',
1826
+ [VERTEX_ATTRIB_TEXCOORD3]: 'texCoord3',
1827
+ [VERTEX_ATTRIB_TEXCOORD4]: 'texCoord4',
1828
+ [VERTEX_ATTRIB_TEXCOORD5]: 'texCoord5',
1829
+ [VERTEX_ATTRIB_TEXCOORD6]: 'texCoord6',
1830
+ [VERTEX_ATTRIB_TEXCOORD7]: 'texCoord7'
1831
+ };
1832
+ var GPUResourceUsageFlags;
1833
+ (function(GPUResourceUsageFlags) {
1834
+ GPUResourceUsageFlags[GPUResourceUsageFlags["TF_LINEAR_COLOR_SPACE"] = 2] = "TF_LINEAR_COLOR_SPACE";
1835
+ GPUResourceUsageFlags[GPUResourceUsageFlags["TF_NO_MIPMAP"] = 4] = "TF_NO_MIPMAP";
1836
+ GPUResourceUsageFlags[GPUResourceUsageFlags["TF_WRITABLE"] = 8] = "TF_WRITABLE";
1837
+ GPUResourceUsageFlags[GPUResourceUsageFlags["TF_NO_GC"] = 16] = "TF_NO_GC";
1838
+ GPUResourceUsageFlags[GPUResourceUsageFlags["BF_VERTEX"] = 32] = "BF_VERTEX";
1839
+ GPUResourceUsageFlags[GPUResourceUsageFlags["BF_INDEX"] = 64] = "BF_INDEX";
1840
+ GPUResourceUsageFlags[GPUResourceUsageFlags["BF_READ"] = 128] = "BF_READ";
1841
+ GPUResourceUsageFlags[GPUResourceUsageFlags["BF_WRITE"] = 256] = "BF_WRITE";
1842
+ GPUResourceUsageFlags[GPUResourceUsageFlags["BF_UNIFORM"] = 512] = "BF_UNIFORM";
1843
+ GPUResourceUsageFlags[GPUResourceUsageFlags["BF_STORAGE"] = 1024] = "BF_STORAGE";
1844
+ GPUResourceUsageFlags[GPUResourceUsageFlags["DYNAMIC"] = 2048] = "DYNAMIC";
1845
+ GPUResourceUsageFlags[GPUResourceUsageFlags["MANAGED"] = 4096] = "MANAGED";
1846
+ })(GPUResourceUsageFlags || (GPUResourceUsageFlags = {}));
1847
+ /**
1848
+ * Get vertex attribute index by semantic
1849
+ * @internal
1850
+ */ function getVertexAttribByName(name) {
1851
+ return vertexAttribNameMap[name];
1852
+ }
1853
+ /**
1854
+ * Get vertex semantic by attribute index
1855
+ * @internal
1856
+ */ function getVertexAttribName(attrib) {
1857
+ return vertexAttribNameRevMap[attrib];
1858
+ }
1859
+ /**
1860
+ * Get byte size of specified vertex format
1861
+ * @internal
1862
+ */ function getVertexFormatSize(fmt) {
1863
+ return vertexAttribFormatMap[fmt][2];
1864
+ }
1865
+ /**
1866
+ * Get vertex format by semantic and component type and component count
1867
+ * @param semantic - The vertex semantic
1868
+ * @param type - Data type of vertex component
1869
+ * @param count - The count of vertex components
1870
+ * @returns Vertex format
1871
+ * @public
1872
+ */ function getVertexAttribFormat(semantic, type, count) {
1873
+ const loc = getVertexAttribByName(semantic);
1874
+ for(const k in vertexAttribFormatMap){
1875
+ const v = vertexAttribFormatMap[k];
1876
+ if (v[0] === loc && v[3] === type && v[4] === count) {
1877
+ return k;
1878
+ }
1879
+ }
1880
+ return null;
1881
+ }
1882
+ /**
1883
+ * Get the length of a vertex buffer by specified structure type of the vertex buffer
1884
+ * @param vertexBufferType - The structure type of the vertex buffer
1885
+ * @returns The length of the vertex buffer
1886
+ * @public
1887
+ */ function getVertexBufferLength(vertexBufferType) {
1888
+ return vertexBufferType.structMembers[0].type.dimension;
1889
+ }
1890
+ /**
1891
+ * Get byte stride of a vertex buffer by specified structure type of the vertex buffer
1892
+ * @param vertexBufferType - The structure type of the vertex buffer
1893
+ * @returns The byte stride of the vertex buffer
1894
+ * @public
1895
+ */ function getVertexBufferStride(vertexBufferType) {
1896
+ const vertexType = vertexBufferType.structMembers[0].type.elementType;
1897
+ if (vertexType.isStructType()) {
1898
+ let stride = 0;
1899
+ for (const member of vertexType.structMembers){
1900
+ stride += member.type.getSize();
1901
+ }
1902
+ return stride;
1903
+ } else {
1904
+ return vertexType.getSize();
1905
+ }
1906
+ }
1907
+ /**
1908
+ * Get primitive type of a vertex attribute by specified vertex semantic
1909
+ * @param vertexBufferType - The structure type of the vertex buffer
1910
+ * @param semantic - The vertex semantic
1911
+ * @returns - The primitive type of the vertex attribute
1912
+ * @public
1913
+ */ function getVertexBufferAttribTypeBySemantic(vertexBufferType, semantic) {
1914
+ const k = vertexBufferType.structMembers[0];
1915
+ const vertexType = k.type.elementType;
1916
+ if (vertexType.isStructType()) {
1917
+ for (const member of vertexType.structMembers){
1918
+ if (member.name === semantic) {
1919
+ return member.type;
1920
+ }
1921
+ }
1922
+ return null;
1923
+ } else {
1924
+ return k.name === semantic ? vertexType : null;
1925
+ }
1926
+ }
1927
+ /**
1928
+ * Get primitive type of a vertex attribute by specified vertex attribute index
1929
+ * @param vertexBufferType - The structure type of the vertex buffer
1930
+ * @param semantic - The vertex attribute index
1931
+ * @returns - The primitive type of the vertex attribute
1932
+ * @public
1933
+ */ function getVertexBufferAttribType(vertexBufferType, attrib) {
1934
+ const attribName = getVertexAttribName(attrib);
1935
+ if (!attribName) {
1936
+ return null;
1937
+ }
1938
+ return getVertexBufferAttribTypeBySemantic(vertexBufferType, attribName);
1939
+ }
1940
+ /**
1941
+ * Get the structure type of a vertex buffer by specified vertex attribute formats and the length of the vertex buffer
1942
+ * @param length - The length of the vertex buffer
1943
+ * @param attributes - The vertex attributes
1944
+ * @returns The structure type of the vertex buffer
1945
+ * @public
1946
+ */ function makeVertexBufferType(length, ...attributes) {
1947
+ if (attributes.length === 0) {
1948
+ return null;
1949
+ }
1950
+ if (attributes.length === 1) {
1951
+ const format = vertexAttribFormatMap[attributes[0]];
1952
+ return new PBStructTypeInfo(null, 'packed', [
1953
+ {
1954
+ name: getVertexAttribName(format[0]),
1955
+ type: new PBArrayTypeInfo(PBPrimitiveTypeInfo.getCachedTypeInfo(format[1]), length)
1956
+ }
1957
+ ]);
1958
+ } else {
1959
+ const vertexType = new PBStructTypeInfo(null, 'packed', attributes.map((attrib)=>({
1960
+ name: getVertexAttribName(vertexAttribFormatMap[attrib][0]),
1961
+ type: PBPrimitiveTypeInfo.getCachedTypeInfo(vertexAttribFormatMap[attrib][1])
1962
+ })));
1963
+ return new PBStructTypeInfo(null, 'packed', [
1964
+ {
1965
+ name: 'value',
1966
+ type: new PBArrayTypeInfo(vertexType, length)
1967
+ }
1968
+ ]);
1969
+ }
1970
+ }
1971
+ /**
1972
+ * Vertex semantic list
1973
+ * @public
1974
+ */ const semanticList = function() {
1975
+ const list = [];
1976
+ for(let i = 0; i < MAX_VERTEX_ATTRIBUTES; i++){
1977
+ list.push(semanticToAttrib(i));
1978
+ }
1979
+ return list;
1980
+ }();
1981
+ /** @internal */ function semanticToAttrib(semantic) {
1982
+ switch(semantic){
1983
+ case VERTEX_ATTRIB_POSITION:
1984
+ return 'a_position';
1985
+ case VERTEX_ATTRIB_NORMAL:
1986
+ return 'a_normal';
1987
+ case VERTEX_ATTRIB_DIFFUSE:
1988
+ return 'a_diffuse';
1989
+ case VERTEX_ATTRIB_TANGENT:
1990
+ return 'a_tangent';
1991
+ case VERTEX_ATTRIB_TEXCOORD0:
1992
+ return 'a_texcoord0';
1993
+ case VERTEX_ATTRIB_TEXCOORD1:
1994
+ return 'a_texcoord1';
1995
+ case VERTEX_ATTRIB_TEXCOORD2:
1996
+ return 'a_texcoord2';
1997
+ case VERTEX_ATTRIB_TEXCOORD3:
1998
+ return 'a_texcoord3';
1999
+ case VERTEX_ATTRIB_TEXCOORD4:
2000
+ return 'a_texcoord4';
2001
+ case VERTEX_ATTRIB_TEXCOORD5:
2002
+ return 'a_texcoord5';
2003
+ case VERTEX_ATTRIB_TEXCOORD6:
2004
+ return 'a_texcoord6';
2005
+ case VERTEX_ATTRIB_TEXCOORD7:
2006
+ return 'a_texcoord7';
2007
+ case VERTEX_ATTRIB_BLEND_INDICES:
2008
+ return 'a_indices';
2009
+ case VERTEX_ATTRIB_BLEND_WEIGHT:
2010
+ return 'a_weight';
2011
+ default:
2012
+ return null;
2013
+ }
2014
+ }
2015
+ /**
2016
+ * Creates the default name for the type of given gpu object
2017
+ * @param obj - The gpu object
2018
+ * @returns The default name
2019
+ * @public
2020
+ */ function genDefaultName(obj) {
2021
+ if (obj.isTexture2D()) {
2022
+ return 'texture_2d';
2023
+ } else if (obj.isTexture2DArray()) {
2024
+ return 'texture_2darray';
2025
+ } else if (obj.isTexture3D()) {
2026
+ return 'texture_3d';
2027
+ } else if (obj.isTextureCube()) {
2028
+ return 'texture_cube';
2029
+ } else if (obj.isTextureVideo()) {
2030
+ return 'texture_video';
2031
+ } else if (obj.isBuffer()) {
2032
+ return 'buffer';
2033
+ } else if (obj.isFramebuffer()) {
2034
+ return 'framebuffer';
2035
+ } else if (obj.isProgram()) {
2036
+ return 'program';
2037
+ } else if (obj.isSampler()) {
2038
+ return 'sampler';
2039
+ } else if (obj.isVertexLayout()) {
2040
+ return 'vbo';
2041
+ } else {
2042
+ return 'unknown';
2043
+ }
2044
+ }
2045
+
2046
+ export { GPUResourceUsageFlags, MAX_BINDING_GROUPS, MAX_TEXCOORD_INDEX_COUNT, MAX_VERTEX_ATTRIBUTES, VERTEX_ATTRIB_BLEND_INDICES, VERTEX_ATTRIB_BLEND_WEIGHT, VERTEX_ATTRIB_DIFFUSE, VERTEX_ATTRIB_NORMAL, VERTEX_ATTRIB_POSITION, VERTEX_ATTRIB_TANGENT, VERTEX_ATTRIB_TEXCOORD0, VERTEX_ATTRIB_TEXCOORD1, VERTEX_ATTRIB_TEXCOORD2, VERTEX_ATTRIB_TEXCOORD3, VERTEX_ATTRIB_TEXCOORD4, VERTEX_ATTRIB_TEXCOORD5, VERTEX_ATTRIB_TEXCOORD6, VERTEX_ATTRIB_TEXCOORD7, genDefaultName, getVertexAttribByName, getVertexAttribFormat, getVertexAttribName, getVertexBufferAttribType, getVertexBufferAttribTypeBySemantic, getVertexBufferLength, getVertexBufferStride, getVertexFormatSize, makeVertexBufferType, semanticList, semanticToAttrib };
2047
+ //# sourceMappingURL=gpuobject.js.map