@luma.gl/constants 9.0.0-beta.4 → 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/src/index.ts CHANGED
@@ -1,8 +1,14 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  // WebGL constants
2
- export {GL} from './constants-enum';
6
+ export {GL} from './webgl-constants';
3
7
 
4
8
  // WebGL types
5
9
  export type {
10
+ GLTextureTarget,
11
+ GLTextureCubeMapTarget,
6
12
  GLPrimitiveTopology,
7
13
  GLPrimitive,
8
14
  GLDataType,
@@ -17,5 +23,7 @@ export type {
17
23
  GLSamplerParameters,
18
24
  GLValueParameters,
19
25
  GLFunctionParameters,
20
- GLParameters
21
- } from './webgl-types';
26
+ GLParameters,
27
+ GLLimits,
28
+ GLExtensions
29
+ } from './webgl-types';
@@ -1,6 +1,10 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  /* eslint-disable key-spacing, max-len, no-inline-comments, camelcase */
2
6
 
3
- /**
7
+ /**
4
8
  * Standard WebGL, WebGL2 and extension constants (OpenGL constants)
5
9
  * @note (Most) of these constants are also defined on the WebGLRenderingContext interface.
6
10
  * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants
@@ -73,9 +77,9 @@ enum GLEnum {
73
77
  // Constants passed to blendEquation() or blendEquationSeparate() to control
74
78
  // how the blending is calculated (for both, RBG and alpha, or separately).
75
79
 
76
- /** Passed to blendEquation or blendEquationSeparate to set an addition blend function. */
77
- /** Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination). */
78
- /** Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source). */
80
+ /** Passed to blendEquation or blendEquationSeparate to set an addition blend function. */
81
+ /** Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination). */
82
+ /** Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source). */
79
83
  FUNC_ADD = 0x8006,
80
84
  FUNC_SUBTRACT = 0x800a,
81
85
  FUNC_REVERSE_SUBTRACT = 0x800b,
