@luma.gl/webgl 9.0.0-alpha.46 → 9.0.0-alpha.48

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 (88) hide show
  1. package/LICENSE +34 -0
  2. package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
  3. package/dist/adapter/converters/device-parameters.js +73 -40
  4. package/dist/adapter/converters/device-parameters.js.map +1 -1
  5. package/dist/adapter/converters/sampler-parameters.js +60 -61
  6. package/dist/adapter/converters/sampler-parameters.js.map +1 -1
  7. package/dist/adapter/converters/shader-formats.js +12 -13
  8. package/dist/adapter/converters/shader-formats.js.map +1 -1
  9. package/dist/adapter/converters/texture-formats.js +179 -180
  10. package/dist/adapter/converters/texture-formats.js.map +1 -1
  11. package/dist/adapter/converters/vertex-formats.js +20 -21
  12. package/dist/adapter/converters/vertex-formats.js.map +1 -1
  13. package/dist/adapter/device-helpers/device-features.js +2 -2
  14. package/dist/adapter/device-helpers/device-features.js.map +1 -1
  15. package/dist/adapter/device-helpers/device-limits.js +53 -54
  16. package/dist/adapter/device-helpers/device-limits.js.map +1 -1
  17. package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
  18. package/dist/adapter/device-helpers/get-device-info.js +23 -12
  19. package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
  20. package/dist/adapter/helpers/decode-webgl-types.js +31 -32
  21. package/dist/adapter/helpers/decode-webgl-types.js.map +1 -1
  22. package/dist/adapter/helpers/get-shader-layout.js +29 -30
  23. package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
  24. package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
  25. package/dist/adapter/helpers/parse-shader-compiler-log.js +16 -4
  26. package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
  27. package/dist/adapter/helpers/set-uniform.js +40 -41
  28. package/dist/adapter/helpers/set-uniform.js.map +1 -1
  29. package/dist/adapter/helpers/webgl-topology-utils.js +38 -39
  30. package/dist/adapter/helpers/webgl-topology-utils.js.map +1 -1
  31. package/dist/adapter/objects/webgl-renderbuffer.js +5 -6
  32. package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
  33. package/dist/adapter/resources/webgl-buffer.js +14 -15
  34. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  35. package/dist/adapter/resources/webgl-command-buffer.js +25 -26
  36. package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
  37. package/dist/adapter/resources/webgl-framebuffer.js +22 -23
  38. package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
  39. package/dist/adapter/resources/webgl-render-pass.js +2 -3
  40. package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
  41. package/dist/adapter/resources/webgl-render-pipeline.js +7 -8
  42. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  43. package/dist/adapter/resources/webgl-sampler.js +2 -3
  44. package/dist/adapter/resources/webgl-sampler.js.map +1 -1
  45. package/dist/adapter/resources/webgl-shader.js +3 -4
  46. package/dist/adapter/resources/webgl-shader.js.map +1 -1
  47. package/dist/adapter/resources/webgl-texture.js +27 -28
  48. package/dist/adapter/resources/webgl-texture.js.map +1 -1
  49. package/dist/adapter/resources/webgl-transform-feedback.d.ts +5 -11
  50. package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
  51. package/dist/adapter/resources/webgl-transform-feedback.js +16 -13
  52. package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -1
  53. package/dist/adapter/resources/webgl-vertex-array.d.ts +2 -2
  54. package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
  55. package/dist/adapter/resources/webgl-vertex-array.js +5 -6
  56. package/dist/adapter/resources/webgl-vertex-array.js.map +1 -1
  57. package/dist/adapter/webgl-device.js.map +1 -1
  58. package/dist/classic/accessor.js +4 -5
  59. package/dist/classic/accessor.js.map +1 -1
  60. package/dist/classic/copy-and-blit.js +16 -17
  61. package/dist/classic/copy-and-blit.js.map +1 -1
  62. package/dist/classic/format-utils.js +14 -15
  63. package/dist/classic/format-utils.js.map +1 -1
  64. package/dist/classic/typed-array-utils.d.ts +2 -0
  65. package/dist/classic/typed-array-utils.d.ts.map +1 -1
  66. package/dist/classic/typed-array-utils.js +18 -19
  67. package/dist/classic/typed-array-utils.js.map +1 -1
  68. package/dist/context/debug/webgl-developer-tools.js +0 -1
  69. package/dist/context/debug/webgl-developer-tools.js.map +1 -1
  70. package/dist/context/parameters/webgl-parameter-tables.js +256 -257
  71. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  72. package/dist/context/polyfill/get-parameter-polyfill.js +34 -35
  73. package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
  74. package/dist/context/polyfill/polyfill-table.js +9 -10
  75. package/dist/context/polyfill/polyfill-table.js.map +1 -1
  76. package/dist/context/polyfill/polyfill-vertex-array-object.js +17 -17
  77. package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
  78. package/dist/dist.dev.js +987 -2700
  79. package/dist/index.cjs +390 -267
  80. package/dist.min.js +39 -28
  81. package/package.json +5 -5
  82. package/src/adapter/converters/device-parameters.ts +40 -25
  83. package/src/adapter/device-helpers/get-device-info.ts +36 -8
  84. package/src/adapter/helpers/parse-shader-compiler-log.ts +21 -7
  85. package/src/adapter/resources/webgl-transform-feedback.ts +13 -16
  86. package/src/adapter/resources/webgl-vertex-array.ts +4 -3
  87. package/src/adapter/webgl-device.ts +3 -2
  88. package/src/classic/typed-array-utils.ts +2 -0
