@luma.gl/constants 9.0.0-beta.5 → 9.0.0-beta.6
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.
- package/dist/bundle.d.ts +1 -1
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +1 -1
- package/dist/dist.dev.js +33 -50
- package/dist/index.cjs +33 -50
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/webgl-constants.d.ts +57 -66
- package/dist/webgl-constants.d.ts.map +1 -1
- package/dist/webgl-constants.js +62 -76
- package/dist/webgl-types.d.ts +276 -4
- package/dist/webgl-types.d.ts.map +1 -1
- package/dist/webgl-types.js +1 -1
- package/dist.min.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +6 -2
- package/src/webgl-constants.ts +95 -112
- package/src/webgl-types.ts +434 -15
package/src/webgl-types.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type NumberArray = number[] | TypedArray;
|
|
|
11
11
|
export type NumericArray = TypedArray | number[];
|
|
12
12
|
|
|
13
13
|
/** TypeScript type covering all typed arrays */
|
|
14
|
+
|
|
14
15
|
export type TypedArray =
|
|
15
16
|
| Int8Array
|
|
16
17
|
| Uint8Array
|
|
@@ -27,6 +28,22 @@ export type TypedArray =
|
|
|
27
28
|
/** We don't know the type of Framebuffer at this stage */
|
|
28
29
|
type Framebuffer = unknown;
|
|
29
30
|
|
|
31
|
+
/** All possible texture targets */
|
|
32
|
+
export type GLTextureTarget =
|
|
33
|
+
| GL.TEXTURE_2D
|
|
34
|
+
| GL.TEXTURE_CUBE_MAP
|
|
35
|
+
| GL.TEXTURE_2D_ARRAY
|
|
36
|
+
| GL.TEXTURE_3D;
|
|
37
|
+
|
|
38
|
+
/** All possible cube face targets for textImage2D */
|
|
39
|
+
export type GLTextureCubeMapTarget =
|
|
40
|
+
| GL.TEXTURE_CUBE_MAP_POSITIVE_X
|
|
41
|
+
| GL.TEXTURE_CUBE_MAP_NEGATIVE_X
|
|
42
|
+
| GL.TEXTURE_CUBE_MAP_POSITIVE_Y
|
|
43
|
+
| GL.TEXTURE_CUBE_MAP_NEGATIVE_Y
|
|
44
|
+
| GL.TEXTURE_CUBE_MAP_POSITIVE_Z
|
|
45
|
+
| GL.TEXTURE_CUBE_MAP_NEGATIVE_Z;
|
|
46
|
+
|
|
30
47
|
/** Rendering primitives. Constants passed to drawElements() or drawArrays() to specify what kind of primitive to render. */
|
|
31
48
|
export type GLPrimitiveTopology =
|
|
32
49
|
| GL.POINTS
|
|
@@ -50,9 +67,9 @@ export type GLDataType =
|
|
|
50
67
|
| GL.SHORT
|
|
51
68
|
| GL.INT;
|
|
52
69
|
|
|
53
|
-
/** Pixel Type */
|
|
70
|
+
/** Pixel Data Type */
|
|
54
71
|
export type GLPixelType =
|
|
55
|
-
|
|
|
72
|
+
| GLDataType
|
|
56
73
|
| GL.UNSIGNED_SHORT_5_6_5
|
|
57
74
|
| GL.UNSIGNED_SHORT_4_4_4_4
|
|
58
75
|
| GL.UNSIGNED_SHORT_5_5_5_1;
|
|
@@ -60,7 +77,7 @@ export type GLPixelType =
|
|
|
60
77
|
/** Uniform Type */
|
|
61
78
|
export type GLUniformType = GLSamplerType | GLCompositeType;
|
|
62
79
|
|
|
63
|
-
/**
|
|
80
|
+
/**
|
|
64
81
|
* Sampler uniform type
|
|
65
82
|
* @note These are all the valid sampler types used with `gl.uniform1i((location, value)`
|
|
66
83
|
*/
|
|
@@ -81,11 +98,11 @@ export type GLSamplerType =
|
|
|
81
98
|
| GL.UNSIGNED_INT_SAMPLER_CUBE
|
|
82
99
|
| GL.UNSIGNED_INT_SAMPLER_2D_ARRAY;
|
|
83
100
|
|
|
84
|
-
/**
|
|
85
|
-
* Composite types table
|
|
86
|
-
* @note These are all the valid non-sampler uniform types,
|
|
101
|
+
/**
|
|
102
|
+
* Composite types table
|
|
103
|
+
* @note These are all the valid non-sampler uniform types,
|
|
87
104
|
* Different `gl.uniformXXX(location, value)` functions must be used depending on which composite type is being set.
|
|
88
|
-
*/
|
|
105
|
+
*/
|
|
89
106
|
export type GLCompositeType =
|
|
90
107
|
| GL.FLOAT
|
|
91
108
|
| GL.FLOAT_VEC2
|
|
@@ -113,7 +130,7 @@ export type GLCompositeType =
|
|
|
113
130
|
| GL.FLOAT_MAT4x3
|
|
114
131
|
| GL.FLOAT_MAT4;
|
|
115
132
|
|
|
116
|
-
/**
|
|
133
|
+
/**
|
|
117
134
|
* Depth or stencil tests
|
|
118
135
|
* Constants passed to WebGLRenderingContext.depthFunc() or WebGLRenderingContext.stencilFunc().
|
|
119
136
|
*/
|
|
@@ -131,8 +148,8 @@ export type GLBlendEquation =
|
|
|
131
148
|
| GL.FUNC_ADD
|
|
132
149
|
| GL.FUNC_SUBTRACT
|
|
133
150
|
| GL.FUNC_REVERSE_SUBTRACT
|
|
134
|
-
| GL.
|
|
135
|
-
| GL.
|
|
151
|
+
| GL.MIN
|
|
152
|
+
| GL.MAX;
|
|
136
153
|
|
|
137
154
|
export type GLBlendFunction =
|
|
138
155
|
| GL.ZERO
|
|
@@ -264,15 +281,11 @@ export type GLValueParameters = {
|
|
|
264
281
|
[GL.STENCIL_BACK_PASS_DEPTH_PASS]?: GLStencilOp;
|
|
265
282
|
[GL.VIEWPORT]?: [number, number, number, number] | NumberArray;
|
|
266
283
|
|
|
267
|
-
// WEBGL1 PIXEL PACK/UNPACK MODES
|
|
268
284
|
[GL.PACK_ALIGNMENT]?: number;
|
|
269
285
|
[GL.UNPACK_ALIGNMENT]?: number;
|
|
270
286
|
[GL.UNPACK_FLIP_Y_WEBGL]?: boolean;
|
|
271
287
|
[GL.UNPACK_PREMULTIPLY_ALPHA_WEBGL]?: boolean;
|
|
272
288
|
[GL.UNPACK_COLORSPACE_CONVERSION_WEBGL]?: GL.NONE | GL.BROWSER_DEFAULT_WEBGL;
|
|
273
|
-
|
|
274
|
-
// WEBGL2 PIXEL PACK/UNPACK MODES
|
|
275
|
-
// RASTERIZER_DISCARD ...
|
|
276
289
|
[GL.PACK_ROW_LENGTH]?: number;
|
|
277
290
|
[GL.PACK_SKIP_PIXELS]?: number;
|
|
278
291
|
[GL.PACK_SKIP_ROWS]?: number;
|
|
@@ -284,7 +297,7 @@ export type GLValueParameters = {
|
|
|
284
297
|
[GL.UNPACK_SKIP_IMAGES]?: number;
|
|
285
298
|
};
|
|
286
299
|
|
|
287
|
-
/**
|
|
300
|
+
/**
|
|
288
301
|
* Function style WebGL parameters used by luma.gl
|
|
289
302
|
* @todo Should perhaps be defined in webgl module
|
|
290
303
|
*/
|
|
@@ -346,3 +359,409 @@ export type GLFunctionParameters = {
|
|
|
346
359
|
|
|
347
360
|
/** WebGL style parameters object (with both GL constants and function style fields) */
|
|
348
361
|
export type GLParameters = GLValueParameters & GLFunctionParameters;
|
|
362
|
+
|
|
363
|
+
/** WebGL context limits */
|
|
364
|
+
export type GLLimits = {
|
|
365
|
+
[GL.ALIASED_LINE_WIDTH_RANGE]: [number, number];
|
|
366
|
+
[GL.ALIASED_POINT_SIZE_RANGE]: [number, number];
|
|
367
|
+
[GL.MAX_TEXTURE_SIZE]: number;
|
|
368
|
+
[GL.MAX_CUBE_MAP_TEXTURE_SIZE]: number;
|
|
369
|
+
[GL.MAX_TEXTURE_IMAGE_UNITS]: number;
|
|
370
|
+
[GL.MAX_COMBINED_TEXTURE_IMAGE_UNITS]: number;
|
|
371
|
+
[GL.MAX_VERTEX_TEXTURE_IMAGE_UNITS]: number;
|
|
372
|
+
[GL.MAX_RENDERBUFFER_SIZE]: number;
|
|
373
|
+
[GL.MAX_VARYING_VECTORS]: number;
|
|
374
|
+
[GL.MAX_VERTEX_ATTRIBS]: number;
|
|
375
|
+
[GL.MAX_VERTEX_UNIFORM_VECTORS]: number;
|
|
376
|
+
[GL.MAX_FRAGMENT_UNIFORM_VECTORS]: number;
|
|
377
|
+
[GL.MAX_VIEWPORT_DIMS]: [number, number];
|
|
378
|
+
|
|
379
|
+
// Extensions
|
|
380
|
+
[GL.MAX_TEXTURE_MAX_ANISOTROPY_EXT]: number;
|
|
381
|
+
|
|
382
|
+
// WebGL2 Limits
|
|
383
|
+
[GL.MAX_3D_TEXTURE_SIZE]: number;
|
|
384
|
+
[GL.MAX_ARRAY_TEXTURE_LAYERS]: number;
|
|
385
|
+
// [GL.MAX_CLIENT_WAIT_TIMEOUT_WEBGL]: number;
|
|
386
|
+
[GL.MAX_COLOR_ATTACHMENTS]: number;
|
|
387
|
+
[GL.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS]: number;
|
|
388
|
+
[GL.MAX_COMBINED_UNIFORM_BLOCKS]: number;
|
|
389
|
+
[GL.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS]: number;
|
|
390
|
+
[GL.MAX_DRAW_BUFFERS]: number;
|
|
391
|
+
[GL.MAX_ELEMENT_INDEX]: number;
|
|
392
|
+
[GL.MAX_ELEMENTS_INDICES]: number;
|
|
393
|
+
[GL.MAX_ELEMENTS_VERTICES]: number;
|
|
394
|
+
[GL.MAX_FRAGMENT_INPUT_COMPONENTS]: number;
|
|
395
|
+
[GL.MAX_FRAGMENT_UNIFORM_BLOCKS]: number;
|
|
396
|
+
[GL.MAX_FRAGMENT_UNIFORM_COMPONENTS]: number;
|
|
397
|
+
[GL.MAX_SAMPLES]: number;
|
|
398
|
+
// [GL.MAX_SERVER_WAIT_TIMEOUT]: number;
|
|
399
|
+
[GL.MAX_TEXTURE_LOD_BIAS]: number;
|
|
400
|
+
[GL.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS]: number;
|
|
401
|
+
[GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS]: number;
|
|
402
|
+
[GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS]: number;
|
|
403
|
+
[GL.MAX_UNIFORM_BLOCK_SIZE]: number;
|
|
404
|
+
[GL.MAX_UNIFORM_BUFFER_BINDINGS]: number;
|
|
405
|
+
[GL.MAX_VARYING_COMPONENTS]: number;
|
|
406
|
+
[GL.MAX_VERTEX_OUTPUT_COMPONENTS]: number;
|
|
407
|
+
[GL.MAX_VERTEX_UNIFORM_BLOCKS]: number;
|
|
408
|
+
[GL.MAX_VERTEX_UNIFORM_COMPONENTS]: number;
|
|
409
|
+
[GL.MIN_PROGRAM_TEXEL_OFFSET]: number;
|
|
410
|
+
[GL.MAX_PROGRAM_TEXEL_OFFSET]: number;
|
|
411
|
+
[GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT]: number;
|
|
412
|
+
|
|
413
|
+
// EXTENSIONS
|
|
414
|
+
/** Max clip distances */
|
|
415
|
+
MAX_CLIP_DISTANCES_WEBGL: number;
|
|
416
|
+
/** Max cull distances */
|
|
417
|
+
MAX_CULL_DISTANCES_WEBGL: number;
|
|
418
|
+
/** Max clip and cull distances */
|
|
419
|
+
MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL: number;
|
|
420
|
+
MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL: number;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
/** WebGL2 Extensions */
|
|
424
|
+
export type GLExtensions = {
|
|
425
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_color_buffer_float */
|
|
426
|
+
EXT_color_buffer_float?: EXT_color_buffer_float | null;
|
|
427
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_color_buffer_half_float */
|
|
428
|
+
EXT_color_buffer_half_float?: EXT_color_buffer_half_float | null;
|
|
429
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc */
|
|
430
|
+
EXT_texture_compression_bptc?: EXT_texture_compression_bptc | null;
|
|
431
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc */
|
|
432
|
+
EXT_texture_compression_rgtc?: EXT_texture_compression_rgtc | null;
|
|
433
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_texture_filter_anisotropic */
|
|
434
|
+
EXT_texture_filter_anisotropic?: EXT_texture_filter_anisotropic | null;
|
|
435
|
+
/** https://registry.khronos.org/webgl/extensions/KHR_parallel_shader_compile */
|
|
436
|
+
KHR_parallel_shader_compile?: KHR_parallel_shader_compile | null;
|
|
437
|
+
/** https://registry.khronos.org/webgl/extensions/OES_fbo_render_mipmap */
|
|
438
|
+
OES_fbo_render_mipmap?: OES_fbo_render_mipmap | null;
|
|
439
|
+
/** https://registry.khronos.org/webgl/extensions/OES_texture_float */
|
|
440
|
+
OES_texture_float?: OES_texture_float | null;
|
|
441
|
+
/** https://registry.khronos.org/webgl/extensions/OES_texture_float_linear */
|
|
442
|
+
OES_texture_float_linear?: OES_texture_float_linear | null;
|
|
443
|
+
/** https://registry.khronos.org/webgl/extensions/OES_texture_half_float */
|
|
444
|
+
OES_texture_half_float?: OES_texture_half_float | null;
|
|
445
|
+
/** https://registry.khronos.org/webgl/extensions/OES_texture_half_float_linear */
|
|
446
|
+
OES_texture_half_float_linear?: OES_texture_half_float_linear | null;
|
|
447
|
+
/** https://registry.khronos.org/webgl/extensions/OES_vertex_array_object */
|
|
448
|
+
OES_vertex_array_object?: OES_vertex_array_object | null;
|
|
449
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_float_blend */
|
|
450
|
+
EXT_float_blend?: EXT_float_blend | null;
|
|
451
|
+
/** https://registry.khronos.org/webgl/extensions/OVR_multiview2 */
|
|
452
|
+
OVR_multiview2?: OVR_multiview2 | null;
|
|
453
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc */
|
|
454
|
+
WEBGL_compressed_texture_astc?: WEBGL_compressed_texture_astc | null;
|
|
455
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc */
|
|
456
|
+
WEBGL_compressed_texture_etc?: WEBGL_compressed_texture_etc | null;
|
|
457
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc1 */
|
|
458
|
+
WEBGL_compressed_texture_etc1?: WEBGL_compressed_texture_etc1 | null;
|
|
459
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc */
|
|
460
|
+
WEBGL_compressed_texture_pvrtc?: WEBGL_compressed_texture_pvrtc | null;
|
|
461
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc */
|
|
462
|
+
WEBGL_compressed_texture_s3tc?: WEBGL_compressed_texture_s3tc | null;
|
|
463
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb */
|
|
464
|
+
WEBGL_compressed_texture_s3tc_srgb?: WEBGL_compressed_texture_s3tc_srgb | null;
|
|
465
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_debug_renderer_info */
|
|
466
|
+
WEBGL_debug_renderer_info?: WEBGL_debug_renderer_info | null;
|
|
467
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_debug_shaders */
|
|
468
|
+
WEBGL_debug_shaders?: WEBGL_debug_shaders | null;
|
|
469
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_lose_context */
|
|
470
|
+
WEBGL_lose_context?: WEBGL_lose_context | null;
|
|
471
|
+
|
|
472
|
+
// Predefined typescript types not available for the following extensions
|
|
473
|
+
|
|
474
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_norm16/ */
|
|
475
|
+
EXT_norm16?: EXT_norm16 | null;
|
|
476
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_snorm/ */
|
|
477
|
+
EXT_snorm?: EXT_snorm | null;
|
|
478
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_render_shared_exponent/ */
|
|
479
|
+
WEBGL_render_shared_exponent?: WEBGL_render_shared_exponent | null;
|
|
480
|
+
|
|
481
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_depth_clamp/ */
|
|
482
|
+
EXT_depth_clamp?: EXT_depth_clamp | null;
|
|
483
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_provoking_vertex/ */
|
|
484
|
+
WEBGL_provoking_vertex?: WEBGL_provoking_vertex | null;
|
|
485
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_polygon_mode/ */
|
|
486
|
+
WEBGL_polygon_mode?: WEBGL_polygon_mode | null;
|
|
487
|
+
|
|
488
|
+
/** WEBGL_clip_cull_distance https://registry.khronos.org/webgl/extensions/WEBGL_clip_cull_distance/ */
|
|
489
|
+
WEBGL_clip_cull_distance?: WEBGL_clip_cull_distance | null;
|
|
490
|
+
|
|
491
|
+
/** NV_shader_noperspective_interpolation https://registry.khronos.org/webgl/extensions/NV_shader_noperspective_interpolation/ */
|
|
492
|
+
NV_shader_noperspective_interpolation?: NV_shader_noperspective_interpolation | null;
|
|
493
|
+
|
|
494
|
+
/** EXT_conservative_depth https://registry.khronos.org/webgl/extensions/EXT_conservative_depth/ */
|
|
495
|
+
EXT_conservative_depth?: EXT_conservative_depth | null;
|
|
496
|
+
|
|
497
|
+
/** OES_sample_variables https://registry.khronos.org/webgl/extensions/OES_sample_variables/ */
|
|
498
|
+
OES_sample_variables?: OES_sample_variables | null;
|
|
499
|
+
|
|
500
|
+
/** EXT_polygon_offset_clamp https://registry.khronos.org/webgl/extensions/EXT_polygon_offset_clamp/ */
|
|
501
|
+
EXT_polygon_offset_clamp?: EXT_polygon_offset_clamp | null;
|
|
502
|
+
|
|
503
|
+
/** EXT_clip_control https://registry.khronos.org/webgl/extensions/EXT_clip_control/ */
|
|
504
|
+
EXT_clip_control?: EXT_clip_control | null;
|
|
505
|
+
|
|
506
|
+
/** EXT_texture_mirror_clamp_to_edge https://registry.khronos.org/webgl/extensions/EXT_texture_mirror_clamp_to_edge/ */
|
|
507
|
+
EXT_texture_mirror_clamp_to_edge?: EXT_texture_mirror_clamp_to_edge | null;
|
|
508
|
+
/** EXT_texture_mirror_clamp_to_edge https://registry.khronos.org/webgl/extensions/EXT_texture_mirror_clamp_to_edge/ */
|
|
509
|
+
WEBGL_stencil_texturing?: WEBGL_stencil_texturing | null;
|
|
510
|
+
|
|
511
|
+
/** WEBGL_blend_func_extended https://registry.khronos.org/webgl/extensions/WEBGL_blend_func_extended/ */
|
|
512
|
+
WEBGL_blend_func_extended?: WEBGL_blend_func_extended | null;
|
|
513
|
+
|
|
514
|
+
/** OES_draw_buffers_indexed https://registry.khronos.org/webgl/extensions/OES_draw_buffers_indexed/ */
|
|
515
|
+
OES_draw_buffers_indexed?: OES_draw_buffers_indexed | null;
|
|
516
|
+
|
|
517
|
+
/** WEBGL_draw_instanced_base_vertex_base_instance https://registry.khronos.org/webgl/extensions/WEBGL_draw_instanced_base_vertex_base_instance/ */
|
|
518
|
+
WEBGL_draw_instanced_base_vertex_base_instance?: WEBGL_draw_instanced_base_vertex_base_instance | null;
|
|
519
|
+
/** WEBGL_multi_draw https://registry.khronos.org/webgl/extensions/WEBGL_multi_draw/ */
|
|
520
|
+
WEBGL_multi_draw?: WEBGL_multi_draw | null;
|
|
521
|
+
/** WEBGL_multi_draw_instanced_base_vertex_base_instance https://registry.khronos.org/webgl/extensions/WEBGL_multi_draw_instanced_base_vertex_base_instance/ */
|
|
522
|
+
WEBGL_multi_draw_instanced_base_vertex_base_instance?: WEBGL_multi_draw_instanced_base_vertex_base_instance | null;
|
|
523
|
+
/** WEBGL_shader_pixel_local_storage https://registry.khronos.org/webgl/extensions/WEBGL_shader_pixel_local_storage/ */
|
|
524
|
+
WEBGL_shader_pixel_local_storage?: WEBGL_shader_pixel_local_storage | null;
|
|
525
|
+
|
|
526
|
+
// WEBGL1 extensions (available as built-in WebGL 2 APIs)
|
|
527
|
+
// ANGLE_instanced_arrays?: ANGLE_instanced_arrays | null;
|
|
528
|
+
// EXT_blend_minmax?: EXT_blend_minmax | null;
|
|
529
|
+
// EXT_frag_depth?: EXT_frag_depth | null;
|
|
530
|
+
// EXT_sRGB?: EXT_sRGB | null;
|
|
531
|
+
// EXT_shader_texture_lod?: EXT_shader_texture_lod | null;
|
|
532
|
+
// OES_element_index_uint?: OES_element_index_uint | null;
|
|
533
|
+
// OES_standard_derivatives?: OES_standard_derivatives | null;
|
|
534
|
+
// WEBGL_color_buffer_float?: WEBGL_color_buffer_float | null;
|
|
535
|
+
// WEBGL_depth_texture?: WEBGL_depth_texture | null;
|
|
536
|
+
// WEBGL_draw_buffers?: WEBGL_draw_buffers | null;
|
|
537
|
+
// WEBGL_multi_draw?: WEBGL_multi_draw | null;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_norm16/ */
|
|
541
|
+
type EXT_norm16 = {
|
|
542
|
+
// Constants in GL enum
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_snorm/ */
|
|
546
|
+
type EXT_snorm = {
|
|
547
|
+
// Constants in GL enum
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_render_shared_exponent/ */
|
|
551
|
+
type WEBGL_render_shared_exponent = {
|
|
552
|
+
// Constants in GL enum
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
/** https://registry.khronos.org/webgl/extensions/EXT_depth_clamp/ */
|
|
556
|
+
type EXT_depth_clamp = {
|
|
557
|
+
// Constants in GL enum
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
/** https://registry.khronos.org/webgl/extensions/WEBGL_provoking_vertex/ */
|
|
561
|
+
type WEBGL_provoking_vertex = {
|
|
562
|
+
// Constants in GL enum
|
|
563
|
+
/** Set the provoking vertex */
|
|
564
|
+
provokingVertexWEBGL(
|
|
565
|
+
provokeMode: GL.FIRST_VERTEX_CONVENTION_WEBGL | GL.LAST_VERTEX_CONVENTION_WEBGL
|
|
566
|
+
): void;
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
/** WEBGL_polygon_mode https://registry.khronos.org/webgl/extensions/WEBGL_polygon_mode/ */
|
|
570
|
+
type WEBGL_polygon_mode = {
|
|
571
|
+
/** Set polygon mode of face to fill or line */
|
|
572
|
+
polygonModeWEBGL(face: GL.FRONT | GL.BACK, mode: GL.LINE_WEBGL | GL.FILL_WEBGL): void;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/** WEBGL_clip_cull_distance https://registry.khronos.org/webgl/extensions/WEBGL_clip_cull_distance/ */
|
|
576
|
+
type WEBGL_clip_cull_distance = {
|
|
577
|
+
/** Max clip distances */
|
|
578
|
+
MAX_CLIP_DISTANCES_WEBGL: 0x0d32;
|
|
579
|
+
/** Max cull distances */
|
|
580
|
+
MAX_CULL_DISTANCES_WEBGL: 0x82f9;
|
|
581
|
+
/** Max clip and cull distances */
|
|
582
|
+
MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL: 0x82fa;
|
|
583
|
+
|
|
584
|
+
/** Enable gl_ClipDistance[0] and gl_CullDistance[0] */
|
|
585
|
+
CLIP_DISTANCE0_WEBGL: 0x3000;
|
|
586
|
+
/** Enable gl_ClipDistance[1] and gl_CullDistance[1] */
|
|
587
|
+
CLIP_DISTANCE1_WEBGL: 0x3001;
|
|
588
|
+
/** Enable gl_ClipDistance[2] and gl_CullDistance[2] */
|
|
589
|
+
CLIP_DISTANCE2_WEBGL: 0x3002;
|
|
590
|
+
/** Enable gl_ClipDistance[3] and gl_CullDistance[3] */
|
|
591
|
+
CLIP_DISTANCE3_WEBGL: 0x3003;
|
|
592
|
+
/** Enable gl_ClipDistance[4] and gl_CullDistance[4] */
|
|
593
|
+
CLIP_DISTANCE4_WEBGL: 0x3004;
|
|
594
|
+
/** Enable gl_ClipDistance[5] and gl_CullDistance[5] */
|
|
595
|
+
CLIP_DISTANCE5_WEBGL: 0x3005;
|
|
596
|
+
/** Enable gl_ClipDistance[6] and gl_CullDistance[6] */
|
|
597
|
+
CLIP_DISTANCE6_WEBGL: 0x3006;
|
|
598
|
+
/** Enable gl_ClipDistance[7] and gl_CullDistance[7] */
|
|
599
|
+
CLIP_DISTANCE7_WEBGL: 0x3007;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/** NV_shader_noperspective_interpolation https://registry.khronos.org/webgl/extensions/NV_shader_noperspective_interpolation/ */
|
|
603
|
+
type NV_shader_noperspective_interpolation = {};
|
|
604
|
+
|
|
605
|
+
/** EXT_conservative_depth https://registry.khronos.org/webgl/extensions/EXT_conservative_depth/ */
|
|
606
|
+
type EXT_conservative_depth = {};
|
|
607
|
+
|
|
608
|
+
/** OES_sample_variables https://registry.khronos.org/webgl/extensions/OES_sample_variables/ */
|
|
609
|
+
type OES_sample_variables = {};
|
|
610
|
+
|
|
611
|
+
/** EXT_polygon_offset_clamp https://registry.khronos.org/webgl/extensions/EXT_polygon_offset_clamp/ */
|
|
612
|
+
type EXT_polygon_offset_clamp = {
|
|
613
|
+
POLYGON_OFFSET_CLAMP_EXT: 0x8e1b;
|
|
614
|
+
|
|
615
|
+
polygonOffsetClampEXT(factor: number, units: number, clamp: number): void;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
/** EXT_clip_control https://registry.khronos.org/webgl/extensions/EXT_clip_control/ */
|
|
619
|
+
type EXT_clip_control = {
|
|
620
|
+
LOWER_LEFT_EXT: 0x8ca1;
|
|
621
|
+
UPPER_LEFT_EXT: 0x8ca2;
|
|
622
|
+
|
|
623
|
+
NEGATIVE_ONE_TO_ONE_EXT: 0x935e;
|
|
624
|
+
ZERO_TO_ONE_EXT: 0x935f;
|
|
625
|
+
|
|
626
|
+
CLIP_ORIGIN_EXT: 0x935c;
|
|
627
|
+
CLIP_DEPTH_MODE_EXT: 0x935d;
|
|
628
|
+
|
|
629
|
+
clipControlEXT(origin: GL, depth: GL): void;
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
/** WEBGL_blend_func_extended https://registry.khronos.org/webgl/extensions/WEBGL_blend_func_extended/ */
|
|
633
|
+
type WEBGL_blend_func_extended = {
|
|
634
|
+
SRC1_COLOR_WEBGL: 0x88f9;
|
|
635
|
+
SRC1_ALPHA_WEBGL: 0x8589;
|
|
636
|
+
ONE_MINUS_SRC1_COLOR_WEBGL: 0x88fa;
|
|
637
|
+
ONE_MINUS_SRC1_ALPHA_WEBGL: 0x88fb;
|
|
638
|
+
MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL: 0x88fc;
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
/** OES_draw_buffers_indexed https://registry.khronos.org/webgl/extensions/OES_draw_buffers_indexed/ */
|
|
642
|
+
type OES_draw_buffers_indexed = {
|
|
643
|
+
/** Enables blending for an individual draw buffer */
|
|
644
|
+
enableiOES(target: GL, index: number): void;
|
|
645
|
+
/** Disables blending for an individual draw buffer */
|
|
646
|
+
disableiOES(target: GL, index: number): void;
|
|
647
|
+
/** Modifies blend equation for an individual draw buffer */
|
|
648
|
+
blendEquationiOES(buf: number, mode: GL): void;
|
|
649
|
+
/** Modifies blend equation for an individual draw buffer */
|
|
650
|
+
blendEquationSeparateiOES(buf: number, modeRGB: GL, modeAlpha: GL): void;
|
|
651
|
+
/** Modifies blend function for an individual draw buffer */
|
|
652
|
+
blendFunciOES(buf: number, src: GL, dst: GL): void;
|
|
653
|
+
/** Modifies blend function for an individual draw buffer */
|
|
654
|
+
blendFuncSeparateiOES(buf: number, srcRGB: GL, dstRGB: GL, srcAlpha: GL, dstAlpha: GL): void;
|
|
655
|
+
/** Modifies color mask for an individual draw buffer */
|
|
656
|
+
colorMaskiOES(buf: number, r: boolean, g: boolean, b: boolean, a: boolean): void;
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
/** EXT_texture_mirror_clamp_to_edge https://registry.khronos.org/webgl/extensions/EXT_texture_mirror_clamp_to_edge/ */
|
|
660
|
+
type EXT_texture_mirror_clamp_to_edge = {
|
|
661
|
+
MIRROR_CLAMP_TO_EDGE_EXT: 0x8743;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
/** WEBGL_stencil_texturing https://registry.khronos.org/webgl/extensions/WEBGL_stencil_texturing/ */
|
|
665
|
+
type WEBGL_stencil_texturing = {
|
|
666
|
+
DEPTH_STENCIL_TEXTURE_MODE_WEBGL: 0x90ea;
|
|
667
|
+
STENCIL_INDEX_WEBGL: 0x1901;
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
/** WEBGL_draw_instanced_base_vertex_base_instance https://registry.khronos.org/webgl/extensions/WEBGL_draw_instanced_base_vertex_base_instance/ */
|
|
671
|
+
type WEBGL_draw_instanced_base_vertex_base_instance = {
|
|
672
|
+
// drawArraysInstancedBaseInstanceWEBGL(
|
|
673
|
+
// GLenum mode, GLint first, GLsizei count,
|
|
674
|
+
// GLsizei instanceCount, GLuint baseInstance);
|
|
675
|
+
// drawElementsInstancedBaseVertexBaseInstanceWEBGL(
|
|
676
|
+
// GLenum mode, GLsizei count, GLenum type, GLintptr offset,
|
|
677
|
+
// GLsizei instanceCount, GLint baseVertex, GLuint baseInstance);
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
/** WEBGL_multi_draw https://registry.khronos.org/webgl/extensions/WEBGL_multi_draw/ */
|
|
681
|
+
type WEBGL_multi_draw = {
|
|
682
|
+
// multiDrawArraysWEBGL(
|
|
683
|
+
// GLenum mode,
|
|
684
|
+
// ([AllowShared] Int32Array or sequence<GLint>) firstsList, unsigned long long firstsOffset,
|
|
685
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
|
|
686
|
+
// GLsizei drawcount);
|
|
687
|
+
// multiDrawElementsWEBGL(
|
|
688
|
+
// GLenum mode,
|
|
689
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
|
|
690
|
+
// GLenum type,
|
|
691
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, unsigned long long offsetsOffset,
|
|
692
|
+
// GLsizei drawcount);
|
|
693
|
+
// multiDrawArraysInstancedWEBGL(
|
|
694
|
+
// GLenum mode,
|
|
695
|
+
// ([AllowShared] Int32Array or sequence<GLint>) firstsList, unsigned long long firstsOffset,
|
|
696
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
|
|
697
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, unsigned long long instanceCountsOffset,
|
|
698
|
+
// GLsizei drawcount);
|
|
699
|
+
// multiDrawElementsInstancedWEBGL(
|
|
700
|
+
// GLenum mode,
|
|
701
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
|
|
702
|
+
// GLenum type,
|
|
703
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, unsigned long long offsetsOffset,
|
|
704
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, unsigned long long instanceCountsOffset,
|
|
705
|
+
// GLsizei drawcount);
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
/** WEBGL_multi_draw_instanced_base_vertex_base_instance https://registry.khronos.org/webgl/extensions/WEBGL_multi_draw_instanced_base_vertex_base_instance/ */
|
|
709
|
+
type WEBGL_multi_draw_instanced_base_vertex_base_instance = {
|
|
710
|
+
// multiDrawArraysInstancedBaseInstanceWEBGL(
|
|
711
|
+
// GLenum mode,
|
|
712
|
+
// ([AllowShared] Int32Array or sequence<GLint>) firstsList, unsigned long long firstsOffset,
|
|
713
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
|
|
714
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, unsigned long long instanceCountsOffset,
|
|
715
|
+
// ([AllowShared] Uint32Array or sequence<GLuint>) baseInstancesList, unsigned long long baseInstancesOffset,
|
|
716
|
+
// GLsizei drawcount
|
|
717
|
+
// );
|
|
718
|
+
// multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(
|
|
719
|
+
// GLenum mode,
|
|
720
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
|
|
721
|
+
// GLenum type,
|
|
722
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, unsigned long long offsetsOffset,
|
|
723
|
+
// ([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, unsigned long long instanceCountsOffset,
|
|
724
|
+
// ([AllowShared] Int32Array or sequence<GLint>) baseVerticesList, unsigned long long baseVerticesOffset,
|
|
725
|
+
// ([AllowShared] Uint32Array or sequence<GLuint>) baseInstancesList, unsigned long long baseInstancesOffset,
|
|
726
|
+
// GLsizei drawcount
|
|
727
|
+
// );
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
/** WEBGL_shader_pixel_local_storage https://registry.khronos.org/webgl/extensions/WEBGL_shader_pixel_local_storage/ */
|
|
731
|
+
type WEBGL_shader_pixel_local_storage = {
|
|
732
|
+
MAX_PIXEL_LOCAL_STORAGE_PLANES_WEBGL: 0x96e0;
|
|
733
|
+
MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE_WEBGL: 0x96e1;
|
|
734
|
+
MAX_COMBINED_DRAW_BUFFERS_AND_PIXEL_LOCAL_STORAGE_PLANES_WEBGL: 0x96e2;
|
|
735
|
+
PIXEL_LOCAL_STORAGE_ACTIVE_PLANES_WEBGL: 0x96e3;
|
|
736
|
+
LOAD_OP_ZERO_WEBGL: 0x96e4;
|
|
737
|
+
LOAD_OP_CLEAR_WEBGL: 0x96e5;
|
|
738
|
+
LOAD_OP_LOAD_WEBGL: 0x96e6;
|
|
739
|
+
STORE_OP_STORE_WEBGL: 0x96e7;
|
|
740
|
+
PIXEL_LOCAL_FORMAT_WEBGL: 0x96e8;
|
|
741
|
+
PIXEL_LOCAL_TEXTURE_NAME_WEBGL: 0x96e9;
|
|
742
|
+
PIXEL_LOCAL_TEXTURE_LEVEL_WEBGL: 0x96ea;
|
|
743
|
+
PIXEL_LOCAL_TEXTURE_LAYER_WEBGL: 0x96eb;
|
|
744
|
+
PIXEL_LOCAL_CLEAR_VALUE_FLOAT_WEBGL: 0x96ec;
|
|
745
|
+
PIXEL_LOCAL_CLEAR_VALUE_INT_WEBGL: 0x96ed;
|
|
746
|
+
PIXEL_LOCAL_CLEAR_VALUE_UNSIGNED_INT_WEBGL: 0x96ee;
|
|
747
|
+
isCoherent(): boolean;
|
|
748
|
+
framebufferTexturePixelLocalStorageWEBGL(
|
|
749
|
+
plane: number,
|
|
750
|
+
texture: WebGLTexture,
|
|
751
|
+
level: number,
|
|
752
|
+
layer: number
|
|
753
|
+
): void;
|
|
754
|
+
// framebufferPixelLocalClearValuefvWEBGL(plane: number,
|
|
755
|
+
// Float32List value,
|
|
756
|
+
// optional unsigned long long srcOffset = 0): void;
|
|
757
|
+
// framebufferPixelLocalClearValueivWEBGL(plane: number,
|
|
758
|
+
// Int32List value,
|
|
759
|
+
// optional unsigned long long srcOffset = 0): void;
|
|
760
|
+
// framebufferPixelLocalClearValueuivWEBGL(plane: number,
|
|
761
|
+
// Uint32List value,
|
|
762
|
+
// optional unsigned long long srcOffset = 0): void;
|
|
763
|
+
beginPixelLocalStorageWEBGL(loadops: GL[]): void;
|
|
764
|
+
endPixelLocalStorageWEBGL(storeops: GL[]): void;
|
|
765
|
+
pixelLocalStorageBarrierWEBGL(): void;
|
|
766
|
+
getFramebufferPixelLocalStorageParameterWEBGL(plane: number, pname: GL): any;
|
|
767
|
+
};
|