@@ -145,7 +149,7 @@ enum GLEnum {
145
149
  STENCIL_BACK_VALUE_MASK = 0x8ca4,
146
150
  STENCIL_BACK_WRITEMASK = 0x8ca5,
147
151
 
148
- /** An Int32Array with four elements for the current viewport dimensions. */
152
+ /** An Int32Array with four elements for the current viewport dimensions. */
149
153
  VIEWPORT = 0x0ba2,
150
154
  /** An Int32Array with four elements for the current scissor box dimensions. */
151
155
  SCISSOR_BOX = 0x0c10,
@@ -268,13 +272,13 @@ enum GLEnum {
268
272
  // Hints
269
273
  // Constants passed to hint()
270
274
 
271
- /** There is no preference for this behavior. */
275
+ /** There is no preference for this behavior. */
272
276
  DONT_CARE = 0x1100,
273
- /** The most efficient behavior should be used. */
277
+ /** The most efficient behavior should be used. */
274
278
  FASTEST = 0x1101,
275
- /** The most correct or the highest quality option should be used. */
279
+ /** The most correct or the highest quality option should be used. */
276
280
  NICEST = 0x1102,
277
- /** Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap(). */
281
+ /** Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap(). */
278
282
  GENERATE_MIPMAP_HINT = 0x8192,
279
283
 
280
284
  // Data types
@@ -331,7 +335,7 @@ enum GLEnum {
331
335
  MAX_VARYING_VECTORS = 0x8dfc,
332
336
  MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8b4d,
333
337
  MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8b4c,
334
- /** Implementation dependent number of maximum texture units. At least 8. */
338
+ /** Implementation dependent number of maximum texture units. At least 8. */
335
339
  MAX_TEXTURE_IMAGE_UNITS = 0x8872,
336
340
  MAX_FRAGMENT_UNIFORM_VECTORS = 0x8dfd,
337
341
  SHADER_TYPE = 0x8b4f,
@@ -618,9 +622,13 @@ enum GLEnum {
618
622
  // Queries
619
623
 
620
624
  CURRENT_QUERY = 0x8865,
625
+ /** Returns a GLuint containing the query result. */
621
626
  QUERY_RESULT = 0x8866,
627
+ /** Whether query result is available. */
622
628
  QUERY_RESULT_AVAILABLE = 0x8867,
629
+ /** Occlusion query (if drawing passed depth test) */
623
630
  ANY_SAMPLES_PASSED = 0x8c2f,
631
+ /** Occlusion query less accurate/faster version */
624
632
  ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8d6a,
625
633
 
626
634
  // Draw buffers
@@ -813,11 +821,6 @@ enum GLEnum {
813
821
 
814
822
  // Constants defined in WebGL extensions
815
823
 
816
- // ANGLE_instanced_arrays
817
-
818
- /** Describes the frequency divisor used for instanced rendering. */
819
- VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88fe,
820
-
821
824
  // WEBGL_debug_renderer_info
822
825
 
823
826
  /** Passed to getParameter to get the vendor string of the graphics driver. */
@@ -832,27 +835,16 @@ enum GLEnum {
832
835
  /** Passed to texParameter to set the desired maximum anisotropy for a texture. */
833
836
  TEXTURE_MAX_ANISOTROPY_EXT = 0x84fe,
834
837
 
835
- // EXT_sRGB
836
-
837
- /** Unsized sRGB format that leaves the precision up to the driver. */
838
- SRGB_EXT = 0x8c40,
839
- /** Unsized sRGB format with unsized alpha component. */
840
- SRGB_ALPHA_EXT = 0x8c42,
841
- /** Sized (8-bit) sRGB and alpha formats. */
842
- SRGB8_ALPHA8_EXT = 0x8c43,
843
- /** Returns the framebuffer color encoding. */
844
- FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210,
845
-
846
838
  // EXT_texture_norm16 - https://khronos.org/registry/webgl/extensions/EXT_texture_norm16/
847
839
 
848
- R16_EXT = 0x822A,
849
- RG16_EXT = 0x822C,
840
+ R16_EXT = 0x822a,
841
+ RG16_EXT = 0x822c,
850
842
  RGB16_EXT = 0x8054,
851
- RGBA16_EXT = 0x805B,
852
- R16_SNORM_EXT = 0x8F98,
853
- RG16_SNORM_EXT = 0x8F99,
854
- RGB16_SNORM_EXT = 0x8F9A,
855
- RGBA16_SNORM_EXT = 0x8F9B,
843
+ RGBA16_EXT = 0x805b,
844
+ R16_SNORM_EXT = 0x8f98,
845
+ RG16_SNORM_EXT = 0x8f99,
846
+ RGB16_SNORM_EXT = 0x8f9a,
847
+ RGBA16_SNORM_EXT = 0x8f9b,
856
848
 
857
849
  // WEBGL_compressed_texture_s3tc (BC1, BC2, BC3)
858
850
 
@@ -962,81 +954,6 @@ enum GLEnum {
962
954
  COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93dc,
963
955
  COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93dd,
964
956
 
965
- // WEBGL_depth_texture
966
-
967
- /** Unsigned integer type for 24-bit depth texture data. */
968
- UNSIGNED_INT_24_8_WEBGL = 0x84fa,
969
-
970
- // OES_texture_half_float
971
-
972
- /** Half floating-point type (16-bit). */
973
- HALF_FLOAT_OES = 0x8d61,
974
-
975
- // WEBGL_color_buffer_float
976
-
977
- /** RGBA 32-bit floating-point color-renderable format. */
978
- RGBA32F_EXT = 0x8814,
979
- /** RGB 32-bit floating-point color-renderable format. */
980
- RGB32F_EXT = 0x8815,
981
- FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211,
982
- UNSIGNED_NORMALIZED_EXT = 0x8c17,
983
-
984
- // EXT_blend_minmax
985
-
986
- /** Produces the minimum color components of the source and destination colors. */
987
- MIN_EXT = 0x8007,
988
- /** Produces the maximum color components of the source and destination colors. */
989
- MAX_EXT = 0x8008,
990
-
991
- // OES_standard_derivatives
992
-
993
- /** Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth */
994
- FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8b8b,
995
-
996
- // WEBGL_draw_buffers
997
-
998
- COLOR_ATTACHMENT0_WEBGL = 0x8ce0,
999
- COLOR_ATTACHMENT1_WEBGL = 0x8ce1,
1000
- COLOR_ATTACHMENT2_WEBGL = 0x8ce2,
1001
- COLOR_ATTACHMENT3_WEBGL = 0x8ce3,
1002
- COLOR_ATTACHMENT4_WEBGL = 0x8ce4,
1003
- COLOR_ATTACHMENT5_WEBGL = 0x8ce5,
1004
- COLOR_ATTACHMENT6_WEBGL = 0x8ce6,
1005
- COLOR_ATTACHMENT7_WEBGL = 0x8ce7,
1006
- COLOR_ATTACHMENT8_WEBGL = 0x8ce8,
1007
- COLOR_ATTACHMENT9_WEBGL = 0x8ce9,
1008
- COLOR_ATTACHMENT10_WEBGL = 0x8cea,
1009
- COLOR_ATTACHMENT11_WEBGL = 0x8ceb,
1010
- COLOR_ATTACHMENT12_WEBGL = 0x8cec,
1011
- COLOR_ATTACHMENT13_WEBGL = 0x8ced,
1012
- COLOR_ATTACHMENT14_WEBGL = 0x8cee,
1013
- COLOR_ATTACHMENT15_WEBGL = 0x8cef,
1014
- DRAW_BUFFER0_WEBGL = 0x8825,
1015
- DRAW_BUFFER1_WEBGL = 0x8826,
1016
- DRAW_BUFFER2_WEBGL = 0x8827,
1017
- DRAW_BUFFER3_WEBGL = 0x8828,
1018
- DRAW_BUFFER4_WEBGL = 0x8829,
1019
- DRAW_BUFFER5_WEBGL = 0x882a,
1020
- DRAW_BUFFER6_WEBGL = 0x882b,
1021
- DRAW_BUFFER7_WEBGL = 0x882c,
1022
- DRAW_BUFFER8_WEBGL = 0x882d,
1023
- DRAW_BUFFER9_WEBGL = 0x882e,
1024
- DRAW_BUFFER10_WEBGL = 0x882f,
1025
- DRAW_BUFFER11_WEBGL = 0x8830,
1026
- DRAW_BUFFER12_WEBGL = 0x8831,
1027
- DRAW_BUFFER13_WEBGL = 0x8832,
1028
- DRAW_BUFFER14_WEBGL = 0x8833,
1029
- DRAW_BUFFER15_WEBGL = 0x8834,
1030
- /** Maximum number of framebuffer color attachment points */
1031
- MAX_COLOR_ATTACHMENTS_WEBGL = 0x8cdf,
1032
- /** Maximum number of draw buffers */
1033
- MAX_DRAW_BUFFERS_WEBGL = 0x8824,
1034
-
1035
- // OES_vertex_array_object
1036
-
1037
- /** The bound vertex array object (VAO). */
1038
- VERTEX_ARRAY_BINDING_OES = 0x85b5,
1039
-
1040
957
  // EXT_disjoint_timer_query
1041
958
 
1042
959
  /** The number of bits used to hold the query result for the given target. */
@@ -1051,8 +968,83 @@ enum GLEnum {
1051
968
  TIME_ELAPSED_EXT = 0x88bf,
1052
969
  /** The current time. */
1053
970
  TIMESTAMP_EXT = 0x8e28,
1054
- /** A Boolean indicating whether or not the GPU performed any disjoint operation. */
1055
- GPU_DISJOINT_EXT = 0x8fbb // A Boolean indicating whether or not the GPU performed any disjoint operation.
971
+ /** A Boolean indicating whether or not the GPU performed any disjoint operation (lost context) */
972
+ GPU_DISJOINT_EXT = 0x8fbb,
973
+
974
+ // KHR_parallel_shader_compile https://registry.khronos.org/webgl/extensions/KHR_parallel_shader_compile
975
+
976
+ /** a non-blocking poll operation, so that compile/link status availability can be queried without potentially incurring stalls */
977
+ COMPLETION_STATUS_KHR = 0x91b1,
978
+
979
+ // EXT_depth_clamp https://registry.khronos.org/webgl/extensions/EXT_depth_clamp/
980
+
981
+ /** Disables depth clipping */
982
+ DEPTH_CLAMP_EXT = 0x864f,
983
+
984
+ // WEBGL_provoking_vertex https://registry.khronos.org/webgl/extensions/WEBGL_provoking_vertex/
985
+
986
+ /** Values of first vertex in primitive are used for flat shading */
987
+ FIRST_VERTEX_CONVENTION_WEBGL = 0x8e4d,
988
+ /** Values of first vertex in primitive are used for flat shading */
989
+ LAST_VERTEX_CONVENTION_WEBGL = 0x8e4e, // default
990
+ /** Controls which vertex in primitive is used for flat shading */
991
+ PROVOKING_VERTEX_WEBL = 0x8e4f,
992
+
993
+ // WEBGL_polygon_mode https://registry.khronos.org/webgl/extensions/WEBGL_polygon_mode/
994
+
995
+ POLYGON_MODE_WEBGL = 0x0b40,
996
+ POLYGON_OFFSET_LINE_WEBGL = 0x2a02,
997
+ LINE_WEBGL = 0x1b01,
998
+ FILL_WEBGL = 0x1b02,
999
+
1000
+ // WEBGL_clip_cull_distance https://registry.khronos.org/webgl/extensions/WEBGL_clip_cull_distance/
1001
+
1002
+ /** Max clip distances */
1003
+ MAX_CLIP_DISTANCES_WEBGL = 0x0d32,
1004
+ /** Max cull distances */
1005
+ MAX_CULL_DISTANCES_WEBGL = 0x82f9,
1006
+ /** Max clip and cull distances */
1007
+ MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL = 0x82fa,
1008
+
1009
+ /** Enable gl_ClipDistance[0] and gl_CullDistance[0] */
1010
+ CLIP_DISTANCE0_WEBGL = 0x3000,
1011
+ /** Enable gl_ClipDistance[1] and gl_CullDistance[1] */
1012
+ CLIP_DISTANCE1_WEBGL = 0x3001,
1013
+ /** Enable gl_ClipDistance[2] and gl_CullDistance[2] */
1014
+ CLIP_DISTANCE2_WEBGL = 0x3002,
1015
+ /** Enable gl_ClipDistance[3] and gl_CullDistance[3] */
1016
+ CLIP_DISTANCE3_WEBGL = 0x3003,
1017
+ /** Enable gl_ClipDistance[4] and gl_CullDistance[4] */
1018
+ CLIP_DISTANCE4_WEBGL = 0x3004,
1019
+ /** Enable gl_ClipDistance[5] and gl_CullDistance[5] */
1020
+ CLIP_DISTANCE5_WEBGL = 0x3005,
1021
+ /** Enable gl_ClipDistance[6] and gl_CullDistance[6] */
1022
+ CLIP_DISTANCE6_WEBGL = 0x3006,
1023
+ /** Enable gl_ClipDistance[7] and gl_CullDistance[7] */
1024
+ CLIP_DISTANCE7_WEBGL = 0x3007,
1025
+
1026
+ /** EXT_polygon_offset_clamp https://registry.khronos.org/webgl/extensions/EXT_polygon_offset_clamp/ */
1027
+ POLYGON_OFFSET_CLAMP_EXT = 0x8e1b,
1028
+
1029
+ /** EXT_clip_control https://registry.khronos.org/webgl/extensions/EXT_clip_control/ */
1030
+ LOWER_LEFT_EXT = 0x8ca1,
1031
+ UPPER_LEFT_EXT = 0x8ca2,
1032
+
1033
+ NEGATIVE_ONE_TO_ONE_EXT = 0x935e,
1034
+ ZERO_TO_ONE_EXT = 0x935f,
1035
+
1036
+ CLIP_ORIGIN_EXT = 0x935c,
1037
+ CLIP_DEPTH_MODE_EXT = 0x935d,
1038
+
1039
+ /** WEBGL_blend_func_extended https://registry.khronos.org/webgl/extensions/WEBGL_blend_func_extended/ */
1040
+ SRC1_COLOR_WEBGL = 0x88f9,
1041
+ SRC1_ALPHA_WEBGL = 0x8589,
1042
+ ONE_MINUS_SRC1_COLOR_WEBGL = 0x88fa,
1043
+ ONE_MINUS_SRC1_ALPHA_WEBGL = 0x88fb,
1044
+ MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL = 0x88fc,
1045
+
1046
+ /** EXT_texture_mirror_clamp_to_edge https://registry.khronos.org/webgl/extensions/EXT_texture_mirror_clamp_to_edge/ */
1047
+ MIRROR_CLAMP_TO_EDGE_EXT = 0x8743
1056
1048
  }
1057
1049
 
1058
1050
  export {GLEnum as GL};