@@ -1,5 +1,4 @@
1
1
  import { decodeTextureFormat } from '@luma.gl/core';
2
- import { GL } from '@luma.gl/constants';
3
2
  import { isWebGL2 } from "../../context/context/webgl-checks.js";
4
3
  import { getGLFromVertexType } from "./vertex-formats.js";
5
4
  const texture_compression_bc = 'texture-compression-bc';
@@ -54,83 +53,83 @@ export function getTextureFeatures(gl) {
54
53
  }
55
54
  export const TEXTURE_FORMATS = {
56
55
  'rgb8unorm-unsized': {
57
- gl: GL.RGB,
58
- gl1: GL.RGB,
56
+ gl: 6407,
57
+ gl1: 6407,
59
58
  b: 4,
60
59
  c: 2,
61
60
  bpp: 4,
62
- dataFormat: GL.RGB,
63
- types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_6_5]
61
+ dataFormat: 6407,
62
+ types: [5121, 33635]
64
63
  },
65
64
  'rgba8unorm-unsized': {
66
- gl: GL.RGBA,
67
- gl1: GL.RGBA,
65
+ gl: 6408,
66
+ gl1: 6408,
68
67
  b: 4,
69
68
  c: 2,
70
69
  bpp: 4,
71
- dataFormat: GL.RGBA,
72
- types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_4_4_4_4, GL.UNSIGNED_SHORT_5_5_5_1]
70
+ dataFormat: 6408,
71
+ types: [5121, 32819, 32820]
73
72
  },
74
73
  'r8unorm': {
75
- gl: GL.R8,
74
+ gl: 33321,
76
75
  b: 1,
77
76
  c: 1,
78
77
  renderbuffer: true
79
78
  },
80
79
  'r8snorm': {
81
- gl: GL.R8_SNORM,
80
+ gl: 36756,
82
81
  b: 1,
83
82
  c: 1
84
83
  },
85
84
  'r8uint': {
86
- gl: GL.R8UI,
85
+ gl: 33330,
87
86
  b: 1,
88
87
  c: 1,
89
88
  renderbuffer: true
90
89
  },
91
90
  'r8sint': {
92
- gl: GL.R8I,
91
+ gl: 33329,
93
92
  b: 1,
94
93
  c: 1,
95
94
  renderbuffer: true
96
95
  },
97
96
  'rg8unorm': {
98
- gl: GL.RG8,
97
+ gl: 33323,
99
98
  b: 2,
100
99
  c: 2,
101
100
  renderbuffer: true
102
101
  },
103
102
  'rg8snorm': {
104
- gl: GL.RG8_SNORM,
103
+ gl: 36757,
105
104
  b: 2,
106
105
  c: 2
107
106
  },
108
107
  'rg8uint': {
109
- gl: GL.RG8UI,
108
+ gl: 33336,
110
109
  b: 2,
111
110
  c: 2,
112
111
  renderbuffer: true
113
112
  },
114
113
  'rg8sint': {
115
- gl: GL.RG8I,
114
+ gl: 33335,
116
115
  b: 2,
117
116
  c: 2,
118
117
  renderbuffer: true
119
118
  },
120
119
  'r16uint': {
121
- gl: GL.R16UI,
120
+ gl: 33332,
122
121
  b: 2,
123
122
  c: 1,
124
123
  renderbuffer: true
125
124
  },
126
125
  'r16sint': {
127
- gl: GL.R16I,
126
+ gl: 33331,
128
127
  b: 2,
129
128
  c: 1,
130
129
  renderbuffer: true
131
130
  },
