@luma.gl/webgl 9.0.0-alpha.23 → 9.0.0-alpha.25

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 (151) hide show
  1. package/dist/adapter/converters/device-parameters.d.ts +1 -1
  2. package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
  3. package/dist/adapter/converters/device-parameters.js +1 -1
  4. package/dist/adapter/converters/device-parameters.js.map +1 -1
  5. package/dist/adapter/converters/sampler-parameters.js.map +1 -1
  6. package/dist/adapter/converters/texture-formats.d.ts +3 -3
  7. package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
  8. package/dist/adapter/converters/texture-formats.js +1 -1
  9. package/dist/adapter/converters/texture-formats.js.map +1 -1
  10. package/dist/adapter/converters/vertex-formats.d.ts +1 -1
  11. package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
  12. package/dist/adapter/converters/vertex-formats.js +1 -1
  13. package/dist/adapter/converters/vertex-formats.js.map +1 -1
  14. package/dist/adapter/device-helpers/device-features.js.map +1 -1
  15. package/dist/adapter/device-helpers/device-limits.d.ts +2 -2
  16. package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
  17. package/dist/adapter/device-helpers/device-limits.js +1 -1
  18. package/dist/adapter/device-helpers/device-limits.js.map +1 -1
  19. package/dist/adapter/device-helpers/get-device-info.js +1 -1
  20. package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
  21. package/dist/adapter/helpers/attribute-utils.js.map +1 -1
  22. package/dist/adapter/helpers/get-shader-info.d.ts +1 -1
  23. package/dist/adapter/helpers/get-shader-info.d.ts.map +1 -1
  24. package/dist/adapter/helpers/get-shader-layout.js +1 -1
  25. package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
  26. package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
  27. package/dist/adapter/helpers/set-uniform.d.ts +1 -1
  28. package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
  29. package/dist/adapter/helpers/set-uniform.js +1 -1
  30. package/dist/adapter/helpers/set-uniform.js.map +1 -1
  31. package/dist/adapter/helpers/uniforms.js.map +1 -1
  32. package/dist/adapter/objects/constants-to-keys.d.ts +1 -1
  33. package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
  34. package/dist/adapter/objects/constants-to-keys.js.map +1 -1
  35. package/dist/adapter/objects/webgl-renderbuffer.d.ts +2 -2
  36. package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
  37. package/dist/adapter/objects/webgl-renderbuffer.js +1 -1
  38. package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
  39. package/dist/adapter/objects/webgl-resource.d.ts +1 -1
  40. package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
  41. package/dist/adapter/objects/webgl-resource.js.map +1 -1
  42. package/dist/adapter/objects/webgl-vertex-array-object.d.ts +1 -1
  43. package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
  44. package/dist/adapter/objects/webgl-vertex-array-object.js +1 -1
  45. package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -1
  46. package/dist/adapter/resources/webgl-buffer.js +1 -1
  47. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  48. package/dist/adapter/resources/webgl-command-buffer.d.ts +6 -6
  49. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
  50. package/dist/adapter/resources/webgl-command-buffer.js +1 -1
  51. package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
  52. package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
  53. package/dist/adapter/resources/webgl-framebuffer.d.ts +3 -3
  54. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
  55. package/dist/adapter/resources/webgl-framebuffer.js +1 -1
  56. package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
  57. package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
  58. package/dist/adapter/resources/webgl-render-pipeline.js +3 -2
  59. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  60. package/dist/adapter/resources/webgl-sampler.js.map +1 -1
  61. package/dist/adapter/resources/webgl-shader.js +1 -1
  62. package/dist/adapter/resources/webgl-shader.js.map +1 -1
  63. package/dist/adapter/resources/webgl-texture.d.ts +5 -5
  64. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  65. package/dist/adapter/resources/webgl-texture.js.map +1 -1
  66. package/dist/adapter/webgl-canvas-context.js.map +1 -1
  67. package/dist/adapter/webgl-device.js +2 -2
  68. package/dist/adapter/webgl-device.js.map +1 -1
  69. package/dist/classic/accessor.d.ts +1 -1
  70. package/dist/classic/accessor.d.ts.map +1 -1
  71. package/dist/classic/accessor.js +1 -1
  72. package/dist/classic/accessor.js.map +1 -1
  73. package/dist/classic/{buffer.d.ts → buffer-with-accessor.d.ts} +8 -8
  74. package/dist/classic/buffer-with-accessor.d.ts.map +1 -0
  75. package/dist/classic/{buffer.js → buffer-with-accessor.js} +3 -3
  76. package/dist/classic/buffer-with-accessor.js.map +1 -0
  77. package/dist/classic/clear.d.ts +22 -0
  78. package/dist/classic/clear.d.ts.map +1 -0
  79. package/dist/classic/clear.js +88 -0
  80. package/dist/classic/clear.js.map +1 -0
  81. package/dist/classic/copy-and-blit.d.ts +45 -0
  82. package/dist/classic/copy-and-blit.d.ts.map +1 -0
  83. package/dist/classic/copy-and-blit.js +136 -0
  84. package/dist/classic/copy-and-blit.js.map +1 -0
  85. package/dist/classic/format-utils.d.ts +3 -0
  86. package/dist/classic/format-utils.d.ts.map +1 -0
  87. package/dist/classic/format-utils.js +38 -0
  88. package/dist/classic/format-utils.js.map +1 -0
  89. package/dist/classic/typed-array-utils.js.map +1 -1
  90. package/dist/context/context/create-browser-context.d.ts +17 -19
  91. package/dist/context/context/create-browser-context.d.ts.map +1 -1
  92. package/dist/context/context/create-browser-context.js +4 -4
  93. package/dist/context/context/create-browser-context.js.map +1 -1
  94. package/dist/context/context/create-headless-context.d.ts +1 -1
  95. package/dist/context/context/create-headless-context.d.ts.map +1 -1
  96. package/dist/context/debug/spector.d.ts +1 -3
  97. package/dist/context/debug/spector.d.ts.map +1 -1
  98. package/dist/context/debug/spector.js.map +1 -1
  99. package/dist/context/debug/webgl-developer-tools.d.ts +1 -1
  100. package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
  101. package/dist/context/debug/webgl-developer-tools.js +1 -1
  102. package/dist/context/debug/webgl-developer-tools.js.map +1 -1
  103. package/dist/context/parameters/webgl-parameter-tables.d.ts +1 -1
  104. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  105. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  106. package/dist/context/polyfill/get-parameter-polyfill.js +3 -3
  107. package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
  108. package/dist/context/polyfill/polyfill-context.js.map +1 -1
  109. package/dist/context/polyfill/polyfill-table.js +1 -1
  110. package/dist/context/polyfill/polyfill-table.js.map +1 -1
  111. package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
  112. package/dist/context/state-tracker/track-context-state.js.map +1 -1
  113. package/dist/dist.dev.js +251 -83
  114. package/dist/index.cjs +694 -520
  115. package/dist/index.d.ts +4 -2
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +3 -1
  118. package/dist/index.js.map +1 -1
  119. package/dist/types.d.ts +1 -1
  120. package/dist/types.d.ts.map +1 -1
  121. package/dist.min.js +22 -22
  122. package/package.json +5 -5
  123. package/src/adapter/converters/device-parameters.ts +1 -1
  124. package/src/adapter/converters/texture-formats.ts +1 -1
  125. package/src/adapter/converters/vertex-formats.ts +1 -1
  126. package/src/adapter/device-helpers/device-limits.ts +1 -1
  127. package/src/adapter/device-helpers/get-device-info.ts +1 -1
  128. package/src/adapter/helpers/get-shader-layout.ts +1 -1
  129. package/src/adapter/helpers/set-uniform.ts +1 -1
  130. package/src/adapter/objects/constants-to-keys.ts +1 -1
  131. package/src/adapter/objects/webgl-renderbuffer.ts +1 -1
  132. package/src/adapter/objects/webgl-resource.ts +1 -1
  133. package/src/adapter/objects/webgl-vertex-array-object.ts +1 -1
  134. package/src/adapter/resources/webgl-buffer.ts +1 -1
  135. package/src/adapter/resources/webgl-command-buffer.ts +1 -1
  136. package/src/adapter/resources/webgl-framebuffer.ts +1 -1
  137. package/src/adapter/resources/webgl-render-pipeline.ts +2 -2
  138. package/src/adapter/resources/webgl-shader.ts +1 -1
  139. package/src/adapter/webgl-device.ts +2 -2
  140. package/src/classic/accessor.ts +1 -1
  141. package/src/classic/{buffer.ts → buffer-with-accessor.ts} +9 -9
  142. package/src/classic/clear.ts +110 -0
  143. package/src/classic/copy-and-blit.ts +189 -0
  144. package/src/classic/format-utils.ts +43 -0
  145. package/src/context/context/create-browser-context.ts +37 -30
  146. package/src/context/debug/webgl-developer-tools.ts +1 -1
  147. package/src/context/polyfill/get-parameter-polyfill.ts +1 -1
  148. package/src/context/polyfill/polyfill-table.ts +1 -1
  149. package/src/index.ts +8 -3
  150. package/dist/classic/buffer.d.ts.map +0 -1
  151. package/dist/classic/buffer.js.map +0 -1