132
131
  'r16float': {
133
- gl: GL.R16F,
132
+ gl: 33325,
134
133
  b: 2,
135
134
  c: 1,
136
135
  render: 'texture-renderable-float16-webgl',
@@ -138,7 +137,7 @@ export const TEXTURE_FORMATS = {
138
137
  renderbuffer: true
139
138
  },
140
139
  'r16unorm-webgl': {
141
- gl: GL.R16_EXT,
140
+ gl: 33322,
142
141
  b: 2,
143
142
  c: 1,
144
143
  f: 'texture-formats-norm16-webgl',
@@ -146,73 +145,73 @@ export const TEXTURE_FORMATS = {
146
145
  x: EXT_TEXTURE_NORM16
147
146
  },
148
147
  'r16snorm-webgl': {
149
- gl: GL.R16_SNORM_EXT,
148
+ gl: 36760,
150
149
  b: 2,
151
150
  c: 1,
152
151
  f: 'texture-formats-norm16-webgl',
153
152
  x: EXT_TEXTURE_NORM16
154
153
  },
155
154
  'rgba4unorm-webgl': {
156
- gl: GL.RGBA4,
155
+ gl: 32854,
157
156
  b: 2,
158
157
  c: 4,
159
158
  wgpu: false,
160
159
  renderbuffer: true
161
160
  },
162
161
  'rgb565unorm-webgl': {
163
- gl: GL.RGB565,
162
+ gl: 36194,
164
163
  b: 2,
165
164
  c: 4,
166
165
  wgpu: false,
167
166
  renderbuffer: true
168
167
  },
169
168
  'rgb5a1unorm-webgl': {
170
- gl: GL.RGB5_A1,
169
+ gl: 32855,
171
170
  b: 2,
172
171
  c: 4,
173
172
  wgpu: false,
174
173
  renderbuffer: true
175
174
  },
176
175
  'rgb8unorm-webgl': {
177
- gl: GL.RGB8,
176
+ gl: 32849,
178
177
  b: 3,
179
178
  c: 3,
180
179
  wgpu: false
181
180
  },
182
181
  'rgb8snorm-webgl': {
183
- gl: GL.RGB8_SNORM,
182
+ gl: 36758,
184
183
  b: 3,
185
184
  c: 3,
186
185
  wgpu: false
187
186
  },
188
187
  'rgba8unorm': {
189
- gl: GL.RGBA8,
190
- gl1: GL.RGBA,
188
+ gl: 32856,
189
+ gl1: 6408,
191
190
  b: 4,
192
191
  c: 2,
193
192
  bpp: 4
194
193
  },
195
194
  'rgba8unorm-srgb': {
196
- gl: GL.SRGB8_ALPHA8,
197
- gl1: GL.SRGB_ALPHA_EXT,
195
+ gl: 35907,
196
+ gl1: 35906,
198
197
  b: 4,
199
198
  c: 4,
200
199
  gl1ext: EXT_SRGB,
201
200
  bpp: 4
202
201
  },
203
202
  'rgba8snorm': {
204
- gl: GL.RGBA8_SNORM,
203
+ gl: 36759,
205
204
  b: 4,
206
205
  c: 4
207
206
  },
208
207
  'rgba8uint': {
209
- gl: GL.RGBA8UI,
208
+ gl: 36220,
210
209
  b: 4,
211
210
  c: 4,
212
211
  bpp: 4
213
212
  },
214
213
  'rgba8sint': {
215
- gl: GL.RGBA8I,
214
+ gl: 36238,
216
215
  b: 4,
217
216
  c: 4,
218
217
  bpp: 4
@@ -226,19 +225,19 @@ export const TEXTURE_FORMATS = {
226
225
  c: 4
227
226
  },
228
227
  'rg16uint': {
229
- gl: GL.RG16UI,
228
+ gl: 33338,
230
229
  b: 4,
231
230
  c: 1,
232
231
  bpp: 4
233
232
  },
234
233
  'rg16sint': {
235
- gl: GL.RG16I,
234
+ gl: 33337,
236
235
  b: 4,
237
236
  c: 2,
238
237
  bpp: 4
239
238
  },
240
239
  'rg16float': {
241
- gl: GL.RG16F,
240
+ gl: 33327,
242
241
  bpp: 4,
243
242
  b: 4,
244
243
  c: 2,
@@ -247,35 +246,35 @@ export const TEXTURE_FORMATS = {
247
246
  renderbuffer: true
248
247
  },
249
248
  'rg16unorm-webgl': {
250
- gl: GL.RG16_EXT,
249
+ gl: 33324,
251
250
  b: 2,
252
251
  c: 2,
253
252
  f: 'texture-formats-norm16-webgl',
254
253
  x: EXT_TEXTURE_NORM16
255
254
  },
256
255
  'rg16snorm-webgl': {
257
- gl: GL.RG16_SNORM_EXT,
256
+ gl: 36761,
258
257
  b: 2,
259
258
  c: 2,
260
259
  f: 'texture-formats-norm16-webgl',
261
260
  x: EXT_TEXTURE_NORM16
262
261
  },
263
262
  'r32uint': {
264
- gl: GL.R32UI,
263
+ gl: 33334,
265
264
  b: 4,
266
265
  c: 1,
267
266
  bpp: 4,
268
267
  renderbuffer: true
269
268
  },
270
269
  'r32sint': {
271
- gl: GL.R32I,
270
+ gl: 33333,
272
271
  b: 4,
273
272
  c: 1,
274
273
  bpp: 4,
275
274
  renderbuffer: true
276
275
  },
277
276
  'r32float': {
278
- gl: GL.R32F,
277
+ gl: 33326,
279
278
  bpp: 4,
280
279
  b: 4,
281
280
  c: 1,
@@ -283,7 +282,7 @@ export const TEXTURE_FORMATS = {
283
282
  filter: 'texture-filter-linear-float32-webgl'
284
283
  },
285
284
  'rgb9e5ufloat': {
286
- gl: GL.RGB9_E5,
285
+ gl: 35901,
287
286
  b: 4,
288
287
  c: 3,
289
288
  p: 1,
@@ -291,7 +290,7 @@ export const TEXTURE_FORMATS = {
291
290
  filter: 'texture-filter-linear-float16-webgl'
292
291
  },
293
292
  'rg11b10ufloat': {
294
- gl: GL.R11F_G11F_B10F,
293
+ gl: 35898,
295
294
  b: 4,
296
295
  c: 3,
297
296
  p: 1,
@@ -299,7 +298,7 @@ export const TEXTURE_FORMATS = {
299
298
  renderbuffer: true
300
299
  },
301
300
  'rgb10a2unorm': {
302
- gl: GL.RGB10_A2,
301
+ gl: 32857,
303
302
  b: 4,
304
303
  c: 4,
305
304
  p: 1,
@@ -308,40 +307,40 @@ export const TEXTURE_FORMATS = {
308
307
  'rgb10a2unorm-webgl': {
309
308
  b: 4,
310
309
  c: 4,
311
- gl: GL.RGB10_A2UI,
310
+ gl: 36975,
312
311
  p: 1,
313
312
  wgpu: false,
314
313
  bpp: 4,
315
314
  renderbuffer: true
316
315
  },
317
316
  'rgb16unorm-webgl': {
318
- gl: GL.RGB16_EXT,
317
+ gl: 32852,
319
318
  b: 2,
320
319
  c: 3,
321
320
  f: 'texture-formats-norm16-webgl',
322
321
  x: EXT_TEXTURE_NORM16
323
322
  },
324
323
  'rgb16snorm-webgl': {
325
- gl: GL.RGB16_SNORM_EXT,
324
+ gl: 36762,
326
325
  b: 2,
327
326
  c: 3,
328
327
  f: 'texture-formats-norm16-webgl',
329
328
  x: EXT_TEXTURE_NORM16
330
329
  },
331
330
  'rg32uint': {
332
- gl: GL.RG32UI,
331
+ gl: 33340,
333
332
  b: 8,
334
333
  c: 2,
335
334
  renderbuffer: true
336
335
  },
337
336
  'rg32sint': {
338
- gl: GL.RG32I,
337
+ gl: 33339,
339
338
  b: 8,
340
339
  c: 2,
341
340
  renderbuffer: true
342
341
  },
343
342
  'rg32float': {
344
- gl: GL.RG32F,
343
+ gl: 33328,
345
344
  b: 8,
346
345
  c: 2,
347
346
  render: 'texture-renderable-float32-webgl',
@@ -349,27 +348,27 @@ export const TEXTURE_FORMATS = {
349
348
  renderbuffer: true
350
349
  },
351
350
  'rgba16uint': {
352
- gl: GL.RGBA16UI,
351
+ gl: 36214,
353
352
  b: 8,
354
353
  c: 4,
355
354
  renderbuffer: true
356
355
  },
357
356
  'rgba16sint': {
358
- gl: GL.RGBA16I,
357
+ gl: 36232,
359
358
  b: 8,
360
359
  c: 4,
361
360
  renderbuffer: true
362
361
  },
363
362
  'rgba16float': {
364
- gl: GL.RGBA16F,
365
- gl1: GL.RGBA,
363
+ gl: 34842,
364
+ gl1: 6408,
366
365
  b: 8,
367
366
  c: 4,
368
367
  render: 'texture-renderable-float16-webgl',
369
368
  filter: 'texture-filter-linear-float16-webgl'
370
369
  },
371
370
  'rgba16unorm-webgl': {
372
- gl: GL.RGBA16_EXT,
371
+ gl: 32859,
373
372
  b: 2,
374
373
  c: 4,
375
374
  f: 'texture-formats-norm16-webgl',
@@ -377,36 +376,36 @@ export const TEXTURE_FORMATS = {
377
376
  x: EXT_TEXTURE_NORM16
378
377
  },
379
378
  'rgba16snorm-webgl': {
380
- gl: GL.RGBA16_SNORM_EXT,
379
+ gl: 36763,
381
380
  b: 2,
382
381
  c: 4,
383
382
  f: 'texture-formats-norm16-webgl',
384
383
  x: EXT_TEXTURE_NORM16
385
384
  },
386
385
  'rgb32float-webgl': {
387
- gl: GL.RGB32F,
388
- gl1: GL.RGB,
386
+ gl: 34837,
387
+ gl1: 6407,
389
388
  render: 'texture-renderable-float32-webgl',
390
389
  filter: 'texture-filter-linear-float32-webgl',
391
390
  gl2ext: EXT_FLOAT_RENDER_WEBGL2,
392
391
  gl1ext: EXT_FLOAT_WEBGL1,
393
- dataFormat: GL.RGB,
394
- types: [GL.FLOAT]
392
+ dataFormat: 6407,
393
+ types: [5126]
395
394
  },
396
395
  'rgba32uint': {
397
- gl: GL.RGBA32UI,
396
+ gl: 36208,
398
397
  b: 16,
399
398
  c: 4,
400
399
  renderbuffer: true
401
400
  },
402
401
  'rgba32sint': {
403
- gl: GL.RGBA32I,
402
+ gl: 36226,
404
403
  b: 16,
405
404
  c: 4,
406
405
  renderbuffer: true
407
406
  },
408
407
  'rgba32float': {
409
- gl: GL.RGBA32F,
408
+ gl: 34836,
410
409
  b: 16,
411
410
  c: 4,
412
411
  render: 'texture-renderable-float32-webgl',
@@ -414,349 +413,349 @@ export const TEXTURE_FORMATS = {
414
413
  renderbuffer: true
415
414
  },
416
415
  'stencil8': {
417
- gl: GL.STENCIL_INDEX8,
418
- gl1: GL.STENCIL_INDEX8,
416
+ gl: 36168,
417
+ gl1: 36168,
419
418
  b: 1,
420
419
  c: 1,
421
- attachment: GL.STENCIL_ATTACHMENT,
420
+ attachment: 36128,
422
421
  renderbuffer: true
423
422
  },
424
423
  'depth16unorm': {
425
- gl: GL.DEPTH_COMPONENT16,
426
- gl1: GL.DEPTH_COMPONENT16,
424
+ gl: 33189,
425
+ gl1: 33189,
427
426
  b: 2,
428
427
  c: 1,
429
- attachment: GL.DEPTH_ATTACHMENT,
428
+ attachment: 36096,
430
429
  renderbuffer: true
431
430
  },
432
431
  'depth24plus': {
433
- gl: GL.DEPTH_COMPONENT24,
432
+ gl: 33190,
434
433
  b: 3,
435
434
  c: 1,
436
- attachment: GL.DEPTH_ATTACHMENT
435
+ attachment: 36096
437
436
  },
438
437
  'depth32float': {
439
- gl: GL.DEPTH_COMPONENT32F,
438
+ gl: 36012,
440
439
  b: 4,
441
440
  c: 1,
442
- attachment: GL.DEPTH_ATTACHMENT,
441
+ attachment: 36096,
443
442
  renderbuffer: true
444
443
  },
445
444
  'depth24plus-stencil8': {
446
- gl: GL.DEPTH_STENCIL,
447
- gl1: GL.DEPTH_STENCIL,
445
+ gl: 34041,
446
+ gl1: 34041,
448
447
  b: 4,
449
448
  c: 2,
450
449
  p: 1,
451
- attachment: GL.DEPTH_STENCIL_ATTACHMENT,
450
+ attachment: 33306,
452
451
  renderbuffer: true,
453
452
  depthTexture: true
454
453
  },
455
454
  'depth24unorm-stencil8': {
456
- gl: GL.DEPTH24_STENCIL8,
455
+ gl: 35056,
457
456
  b: 4,
458
457
  c: 2,
459
458
  p: 1,
460
- attachment: GL.DEPTH_STENCIL_ATTACHMENT,
459
+ attachment: 33306,
461
460
  renderbuffer: true
462
461
  },
463
462
  'depth32float-stencil8': {
464
- gl: GL.DEPTH32F_STENCIL8,
463
+ gl: 36013,
465
464
  b: 5,
466
465
  c: 2,
467
466
  p: 1,
468
- attachment: GL.DEPTH_STENCIL_ATTACHMENT,
467
+ attachment: 33306,
469
468
  renderbuffer: true
470
469
  },
471
470
  'bc1-rgb-unorm-webgl': {
472
- gl: GL.COMPRESSED_RGB_S3TC_DXT1_EXT,
471
+ gl: 33776,
473
472
  x: X_S3TC,
474
473
  f: texture_compression_bc
475
474
  },
476
475
  'bc1-rgb-unorm-srgb-webgl': {
477
- gl: GL.COMPRESSED_SRGB_S3TC_DXT1_EXT,
476
+ gl: 35916,
478
477
  x: X_S3TC_SRGB,
479
478
  f: texture_compression_bc
480
479
  },
481
480
  'bc1-rgba-unorm': {
482
- gl: GL.COMPRESSED_RGBA_S3TC_DXT1_EXT,
481
+ gl: 33777,
483
482
  x: X_S3TC,
484
483
  f: texture_compression_bc
485
484
  },
486
485
  'bc1-rgba-unorm-srgb': {
487
- gl: GL.COMPRESSED_SRGB_S3TC_DXT1_EXT,
486
+ gl: 35916,
488
487
  x: X_S3TC_SRGB,
489
488
  f: texture_compression_bc
490
489
  },
491
490
  'bc2-rgba-unorm': {
492
- gl: GL.COMPRESSED_RGBA_S3TC_DXT3_EXT,
491
+ gl: 33778,
493
492
  x: X_S3TC,
494
493
  f: texture_compression_bc
495
494
  },
496
495
  'bc2-rgba-unorm-srgb': {
497
- gl: GL.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
496
+ gl: 35918,
498
497
  x: X_S3TC_SRGB,
499
498
  f: texture_compression_bc
500
499
  },
501
500
  'bc3-rgba-unorm': {
502
- gl: GL.COMPRESSED_RGBA_S3TC_DXT5_EXT,
501
+ gl: 33779,
503
502
  x: X_S3TC,
504
503
  f: texture_compression_bc
505
504
  },
506
505
  'bc3-rgba-unorm-srgb': {
507
- gl: GL.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
506
+ gl: 35919,
508
507
  x: X_S3TC_SRGB,
509
508
  f: texture_compression_bc
510
509
  },
511
510
  'bc4-r-unorm': {
512
- gl: GL.COMPRESSED_RED_RGTC1_EXT,
511
+ gl: 36283,
513
512
  x: X_RGTC,
514
513
  f: texture_compression_bc
515
514
  },
516
515
  'bc4-r-snorm': {
517
- gl: GL.COMPRESSED_SIGNED_RED_RGTC1_EXT,
516
+ gl: 36284,
518
517
  x: X_RGTC,
519
518
  f: texture_compression_bc
520
519
  },
521
520
  'bc5-rg-unorm': {
522
- gl: GL.COMPRESSED_RED_GREEN_RGTC2_EXT,
521
+ gl: 36285,
523
522
  x: X_RGTC,
524
523
  f: texture_compression_bc
525
524
  },
526
525
  'bc5-rg-snorm': {
527
- gl: GL.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
526
+ gl: 36286,
528
527
  x: X_RGTC,
529
528
  f: texture_compression_bc
530
529
  },
531
530
  'bc6h-rgb-ufloat': {
532
- gl: GL.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
531
+ gl: 36495,
533
532
  x: X_BPTC,
534
533
  f: texture_compression_bc
535
534
  },
536
535
  'bc6h-rgb-float': {
537
- gl: GL.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
536
+ gl: 36494,
538
537
  x: X_BPTC,
539
538
  f: texture_compression_bc
540
539
  },
541
540
  'bc7-rgba-unorm': {
542
- gl: GL.COMPRESSED_RGBA_BPTC_UNORM_EXT,
541
+ gl: 36492,
543
542
  x: X_BPTC,
544
543
  f: texture_compression_bc
545
544
  },
546
545
  'bc7-rgba-unorm-srgb': {
547
- gl: GL.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
546
+ gl: 36493,
548
547
  x: X_BPTC,
549
548
  f: texture_compression_bc
550
549
  },
551
550
  'etc2-rgb8unorm': {
552
- gl: GL.COMPRESSED_RGB8_ETC2,
551
+ gl: 37492,
553
552
  f: texture_compression_etc2
554
553
  },
555
554
  'etc2-rgb8unorm-srgb': {
556
- gl: GL.COMPRESSED_SRGB8_ETC2,
555
+ gl: 37494,
557
556
  f: texture_compression_etc2
558
557
  },
559
558
  'etc2-rgb8a1unorm': {
560
- gl: GL.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
559
+ gl: 37496,
561
560
  f: texture_compression_etc2
562
561
  },
563
562
  'etc2-rgb8a1unorm-srgb': {
564
- gl: GL.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
563
+ gl: 37497,
565
564
  f: texture_compression_etc2
566
565
  },
567
566
  'etc2-rgba8unorm': {
568
- gl: GL.COMPRESSED_RGBA8_ETC2_EAC,
567
+ gl: 37493,
569
568
  f: texture_compression_etc2
570
569
  },
571
570
  'etc2-rgba8unorm-srgb': {
572
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
571
+ gl: 37495,
573
572
  f: texture_compression_etc2
574
573
  },
575
574
  'eac-r11unorm': {
576
- gl: GL.COMPRESSED_R11_EAC,
575
+ gl: 37488,
577
576
  f: texture_compression_etc2
578
577
  },
579
578
  'eac-r11snorm': {
580
- gl: GL.COMPRESSED_SIGNED_R11_EAC,
579
+ gl: 37489,
581
580
  f: texture_compression_etc2
582
581
  },
583
582
  'eac-rg11unorm': {
584
- gl: GL.COMPRESSED_RG11_EAC,
583
+ gl: 37490,
585
584
  f: texture_compression_etc2
586
585
  },
587
586
  'eac-rg11snorm': {
588
- gl: GL.COMPRESSED_SIGNED_RG11_EAC,
587
+ gl: 37491,
589
588
  f: texture_compression_etc2
590
589
  },
591
590
  'astc-4x4-unorm': {
592
- gl: GL.COMPRESSED_RGBA_ASTC_4x4_KHR,
591
+ gl: 37808,
593
592
  f: texture_compression_astc
594
593
  },
595
594
  'astc-4x4-unorm-srgb': {
596
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
595
+ gl: 37840,
597
596
  f: texture_compression_astc
598
597
  },
599
598
  'astc-5x4-unorm': {
600
- gl: GL.COMPRESSED_RGBA_ASTC_5x4_KHR,
599
+ gl: 37809,
601
600
  f: texture_compression_astc
602
601
  },
603
602
  'astc-5x4-unorm-srgb': {
604
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
603
+ gl: 37841,
605
604
  f: texture_compression_astc
606
605
  },
607
606
  'astc-5x5-unorm': {
608
- gl: GL.COMPRESSED_RGBA_ASTC_5x5_KHR,
607
+ gl: 37810,
609
608
  f: texture_compression_astc
610
609
  },
611
610
  'astc-5x5-unorm-srgb': {
612
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
611
+ gl: 37842,
613
612
  f: texture_compression_astc
614
613
  },
615
614
  'astc-6x5-unorm': {
616
- gl: GL.COMPRESSED_RGBA_ASTC_6x5_KHR,
615
+ gl: 37811,
617
616
  f: texture_compression_astc
618
617
  },
619
618
  'astc-6x5-unorm-srgb': {
620
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
619
+ gl: 37843,
621
620
  f: texture_compression_astc
622
621
  },
623
622
  'astc-6x6-unorm': {
624
- gl: GL.COMPRESSED_RGBA_ASTC_6x6_KHR,
623
+ gl: 37812,
625
624
  f: texture_compression_astc
626
625
  },
627
626
  'astc-6x6-unorm-srgb': {
628
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
627
+ gl: 37844,
629
628
  f: texture_compression_astc
630
629
  },
631
630
  'astc-8x5-unorm': {
632
- gl: GL.COMPRESSED_RGBA_ASTC_8x5_KHR,
631
+ gl: 37813,
633
632
  f: texture_compression_astc
634
633
  },
635
634
  'astc-8x5-unorm-srgb': {
636
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
635
+ gl: 37845,
637
636
  f: texture_compression_astc
638
637
  },
639
638
  'astc-8x6-unorm': {
640
- gl: GL.COMPRESSED_RGBA_ASTC_8x6_KHR,
639
+ gl: 37814,
641
640
  f: texture_compression_astc
642
641
  },
643
642
  'astc-8x6-unorm-srgb': {
644
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
643
+ gl: 37846,
645
644
  f: texture_compression_astc
646
645
  },
647
646
  'astc-8x8-unorm': {
648
- gl: GL.COMPRESSED_RGBA_ASTC_8x8_KHR,
647
+ gl: 37815,
649
648
  f: texture_compression_astc
650
649
  },
651
650
  'astc-8x8-unorm-srgb': {
652
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
651
+ gl: 37847,
653
652
  f: texture_compression_astc
654
653
  },
655
654
  'astc-10x5-unorm': {
656
- gl: GL.COMPRESSED_RGBA_ASTC_10x10_KHR,
655
+ gl: 37819,
657
656
  f: texture_compression_astc
658
657
  },
659
658
  'astc-10x5-unorm-srgb': {
660
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
659
+ gl: 37851,
661
660
  f: texture_compression_astc
662
661
  },
663
662
  'astc-10x6-unorm': {
664
- gl: GL.COMPRESSED_RGBA_ASTC_10x6_KHR,
663
+ gl: 37817,
665
664
  f: texture_compression_astc
666
665
  },
667
666
  'astc-10x6-unorm-srgb': {
668
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
667
+ gl: 37849,
669
668
  f: texture_compression_astc
670
669
  },
671
670
  'astc-10x8-unorm': {
672
- gl: GL.COMPRESSED_RGBA_ASTC_10x8_KHR,
671
+ gl: 37818,
673
672
  f: texture_compression_astc
674
673
  },
675
674
  'astc-10x8-unorm-srgb': {
676
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
675
+ gl: 37850,
677
676
  f: texture_compression_astc
678
677
  },
679
678
  'astc-10x10-unorm': {
680
- gl: GL.COMPRESSED_RGBA_ASTC_10x10_KHR,
679
+ gl: 37819,
681
680
  f: texture_compression_astc
682
681
  },
683
682
  'astc-10x10-unorm-srgb': {
684
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
683
+ gl: 37851,
685
684
  f: texture_compression_astc
686
685
  },
687
686
  'astc-12x10-unorm': {
688
- gl: GL.COMPRESSED_RGBA_ASTC_12x10_KHR,
687
+ gl: 37820,
689
688
  f: texture_compression_astc
690
689
  },
691
690
  'astc-12x10-unorm-srgb': {
692
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
691
+ gl: 37852,
693
692
  f: texture_compression_astc
694
693
  },
695
694
  'astc-12x12-unorm': {
696
- gl: GL.COMPRESSED_RGBA_ASTC_12x12_KHR,
695
+ gl: 37821,
697
696
  f: texture_compression_astc
698
697
  },
699
698
  'astc-12x12-unorm-srgb': {
700
- gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
699
+ gl: 37853,
701
700
  f: texture_compression_astc
702
701
  },
703
702
  'pvrtc-rgb4unorm-webgl': {
704
- gl: GL.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
703
+ gl: 35840,
705
704
  f: texture_compression_pvrtc_webgl
706
705
  },
707
706
  'pvrtc-rgba4unorm-webgl': {
708
- gl: GL.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
707
+ gl: 35842,
709
708
  f: texture_compression_pvrtc_webgl
710
709
  },
711
710
  'pvrtc-rbg2unorm-webgl': {
712
- gl: GL.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
711
+ gl: 35841,
713
712
  f: texture_compression_pvrtc_webgl
714
713
  },
715
714
  'pvrtc-rgba2unorm-webgl': {
716
- gl: GL.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
715
+ gl: 35843,
717
716
  f: texture_compression_pvrtc_webgl
718
717
  },
719
718
  'etc1-rbg-unorm-webgl': {
720
- gl: GL.COMPRESSED_RGB_ETC1_WEBGL,
719
+ gl: 36196,
721
720
  f: texture_compression_etc1_webgl
722
721
  },
723
722
  'atc-rgb-unorm-webgl': {
724
- gl: GL.COMPRESSED_RGB_ATC_WEBGL,
723
+ gl: 35986,
725
724
  f: texture_compression_atc_webgl
726
725
  },
727
726
  'atc-rgba-unorm-webgl': {
728
- gl: GL.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
727
+ gl: 35986,
729
728
  f: texture_compression_atc_webgl
730
729
  },
731
730
  'atc-rgbai-unorm-webgl': {
732
- gl: GL.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,
731
+ gl: 34798,
733
732
  f: texture_compression_atc_webgl
734
733
  }
735
734
  };
736
735
  const DATA_FORMAT_CHANNELS = {
737
- [GL.RED]: 1,
738
- [GL.RED_INTEGER]: 1,
739
- [GL.RG]: 2,
740
- [GL.RG_INTEGER]: 2,
741
- [GL.RGB]: 3,
742
- [GL.RGB_INTEGER]: 3,
743
- [GL.RGBA]: 4,
744
- [GL.RGBA_INTEGER]: 4,
745
- [GL.DEPTH_COMPONENT]: 1,
746
- [GL.DEPTH_STENCIL]: 1,
747
- [GL.ALPHA]: 1,
748
- [GL.LUMINANCE]: 1,
749
- [GL.LUMINANCE_ALPHA]: 2
736
+ [6403]: 1,
737
+ [36244]: 1,
738
+ [33319]: 2,
739
+ [33320]: 2,
740
+ [6407]: 3,
741
+ [36248]: 3,
742
+ [6408]: 4,
743
+ [36249]: 4,
744
+ [6402]: 1,
745
+ [34041]: 1,
746
+ [6406]: 1,
747
+ [6409]: 1,
748
+ [6410]: 2
750
749
  };
751
750
  const TYPE_SIZES = {
752
- [GL.FLOAT]: 4,
753
- [GL.UNSIGNED_INT]: 4,
754
- [GL.INT]: 4,
755
- [GL.UNSIGNED_SHORT]: 2,
756
- [GL.SHORT]: 2,
757
- [GL.HALF_FLOAT]: 2,
758
- [GL.BYTE]: 1,
759
- [GL.UNSIGNED_BYTE]: 1
751
+ [5126]: 4,
752
+ [5125]: 4,
753
+ [5124]: 4,
754
+ [5123]: 2,
755
+ [5122]: 2,
756
+ [5131]: 2,
757
+ [5120]: 1,
758
+ [5121]: 1
760
759
  };
761
760
  export function isTextureFormatSupported(gl, formatOrGL) {
762
761
  const format = convertGLToTextureFormat(formatOrGL);
@@ -854,7 +853,7 @@ export function getWebGLTextureParameters(formatOrGL, isWebGL2) {
854
853
  return {
855
854
  format: webglFormat,
856
855
  dataFormat: getWebGLPixelDataFormat(decoded.format, decoded.integer, decoded.normalized, webglFormat),
857
- type: decoded.dataType ? getGLFromVertexType(decoded.dataType) : GL.UNSIGNED_BYTE,
856
+ type: decoded.dataType ? getGLFromVertexType(decoded.dataType) : 5121,
858
857
  compressed: decoded.compressed
859
858
  };
860
859
  }
@@ -866,25 +865,25 @@ export function getDepthStencilAttachmentWebGL(format) {
866
865
  return info.attachment;
867
866
  }
868
867
  export function _checkFloat32ColorAttachment(gl) {
869
- let internalFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gl.RGBA;
870
- let srcFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : GL.RGBA;
871
- let srcType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : GL.UNSIGNED_BYTE;
868
+ let internalFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6408;
869
+ let srcFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6408;
870
+ let srcType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5121;
872
871
  let texture = null;
873
872
  let framebuffer = null;
874
873
  try {
875
874
  texture = gl.createTexture();
876
- gl.bindTexture(GL.TEXTURE_2D, texture);
875
+ gl.bindTexture(3553, texture);
877
876
  const level = 0;
878
877
  const width = 1;
879
878
  const height = 1;
880
879
  const border = 0;
881
880
  const pixel = new Uint8Array([0, 0, 255, 255]);
882
- gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, srcFormat, srcType, pixel);
881
+ gl.texImage2D(3553, level, internalFormat, width, height, border, srcFormat, srcType, pixel);
883
882
  framebuffer = gl.createFramebuffer();
884
- gl.bindFramebuffer(GL.FRAMEBUFFER, framebuffer);
885
- gl.framebufferTexture2D(GL.FRAMEBUFFER, GL.COLOR_ATTACHMENT0, GL.TEXTURE_2D, texture, 0);
886
- const status = gl.checkFramebufferStatus(GL.FRAMEBUFFER) === GL.FRAMEBUFFER_COMPLETE;
887
- gl.bindTexture(GL.TEXTURE_2D, null);
883
+ gl.bindFramebuffer(36160, framebuffer);
884
+ gl.framebufferTexture2D(36160, 36064, 3553, texture, 0);
885
+ const status = gl.checkFramebufferStatus(36160) === 36053;
886
+ gl.bindTexture(3553, null);
888
887
  return status;
889
888
  } finally {
890
889
  gl.deleteTexture(texture);
@@ -899,20 +898,20 @@ export function getTextureFormatBytesPerPixel(formatOrGL, isWebGL2) {
899
898
  return channels * channelSize;
900
899
  }
901
900
  function getWebGLPixelDataFormat(dataFormat, integer, normalized, format) {
902
- if (format === GL.RGBA || format === GL.RGB) {
901
+ if (format === 6408 || format === 6407) {
903
902
  return format;
904
903
  }
905
904
  switch (dataFormat) {
906
905
  case 'r':
907
- return integer && !normalized ? GL.RED_INTEGER : GL.RED;
906
+ return integer && !normalized ? 36244 : 6403;
908
907
  case 'rg':
909
- return integer && !normalized ? GL.RG_INTEGER : GL.RG;
908
+ return integer && !normalized ? 33320 : 33319;
910
909
  case 'rgb':
911
- return integer && !normalized ? GL.RGB_INTEGER : GL.RGB;
910
+ return integer && !normalized ? 36248 : 6407;
912
911
  case 'rgba':
913
- return integer && !normalized ? GL.RGBA_INTEGER : GL.RGBA;
912
+ return integer && !normalized ? 36249 : 6408;
914
913
  default:
915
- return GL.RGBA;
914
+ return 6408;
916
915
  }
917
916
  }
918
917
  //# sourceMappingURL=texture-formats.js.map