@@ -2,21 +2,21 @@
2
2
 
3
3
  /**
4
4
  * ContextProps
5
- * @param webgl2 Set to false to not create a WebGL2 context (force webgl1)
6
- * @param webgl1 set to false to not create a WebGL1 context (fail if webgl2 not available)
7
- * @param onContextLost
8
- * @param onContextRestored
9
- *
10
- * BROWSER CONTEXT PARAMETERS
11
- * @param debug Instrument context (at the expense of performance).
12
- * @param alpha Default render target has an alpha buffer.
13
- * @param depth Default render target has a depth buffer of at least 16 bits.
14
- * @param stencil Default render target has a stencil buffer of at least 8 bits.
15
- * @param antialias Boolean that indicates whether or not to perform anti-aliasing.
16
- * @param premultipliedAlpha Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.
17
- * @param preserveDrawingBuffer Default render target buffers will not be automatically cleared and will preserve their values until cleared or overwritten
18
- * @param failIfMajorPerformanceCaveat Do not create if the system performance is low.
19
- */
5
+ * @param webgl2 Set to false to not create a WebGL2 context (force webgl1)
6
+ * @param webgl1 set to false to not create a WebGL1 context (fail if webgl2 not available)
7
+ * @param onContextLost
8
+ * @param onContextRestored
9
+ *
10
+ * BROWSER CONTEXT PARAMETERS
11
+ * @param debug Instrument context (at the expense of performance).
12
+ * @param alpha Default render target has an alpha buffer.
13
+ * @param depth Default render target has a depth buffer of at least 16 bits.
14
+ * @param stencil Default render target has a stencil buffer of at least 8 bits.
15
+ * @param antialias Boolean that indicates whether or not to perform anti-aliasing.
16
+ * @param premultipliedAlpha Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.
17
+ * @param preserveDrawingBuffer Default render target buffers will not be automatically cleared and will preserve their values until cleared or overwritten
18
+ * @param failIfMajorPerformanceCaveat Do not create if the system performance is low.
19
+ */
20
20
  type ContextProps = {
21
21
  type?: 'webgl' | 'webgl1' | 'webgl2' | string;
22
22
  webgl1?: boolean;
@@ -27,10 +27,10 @@ type ContextProps = {
27
27
  desynchronized?: boolean; // hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop
28
28
  antialias?: boolean; // indicates whether or not to perform anti-aliasing.
29
29
  depth?: boolean; // indicates that the drawing buffer has a depth buffer of at least 16 bits.
30
- failIfMajorPerformanceCaveat?: boolean, // indicates if a context will be created if the system performance is low or if no hardware GPU is available.
31
- powerPreference?: 'default' | 'high-performance' | 'low-power',
32
- premultipliedAlpha?: boolean, // page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.
33
- preserveDrawingBuffer?: boolean // buffers will not be cleared and will preserve their values until cleared or overwritten by the author.
30
+ failIfMajorPerformanceCaveat?: boolean; // indicates if a context will be created if the system performance is low or if no hardware GPU is available.
31
+ powerPreference?: 'default' | 'high-performance' | 'low-power';
32
+ premultipliedAlpha?: boolean; // page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.
33
+ preserveDrawingBuffer?: boolean; // buffers will not be cleared and will preserve their values until cleared or overwritten by the author.
34
34
  };
35
35
 
36
36
  const DEFAULT_CONTEXT_PROPS: ContextProps = {
@@ -40,24 +40,27 @@ const DEFAULT_CONTEXT_PROPS: ContextProps = {
40
40
  // eslint-disable-next-line no-console
41
41
  onContextLost: () => console.error('WebGL context lost'),
42
42
  // eslint-disable-next-line no-console
43
- onContextRestored: () => console.info('WebGL context restored'),
43
+ onContextRestored: () => console.info('WebGL context restored')
44
44
  };
45
45
 
46
46
  /**
47
47
  * Create a WebGL context for a canvas
48
48
  * Note calling this multiple time on the same canvas does return the same context
49
- * @param canvas A canvas element or offscreen canvas
49
+ * @param canvas A canvas element or offscreen canvas
50
50
  */
51
- export function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): WebGLRenderingContext {
51
+ export function createBrowserContext(
52
+ canvas: HTMLCanvasElement | OffscreenCanvas,
53
+ props: ContextProps
54
+ ): WebGLRenderingContext {
52
55
  props = {...DEFAULT_CONTEXT_PROPS, ...props};
53
56
 
54
57
  // Try to extract any extra information about why context creation failed
55
58
  let errorMessage = null;
56
- const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);
59
+ const onCreateError = error => (errorMessage = error.statusMessage || errorMessage);
57
60
  canvas.addEventListener('webglcontextcreationerror', onCreateError, false);
58
61
 
59
62
  // Create the desired context
60
- let gl: WebGLRenderingContext | null = null;
63
+ let gl: WebGLRenderingContext | WebGL2RenderingContext | null = null;
61
64
 
62
65
  if (props.type === 'webgl2') {
63
66
  props = {...props, webgl1: false};
@@ -67,11 +70,11 @@ export function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas
67
70
  }
68
71
 
69
72
  // Prefer webgl2 over webgl1 if both are acceptable
70
- if (props.webgl2) {
71
- gl = gl || canvas.getContext('webgl2', props) ;
73
+ if (!gl && props.webgl2) {
74
+ gl = canvas.getContext('webgl2', props) as WebGL2RenderingContext;
72
75
  }
73
- if (props.webgl1) {
74
- gl = gl || canvas.getContext('webgl', props) ;
76
+ if (!gl && props.webgl1) {
77
+ gl = canvas.getContext('webgl', props) as WebGLRenderingContext;
75
78
  }
76
79
 
77
80
  // TODO are we removing this listener before giving it a chance to fire?
@@ -88,12 +91,16 @@ export function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas
88
91
  if (props.onContextLost) {
89
92
  // Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.
90
93
  const {onContextLost} = props;
91
- canvas.addEventListener('webglcontextlost',(event: Event) => onContextLost(event), false);
94
+ canvas.addEventListener('webglcontextlost', (event: Event) => onContextLost(event), false);
92
95
  }
93
96
  if (props.onContextRestored) {
94
97
  // Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.
95
98
  const {onContextRestored} = props;
96
- canvas.addEventListener('webglcontextrestored', (event: Event) => onContextRestored(event), false);
99
+ canvas.addEventListener(
100
+ 'webglcontextrestored',
101
+ (event: Event) => onContextRestored(event),
102
+ false
103
+ );
97
104
  }
98
105
 
99
106
  return gl;
@@ -1,6 +1,6 @@
1
1
  // luma.gl, MIT license
2
2
  import {log, loadScript} from '@luma.gl/api';
3
- import GL from '@luma.gl/constants';
3
+ import {GL} from '@luma.gl/constants';
4
4
 
5
5
  const WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';
6
6
 
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-inline-comments, max-len, camelcase */
2
- import GL from '@luma.gl/constants';
2
+ import {GL} from '@luma.gl/constants';
3
3
  import {isWebGL2} from '../context/webgl-checks';
4
4
 
5
5
  const OES_element_index = 'OES_element_index';
@@ -1,5 +1,5 @@
1
1
  import {assert} from '@luma.gl/api';
2
- import GL from '@luma.gl/constants';
2
+ import {GL} from '@luma.gl/constants';
3
3
  import {isWebGL2} from '../context/webgl-checks';
4
4
 
5
5
  import {getParameterPolyfill} from './get-parameter-polyfill';
package/src/index.ts CHANGED
@@ -36,8 +36,8 @@ export {WEBGLVertexArrayObject} from './adapter/objects/webgl-vertex-array-objec
36
36
  // WebGL adapter classes (Legacy, will be moved to webgl-legacy)
37
37
  export {Accessor} from './classic/accessor';
38
38
  export type {AccessorObject} from './types';
39
- export type {ClassicBufferProps, ClassicBufferProps as BufferProps} from './classic/buffer';
40
- export {ClassicBuffer, ClassicBuffer as Buffer} from './classic/buffer';
39
+ export type {BufferWithAccessorProps} from './classic/buffer-with-accessor';
40
+ export {BufferWithAccessor} from './classic/buffer-with-accessor';
41
41
 
42
42
  export {
43
43
  isWebGL,
@@ -76,4 +76,9 @@ export {polyfillContext} from './context/polyfill/polyfill-context';
76
76
  export {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';
77
77
  export {convertGLToTextureFormat, _checkFloat32ColorAttachment} from './adapter/converters/texture-formats';
78
78
 
79
- export {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';
79
+ // TEST EXPORTS
80
+ export {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';
81
+
82
+ // DEPRECATED EXPORTS
83
+ export {clear} from './classic/clear';
84
+ export {readPixelsToBuffer, readPixelsToArray} from './classic/copy-and-blit';
@@ -1 +0,0 @@
1
- {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/classic/buffer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAIpC,OAAO,EAAC,WAAW,EAAC,MAAM,mCAAmC,CAAC;AAoD9D,6BAA6B;AAC7B,oBAAY,kBAAkB,GAAG,WAAW,GAAG;IAC7C,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,kBAAkB;IAClB,KAAK,CAAC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AAM,CAAC;QACrB,IAAI,EAAE,GAAG,CAAC;KACX,GAAG,IAAI;IAkBR;;;OAGG;IACM,OAAO,CAAC,OAAO,CAAC,EAAE;QACzB,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,GAAG;IAsCP;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAwBhF,MAAM,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAcnD,YAAY,IAAI;QACd,IAAI,EAAE,GAAG,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;KAChB;IAQH,mBAAmB;IAOnB,QAAQ,CAAC,IAAI,KAAA,EAAE,MAAM,GAAE,MAAU,EAAE,UAAU,GAAE,MAAiC,GAAG,IAAI;IAwBvF,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,SAAkB,GAAG,IAAI;IA8BtE,UAAU;IAKV,yBAAyB,CAAC,aAAa,EAAE,MAAM;IAQ/C,UAAU,CAAC,IAAI,KAAA;IAQf,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,GAAG;IAQ5B,2CAA2C;IAC3C,IAAI,IAAI,WAEP;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"buffer.js","names":["assert","checkProps","GL","assertWebGL2Context","Accessor","getGLTypeFromTypedArray","getTypedArrayFromGLType","WebGLDevice","WEBGLBuffer","DEBUG_DATA_LENGTH","DEPRECATED_PROPS","offset","stride","type","size","divisor","normalized","integer","instanced","isInstanced","PROP_CHECKS_INITIALIZE","removedProps","replacedProps","bytes","deprecatedProps","PROP_CHECKS_SET_PROPS","getWEBGLBufferProps","props","ArrayBuffer","isView","data","byteLength","bufferProps","byteOffset","ClassicBuffer","constructor","device","arguments","length","undefined","attach","_defineProperty","setAccessor","Object","assign","accessor","seal","getElementCount","Math","round","getBytesPerElement","getVertexCount","getBytesPerVertex","initialize","Number","isFinite","webglUsage","STATIC_DRAW","debugData","_setData","_setByteLength","setProps","buffer","reallocate","bytesUsed","setData","subData","options","srcOffset","target","gl","webgl2","COPY_WRITE_BUFFER","bindBuffer","handle","bufferSubData","_inferType","copyData","sourceBuffer","readOffset","writeOffset","gl2","COPY_READ_BUFFER","copyBufferSubData","getData","_this$gl","dstData","srcByteOffset","dstOffset","ArrayType","FLOAT","clamped","sourceAvailableElementCount","_getAvailableElementCount","dstElementOffset","dstAvailableElementCount","dstElementCount","min","copyElementCount","getBufferSubData","bind","index","UNIFORM_BUFFER","TRANSFORM_FEEDBACK_BUFFER","_this$gl2","bindBufferRange","_this$gl3","bindBufferBase","unbind","isIndexedBuffer","_this$gl4","getDebugData","changed","invalidateDebugData","trackDeallocatedMemory","_getTarget","bufferData","slice","trackAllocatedMemory","Float32Array","sourceElementOffset","BYTES_PER_ELEMENT","getParameter","pname","value","getBufferParameter"],"sources":["../../src/classic/buffer.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport type {Device, BufferProps, TypedArray} from '@luma.gl/api';\nimport {assert, checkProps} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {assertWebGL2Context} from '../context/context/webgl-checks';\nimport {AccessorObject} from '../types';\nimport {Accessor} from './accessor';\nimport {getGLTypeFromTypedArray, getTypedArrayFromGLType} from './typed-array-utils';\n\nimport {WebGLDevice} from '../adapter/webgl-device';\nimport {WEBGLBuffer} from '../adapter/resources/webgl-buffer';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n// Shared prop checks for constructor and setProps\nconst DEPRECATED_PROPS = {\n offset: 'accessor.offset',\n stride: 'accessor.stride',\n type: 'accessor.type',\n size: 'accessor.size',\n divisor: 'accessor.divisor',\n normalized: 'accessor.normalized',\n integer: 'accessor.integer',\n instanced: 'accessor.divisor',\n isInstanced: 'accessor.divisor'\n};\n\n// Prop checks for constructor\nconst PROP_CHECKS_INITIALIZE = {\n removedProps: {},\n replacedProps: {\n bytes: 'byteLength'\n },\n // new Buffer() with individual accessor props is still used in apps, emit warnings\n deprecatedProps: DEPRECATED_PROPS\n};\n\n// Prop checks for setProps\nconst PROP_CHECKS_SET_PROPS = {\n // Buffer.setProps() with individual accessor props is rare => emit errors\n removedProps: DEPRECATED_PROPS\n};\n\nfunction getWEBGLBufferProps(props: ClassicBufferProps | ArrayBufferView | number): BufferProps {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n return {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n else if (typeof props === 'number') {\n return {byteLength: props };\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n const bufferProps = {...props };\n if (bufferProps.offset) {\n bufferProps.byteOffset = bufferProps.offset;\n }\n return bufferProps;\n}\n\n/** WebGL Buffer interface */\nexport type ClassicBufferProps = BufferProps & {\n handle?: WebGLBuffer;\n\n target?: number;\n webglUsage?: number;\n\n accessor?: AccessorObject;\n\n /** @deprecated */\n index?: number;\n /** @deprecated */\n offset?: number;\n /** @deprecated */\n size?: number;\n /** @deprecated */\n type?: number\n}\n\n/** WebGL Buffer interface */\nexport class ClassicBuffer extends WEBGLBuffer {\n usage: number;\n accessor: Accessor;\n\n constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);\n constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);\n constructor(device: Device | WebGLRenderingContext, byteLength: number);\n\n constructor(device: Device | WebGLRenderingContext, props = {}) {\n super(WebGLDevice.attach(device), getWEBGLBufferProps(props));\n\n // Base class initializes\n // this.initialize(props);\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, (props as ClassicBufferProps).accessor));\n\n // infer GL type from supplied typed array\n if (this.props.data) {\n const type = getGLTypeFromTypedArray(this.props.data as TypedArray);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n }\n\n Object.seal(this);\n }\n\n // override write(data: TypedArray, byteOffset: number = 0): void {\n // this.subData({data, offset: byteOffset});\n // }\n\n // returns number of elements in the buffer (assuming that the full buffer is used)\n getElementCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));\n }\n\n // returns number of vertices in the buffer (assuming that the full buffer is used)\n getVertexCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerVertex(accessor));\n }\n\n // Creates and initializes the buffer object's data store.\n // Signature: `new Buffer(gl, {data: new Float32Array(...)})`\n // Signature: `new Buffer(gl, new Float32Array(...))`\n // Signature: `new Buffer(gl, 100)`\n initialize(props: ClassicBufferProps = {}): this {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n props = {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n if (Number.isFinite(props)) {\n // @ts-expect-error\n props = {byteLength: props};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n\n // Initialize member fields\n this.webglUsage = props.webglUsage || GL.STATIC_DRAW;\n this.debugData = null;\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, props.accessor));\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._setData(props.data, props.offset, props.byteLength);\n } else {\n this._setByteLength(props.byteLength || 0);\n }\n\n return this;\n }\n\n setProps(props: ClassicBufferProps): this {\n props = checkProps('Buffer', props, PROP_CHECKS_SET_PROPS);\n\n if ('accessor' in props) {\n this.setAccessor(props.accessor);\n }\n\n return this;\n }\n\n // Optionally stores an accessor with the buffer, makes it easier to use it as an attribute later\n // {type, size = 1, offset = 0, stride = 0, normalized = false, integer = false, divisor = 0}\n setAccessor(accessor: AccessorObject | Accessor): this {\n // NOTE: From luma.gl v7.0, Accessors have an optional `buffer `field\n // (mainly to support \"interleaving\")\n // To avoid confusion, ensure `buffer.accessor` does not have a `buffer.accessor.buffer` field:\n accessor = Object.assign({}, accessor);\n // @ts-expect-error\n delete accessor.buffer;\n\n // This new statement ensures that an \"accessor object\" is re-packaged as an Accessor instance\n this.accessor = new Accessor(accessor);\n return this;\n }\n\n // Allocate a bigger GPU buffer (if the current buffer is not big enough).\n // If a reallocation is triggered it clears the buffer\n // Returns:\n // `true`: buffer was reallocated, data was cleared\n // `false`: buffer was big enough, data is intact\n reallocate(byteLength: number): boolean {\n if (byteLength > this.byteLength) {\n this._setByteLength(byteLength);\n return true;\n }\n this.bytesUsed = byteLength;\n return false;\n }\n\n // Update with new data. Reinitializes the buffer\n setData(props: ClassicBufferProps) {\n return this.initialize(props);\n }\n\n // Updates a subset of a buffer object's data store.\n // Data (Typed Array or ArrayBuffer), length is inferred unless provided\n // Offset into buffer\n // WebGL2 only: Offset into srcData\n // WebGL2 only: Number of bytes to be copied\n subData(options: TypedArray | {data: TypedArray, offset?: number; srcOffset?: number; byteLength?: number, length?: number}) {\n // Signature: buffer.subData(new Float32Array([...]))\n if (ArrayBuffer.isView(options)) {\n options = {data: options};\n }\n\n const {data, offset = 0, srcOffset = 0} = options;\n const byteLength = options.byteLength || options.length;\n\n assert(data);\n\n // Create the buffer - binding it here for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n // @ts-expect-error\n const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n this.gl.bindBuffer(target, this.handle);\n // WebGL2: subData supports additional srcOffset and length parameters\n if (srcOffset !== 0 || byteLength !== undefined) {\n assertWebGL2Context(this.gl);\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, offset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n this.debugData = null;\n\n this._inferType(data);\n\n return this;\n }\n\n /**\n * Copies part of the data of another buffer into this buffer\n * @note WEBGL2 ONLY\n */\n copyData(options: {\n sourceBuffer: any;\n readOffset?: number;\n writeOffset?: number;\n size: any;\n }): this {\n const {sourceBuffer, readOffset = 0, writeOffset = 0, size} = options;\n const {gl, gl2} = this;\n assertWebGL2Context(gl);\n\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n gl.bindBuffer(GL.COPY_READ_BUFFER, sourceBuffer.handle);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, this.handle);\n gl2?.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);\n gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n this.debugData = null;\n\n return this;\n }\n\n /**\n * Reads data from buffer into an ArrayBufferView or SharedArrayBuffer.\n * @note WEBGL2 ONLY\n */\n override getData(options?: {\n dstData?: any;\n srcByteOffset?: number;\n dstOffset?: number;\n length?: number;\n }): any {\n let {dstData = null, length = 0} = options || {};\n const {srcByteOffset = 0, dstOffset = 0} = options || {};\n assertWebGL2Context(this.gl);\n\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);\n\n const dstElementOffset = dstOffset;\n\n let dstAvailableElementCount;\n let dstElementCount;\n if (dstData) {\n dstElementCount = dstData.length;\n dstAvailableElementCount = dstElementCount - dstElementOffset;\n } else {\n // Allocate ArrayBufferView with enough size to copy all eligible data.\n dstAvailableElementCount = Math.min(\n sourceAvailableElementCount,\n length || sourceAvailableElementCount\n );\n dstElementCount = dstElementOffset + dstAvailableElementCount;\n }\n\n const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);\n length = length || copyElementCount;\n assert(length <= copyElementCount);\n dstData = dstData || new ArrayType(dstElementCount);\n\n // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);\n this.gl2?.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n return dstData;\n }\n\n /**\n * Binds a buffer to a given binding point (target).\n * GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER take an index, and optionally a range.\n * - GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER need an index to affect state\n * - GL.UNIFORM_BUFFER: `offset` must be aligned to GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT.\n * - GL.UNIFORM_BUFFER: `size` must be a minimum of GL.UNIFORM_BLOCK_SIZE_DATA.\n */\n bind(options?: {target?: number; index?: any; offset?: number; size: any}): this {\n const {\n target = this.target, // target for the bind operation\n index = this.accessor && this.accessor.index, // index = index of target (indexed bind point)\n offset = 0,\n size\n } = options || {};\n // NOTE: While GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER could\n // be used as direct binding points, they will not affect transform feedback or\n // uniform buffer state. Instead indexed bindings need to be made.\n if (target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER) {\n if (size !== undefined) {\n this.gl2?.bindBufferRange(target, index, this.handle, offset, size);\n } else {\n assert(offset === 0); // Make sure offset wasn't supplied\n this.gl2?.bindBufferBase(target, index, this.handle);\n }\n } else {\n this.gl.bindBuffer(target, this.handle);\n }\n\n return this;\n }\n\n unbind(options?: {target?: any; index?: any}): this {\n const {target = this.target, index = this.accessor && this.accessor.index} = options || {};\n const isIndexedBuffer = target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER;\n if (isIndexedBuffer) {\n this.gl2?.bindBufferBase(target, index, null);\n } else {\n this.gl.bindBuffer(target, null);\n }\n return this;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n // Returns a short initial data array\n getDebugData(): {\n data: any;\n changed: boolean;\n } {\n if (!this.debugData) {\n this.debugData = this.getData({length: Math.min(DEBUG_DATA_LENGTH, this.byteLength)});\n return {data: this.debugData, changed: true};\n }\n return {data: this.debugData, changed: false};\n }\n\n invalidateDebugData() {\n this.debugData = null;\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _setData(data, offset: number = 0, byteLength: number = data.byteLength + offset): this {\n assert(ArrayBuffer.isView(data));\n\n this.trackDeallocatedMemory();\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, offset, data);\n this.gl.bindBuffer(target, null);\n\n this.debugData = data.slice(0, DEBUG_DATA_LENGTH);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n\n // infer GL type from supplied typed array\n const type = getGLTypeFromTypedArray(data);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _setByteLength(byteLength: number, webglUsage = this.webglUsage): this {\n assert(byteLength >= 0);\n\n this.trackDeallocatedMemory();\n\n // Workaround needed for Safari (#291):\n // gl.bufferData with size equal to 0 crashes. Instead create zero sized array.\n let data = byteLength;\n if (byteLength === 0) {\n // @ts-expect-error\n data = new Float32Array(0);\n }\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.webglUsage = webglUsage;\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n this.trackAllocatedMemory(byteLength);\n\n return this;\n }\n\n // Binding a buffer for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n _getTarget() {\n // @ts-expect-error\n return this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getAvailableElementCount(srcByteOffset: number) {\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;\n return this.getElementCount() - sourceElementOffset;\n }\n\n // Automatically infers type from typed array passed to setData\n // Note: No longer that useful, since type is now autodeduced from the compiled shaders\n _inferType(data) {\n if (!this.accessor.type) {\n this.setAccessor(new Accessor(this.accessor, {type: getGLTypeFromTypedArray(data)}));\n }\n }\n\n // RESOURCE METHODS\n\n getParameter(pname: GL): any {\n this.gl.bindBuffer(this.target, this.handle);\n const value = this.gl.getBufferParameter(this.target, pname);\n this.gl.bindBuffer(this.target, null);\n return value;\n }\n\n // DEPRECATIONS - v7.0\n /** @deprecated Use Buffer.accessor.type */\n get type() {\n return this.accessor.type;\n }\n}\n"],"mappings":";AAGA,SAAQA,MAAM,EAAEC,UAAU,QAAO,cAAc;AAC/C,OAAOC,EAAE,MAAM,oBAAoB;AAAC,SAC5BC,mBAAmB;AAAA,SAEnBC,QAAQ;AAAA,SACRC,uBAAuB,EAAEC,uBAAuB;AAAA,SAEhDC,WAAW;AAAA,SACXC,WAAW;AAEnB,MAAMC,iBAAiB,GAAG,EAAE;AAG5B,MAAMC,gBAAgB,GAAG;EACvBC,MAAM,EAAE,iBAAiB;EACzBC,MAAM,EAAE,iBAAiB;EACzBC,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE,eAAe;EACrBC,OAAO,EAAE,kBAAkB;EAC3BC,UAAU,EAAE,qBAAqB;EACjCC,OAAO,EAAE,kBAAkB;EAC3BC,SAAS,EAAE,kBAAkB;EAC7BC,WAAW,EAAE;AACf,CAAC;AAGD,MAAMC,sBAAsB,GAAG;EAC7BC,YAAY,EAAE,CAAC,CAAC;EAChBC,aAAa,EAAE;IACbC,K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