@luma.gl/webgl 9.1.0-beta.9 → 9.2.0-alpha.1

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 (189) hide show
  1. package/dist/adapter/converters/device-parameters.js +14 -9
  2. package/dist/adapter/converters/device-parameters.js.map +1 -1
  3. package/dist/adapter/converters/shader-formats.d.ts +67 -8
  4. package/dist/adapter/converters/shader-formats.d.ts.map +1 -1
  5. package/dist/adapter/converters/shader-formats.js +82 -52
  6. package/dist/adapter/converters/shader-formats.js.map +1 -1
  7. package/dist/adapter/converters/webgl-shadertypes.d.ts +20 -0
  8. package/dist/adapter/converters/webgl-shadertypes.d.ts.map +1 -0
  9. package/dist/adapter/converters/webgl-shadertypes.js +123 -0
  10. package/dist/adapter/converters/webgl-shadertypes.js.map +1 -0
  11. package/dist/adapter/converters/webgl-texture-table.js +6 -6
  12. package/dist/adapter/converters/webgl-texture-table.js.map +1 -1
  13. package/dist/adapter/converters/{vertex-formats.d.ts → webgl-vertex-formats.d.ts} +4 -4
  14. package/dist/adapter/converters/webgl-vertex-formats.d.ts.map +1 -0
  15. package/dist/adapter/converters/{vertex-formats.js → webgl-vertex-formats.js} +1 -1
  16. package/dist/adapter/converters/webgl-vertex-formats.js.map +1 -0
  17. package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -1
  18. package/dist/adapter/device-helpers/webgl-device-features.js.map +1 -1
  19. package/dist/adapter/device-helpers/webgl-device-limits.d.ts +1 -1
  20. package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -1
  21. package/dist/adapter/device-helpers/webgl-device-limits.js +1 -1
  22. package/dist/adapter/device-helpers/webgl-device-limits.js.map +1 -1
  23. package/dist/adapter/helpers/format-utils.d.ts +3 -2
  24. package/dist/adapter/helpers/format-utils.d.ts.map +1 -1
  25. package/dist/adapter/helpers/format-utils.js.map +1 -1
  26. package/dist/adapter/helpers/{get-shader-layout.d.ts → get-shader-layout-from-glsl.d.ts} +1 -1
  27. package/dist/adapter/helpers/get-shader-layout-from-glsl.d.ts.map +1 -0
  28. package/dist/adapter/helpers/{get-shader-layout.js → get-shader-layout-from-glsl.js} +12 -35
  29. package/dist/adapter/helpers/get-shader-layout-from-glsl.js.map +1 -0
  30. package/dist/adapter/helpers/set-uniform.d.ts +2 -2
  31. package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
  32. package/dist/adapter/helpers/set-uniform.js.map +1 -1
  33. package/dist/adapter/helpers/webgl-texture-utils.d.ts +2 -25
  34. package/dist/adapter/helpers/webgl-texture-utils.d.ts.map +1 -1
  35. package/dist/adapter/helpers/webgl-texture-utils.js +10 -99
  36. package/dist/adapter/helpers/webgl-texture-utils.js.map +1 -1
  37. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
  38. package/dist/adapter/resources/webgl-buffer.js +5 -3
  39. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  40. package/dist/adapter/resources/webgl-command-buffer.d.ts +2 -2
  41. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
  42. package/dist/adapter/resources/webgl-command-buffer.js +4 -4
  43. package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
  44. package/dist/adapter/resources/webgl-command-encoder.d.ts +6 -2
  45. package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
  46. package/dist/adapter/resources/webgl-command-encoder.js +9 -4
  47. package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
  48. package/dist/adapter/resources/webgl-external-texture.js +1 -0
  49. package/dist/adapter/resources/webgl-external-texture.js.map +1 -1
  50. package/dist/adapter/resources/webgl-framebuffer.js +2 -2
  51. package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
  52. package/dist/adapter/resources/webgl-query-set.d.ts.map +1 -1
  53. package/dist/adapter/resources/webgl-query-set.js +5 -1
  54. package/dist/adapter/resources/webgl-query-set.js.map +1 -1
  55. package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
  56. package/dist/adapter/resources/webgl-render-pass.js +11 -6
  57. package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
  58. package/dist/adapter/resources/webgl-render-pipeline.d.ts +3 -3
  59. package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
  60. package/dist/adapter/resources/webgl-render-pipeline.js +27 -24
  61. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  62. package/dist/adapter/resources/webgl-sampler.js +1 -1
  63. package/dist/adapter/resources/webgl-sampler.js.map +1 -1
  64. package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
  65. package/dist/adapter/resources/webgl-shader.js +9 -2
  66. package/dist/adapter/resources/webgl-shader.js.map +1 -1
  67. package/dist/adapter/resources/webgl-texture-view.js +1 -1
  68. package/dist/adapter/resources/webgl-texture-view.js.map +1 -1
  69. package/dist/adapter/resources/webgl-texture.d.ts +21 -66
  70. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  71. package/dist/adapter/resources/webgl-texture.js +148 -319
  72. package/dist/adapter/resources/webgl-texture.js.map +1 -1
  73. package/dist/adapter/resources/webgl-transform-feedback.d.ts +1 -1
  74. package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
  75. package/dist/adapter/resources/webgl-transform-feedback.js +1 -1
  76. package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -1
  77. package/dist/adapter/resources/webgl-vertex-array.d.ts +1 -1
  78. package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
  79. package/dist/adapter/resources/webgl-vertex-array.js +3 -2
  80. package/dist/adapter/resources/webgl-vertex-array.js.map +1 -1
  81. package/dist/adapter/webgl-adapter.d.ts +4 -3
  82. package/dist/adapter/webgl-adapter.d.ts.map +1 -1
  83. package/dist/adapter/webgl-adapter.js +16 -7
  84. package/dist/adapter/webgl-adapter.js.map +1 -1
  85. package/dist/adapter/webgl-canvas-context.d.ts +3 -24
  86. package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
  87. package/dist/adapter/webgl-canvas-context.js +5 -44
  88. package/dist/adapter/webgl-canvas-context.js.map +1 -1
  89. package/dist/adapter/webgl-device.d.ts +17 -20
  90. package/dist/adapter/webgl-device.d.ts.map +1 -1
  91. package/dist/adapter/webgl-device.js +30 -28
  92. package/dist/adapter/webgl-device.js.map +1 -1
  93. package/dist/context/debug/spector-types.d.ts.map +1 -1
  94. package/dist/context/debug/spector-types.js +3 -0
  95. package/dist/context/debug/spector-types.js.map +1 -1
  96. package/dist/context/debug/spector.js.map +1 -1
  97. package/dist/context/debug/webgl-developer-tools.js.map +1 -1
  98. package/dist/context/helpers/webgl-extensions.d.ts.map +1 -1
  99. package/dist/context/helpers/webgl-extensions.js +3 -0
  100. package/dist/context/helpers/webgl-extensions.js.map +1 -1
  101. package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
  102. package/dist/context/parameters/unified-parameter-api.js +7 -0
  103. package/dist/context/parameters/unified-parameter-api.js.map +1 -1
  104. package/dist/context/parameters/webgl-parameter-tables.d.ts +1 -1
  105. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  106. package/dist/context/parameters/webgl-parameter-tables.js +1 -0
  107. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  108. package/dist/context/polyfills/polyfill-webgl1-extensions.d.ts.map +1 -1
  109. package/dist/context/polyfills/polyfill-webgl1-extensions.js +1 -0
  110. package/dist/context/polyfills/polyfill-webgl1-extensions.js.map +1 -1
  111. package/dist/context/state-tracker/deep-array-equal.d.ts +2 -1
  112. package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
  113. package/dist/context/state-tracker/deep-array-equal.js +4 -5
  114. package/dist/context/state-tracker/deep-array-equal.js.map +1 -1
  115. package/dist/context/state-tracker/webgl-state-tracker.d.ts.map +1 -1
  116. package/dist/context/state-tracker/webgl-state-tracker.js +4 -1
  117. package/dist/context/state-tracker/webgl-state-tracker.js.map +1 -1
  118. package/dist/context/state-tracker/with-parameters.js.map +1 -1
  119. package/dist/dist.dev.js +4720 -4771
  120. package/dist/dist.min.js +2 -2
  121. package/dist/index.cjs +3849 -3938
  122. package/dist/index.cjs.map +4 -4
  123. package/dist/index.d.ts +1 -3
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +1 -3
  126. package/dist/index.js.map +1 -1
  127. package/package.json +4 -4
  128. package/src/adapter/converters/device-parameters.ts +19 -9
  129. package/src/adapter/converters/shader-formats.ts +50 -24
  130. package/src/adapter/converters/webgl-shadertypes.ts +152 -0
  131. package/src/adapter/converters/webgl-texture-table.ts +9 -9
  132. package/src/adapter/converters/{vertex-formats.ts → webgl-vertex-formats.ts} +3 -3
  133. package/src/adapter/device-helpers/webgl-device-features.ts +1 -1
  134. package/src/adapter/device-helpers/webgl-device-limits.ts +1 -1
  135. package/src/adapter/helpers/format-utils.ts +2 -2
  136. package/src/adapter/helpers/{get-shader-layout.ts → get-shader-layout-from-glsl.ts} +20 -50
  137. package/src/adapter/helpers/set-uniform.ts +2 -2
  138. package/src/adapter/helpers/webgl-texture-utils.ts +12 -127
  139. package/src/adapter/resources/webgl-buffer.ts +5 -3
  140. package/src/adapter/resources/webgl-command-buffer.ts +5 -5
  141. package/src/adapter/resources/webgl-command-encoder.ts +17 -8
  142. package/src/adapter/resources/webgl-framebuffer.ts +2 -2
  143. package/src/adapter/resources/webgl-query-set.ts +5 -1
  144. package/src/adapter/resources/webgl-render-pass.ts +15 -9
  145. package/src/adapter/resources/webgl-render-pipeline.ts +32 -35
  146. package/src/adapter/resources/webgl-sampler.ts +1 -1
  147. package/src/adapter/resources/webgl-shader.ts +11 -2
  148. package/src/adapter/resources/webgl-texture-view.ts +1 -1
  149. package/src/adapter/resources/webgl-texture.ts +180 -393
  150. package/src/adapter/resources/webgl-transform-feedback.ts +2 -2
  151. package/src/adapter/resources/webgl-vertex-array.ts +4 -3
  152. package/src/adapter/webgl-adapter.ts +20 -8
  153. package/src/adapter/webgl-canvas-context.ts +7 -47
  154. package/src/adapter/webgl-device.ts +46 -41
  155. package/src/context/debug/spector-types.ts +5 -0
  156. package/src/context/debug/spector.ts +1 -1
  157. package/src/context/debug/webgl-developer-tools.ts +8 -3
  158. package/src/context/helpers/webgl-extensions.ts +3 -0
  159. package/src/context/parameters/unified-parameter-api.ts +9 -2
  160. package/src/context/parameters/webgl-parameter-tables.ts +2 -0
  161. package/src/context/polyfills/polyfill-webgl1-extensions.ts +1 -0
  162. package/src/context/state-tracker/deep-array-equal.ts +11 -6
  163. package/src/context/state-tracker/webgl-state-tracker.ts +5 -1
  164. package/src/context/state-tracker/with-parameters.ts +1 -1
  165. package/src/index.ts +1 -5
  166. package/dist/adapter/converters/vertex-formats.d.ts.map +0 -1
  167. package/dist/adapter/converters/vertex-formats.js.map +0 -1
  168. package/dist/adapter/helpers/decode-webgl-types.d.ts +0 -26
  169. package/dist/adapter/helpers/decode-webgl-types.d.ts.map +0 -1
  170. package/dist/adapter/helpers/decode-webgl-types.js +0 -102
  171. package/dist/adapter/helpers/decode-webgl-types.js.map +0 -1
  172. package/dist/adapter/helpers/get-shader-layout.d.ts.map +0 -1
  173. package/dist/adapter/helpers/get-shader-layout.js.map +0 -1
  174. package/dist/adapter/helpers/typed-array-utils.d.ts +0 -44
  175. package/dist/adapter/helpers/typed-array-utils.d.ts.map +0 -1
  176. package/dist/adapter/helpers/typed-array-utils.js +0 -107
  177. package/dist/adapter/helpers/typed-array-utils.js.map +0 -1
  178. package/dist/deprecated/accessor.d.ts +0 -53
  179. package/dist/deprecated/accessor.d.ts.map +0 -1
  180. package/dist/deprecated/accessor.js +0 -177
  181. package/dist/deprecated/accessor.js.map +0 -1
  182. package/dist/utils/split-uniforms-and-bindings.d.ts +0 -9
  183. package/dist/utils/split-uniforms-and-bindings.d.ts.map +0 -1
  184. package/dist/utils/split-uniforms-and-bindings.js +0 -21
  185. package/dist/utils/split-uniforms-and-bindings.js.map +0 -1
  186. package/src/adapter/helpers/decode-webgl-types.ts +0 -134
  187. package/src/adapter/helpers/typed-array-utils.ts +0 -129
  188. package/src/deprecated/accessor.ts +0 -225
  189. package/src/utils/split-uniforms-and-bindings.ts +0 -31
@@ -102,7 +102,7 @@ export class WEBGLTransformFeedback extends TransformFeedback {
102
102
  return location >= 0 ? this.buffers[location] : null;
103
103
  }
104
104
 
105
- bind(funcOrHandle = this.handle) {
105
+ bind(funcOrHandle: (() => void) | WebGLTransformFeedback | null = this.handle) {
106
106
  if (typeof funcOrHandle !== 'function') {
107
107
  this.gl.bindTransformFeedback(GL.TRANSFORM_FEEDBACK, funcOrHandle);
108
108
  return this;
@@ -148,7 +148,7 @@ export class WEBGLTransformFeedback extends TransformFeedback {
148
148
  return Number(locationOrName);
149
149
  }
150
150
 
151
- for (const varying of this.layout.varyings) {
151
+ for (const varying of this.layout.varyings || []) {
152
152
  if (locationOrName === varying.name) {
153
153
  return varying.location;
154
154
  }
@@ -11,7 +11,7 @@ import {getBrowser} from '@probe.gl/env';
11
11
  import {WebGLDevice} from '../webgl-device';
12
12
  import {WEBGLBuffer} from '../resources/webgl-buffer';
13
13
 
14
- import {getGLFromVertexType} from '../converters/vertex-formats';
14
+ import {getGLFromVertexType} from '../converters/webgl-vertex-formats';
15
15
  import {fillArray} from '../../utils/fill-array';
16
16
 
17
17
  /** VertexArrayObject wrapper */
@@ -25,7 +25,7 @@ export class WEBGLVertexArray extends VertexArray {
25
25
 
26
26
  /** Attribute 0 buffer constant */
27
27
  private buffer: WEBGLBuffer | null = null;
28
- private bufferValue = null;
28
+ private bufferValue: TypedArray | null = null;
29
29
 
30
30
  /** * Attribute 0 can not be disable on most desktop OpenGL based browsers */
31
31
  static isConstantAttributeZeroSupported(device: Device): boolean {
@@ -233,7 +233,8 @@ export class WEBGLVertexArray extends VertexArray {
233
233
  this.buffer = this.buffer || this.device.createBuffer({byteLength});
234
234
 
235
235
  // Reallocate and update contents if needed
236
- updateNeeded = updateNeeded || !compareConstantArrayValues(constantValue, this.bufferValue);
236
+ // @ts-ignore TODO fix types
237
+ updateNeeded ||= !compareConstantArrayValues(constantValue, this.bufferValue);
237
238
 
238
239
  if (updateNeeded) {
239
240
  // Create a typed array that is big enough, and fill it with the required data
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
+ import type {WebGLDevice} from './webgl-device';
5
6
  import {Adapter, Device, DeviceProps, log} from '@luma.gl/core';
6
- import {WebGLDevice} from './webgl-device';
7
7
  import {enforceWebGL2} from '../context/polyfills/polyfill-webgl1-extensions';
8
8
  import {loadSpectorJS, DEFAULT_SPECTOR_PROPS} from '../context/debug/spector';
9
9
  import {loadWebGLDeveloperTools} from '../context/debug/webgl-developer-tools';
@@ -16,12 +16,13 @@ export class WebGLAdapter extends Adapter {
16
16
 
17
17
  constructor() {
18
18
  super();
19
-
20
19
  // Add spector default props to device default props, so that runtime settings are observed
21
20
  Device.defaultProps = {...Device.defaultProps, ...DEFAULT_SPECTOR_PROPS};
21
+ }
22
22
 
23
- // @ts-ignore DEPRECATED For backwards compatibility luma.registerDevices
24
- WebGLDevice.adapter = this;
23
+ /** Force any created WebGL contexts to be WebGL2 contexts, polyfilled with WebGL1 extensions */
24
+ enforceWebGL2(enable: boolean): void {
25
+ enforceWebGL2(enable);
25
26
  }
26
27
 
27
28
  /** Check if WebGL 2 is available */
@@ -29,9 +30,17 @@ export class WebGLAdapter extends Adapter {
29
30
  return typeof WebGL2RenderingContext !== 'undefined';
30
31
  }
31
32
 
32
- /** Force any created WebGL contexts to be WebGL2 contexts, polyfilled with WebGL1 extensions */
33
- enforceWebGL2(enable: boolean): void {
34
- enforceWebGL2(enable);
33
+ override isDeviceHandle(handle: unknown): boolean {
34
+ // WebGL
35
+ if (typeof WebGL2RenderingContext !== 'undefined' && handle instanceof WebGL2RenderingContext) {
36
+ return true;
37
+ }
38
+
39
+ if (typeof WebGLRenderingContext !== 'undefined' && handle instanceof WebGLRenderingContext) {
40
+ log.warn('WebGL1 is not supported', handle)();
41
+ }
42
+
43
+ return false;
35
44
  }
36
45
 
37
46
  /**
@@ -41,11 +50,12 @@ export class WebGLAdapter extends Adapter {
41
50
  * @returns
42
51
  */
43
52
  async attach(gl: Device | WebGL2RenderingContext): Promise<WebGLDevice> {
53
+ const {WebGLDevice} = await import('./webgl-device');
44
54
  if (gl instanceof WebGLDevice) {
45
55
  return gl;
46
56
  }
47
57
  // @ts-expect-error
48
- if (gl?.device instanceof Device) {
58
+ if (gl?.device instanceof WebGLDevice) {
49
59
  // @ts-expect-error
50
60
  return gl.device as WebGLDevice;
51
61
  }
@@ -56,6 +66,8 @@ export class WebGLAdapter extends Adapter {
56
66
  }
57
67
 
58
68
  async create(props: DeviceProps = {}): Promise<WebGLDevice> {
69
+ const {WebGLDevice} = await import('./webgl-device');
70
+
59
71
  log.groupCollapsed(LOG_LEVEL, 'WebGLDevice created')();
60
72
 
61
73
  const promises: Promise<unknown>[] = [];
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {CanvasContextProps, TextureFormat} from '@luma.gl/core';
5
+ import type {CanvasContextProps} from '@luma.gl/core';
6
6
  import {CanvasContext} from '@luma.gl/core';
7
7
  import {WebGLDevice} from './webgl-device';
8
8
  import {WEBGLFramebuffer} from './resources/webgl-framebuffer';
@@ -12,10 +12,8 @@ import {WEBGLFramebuffer} from './resources/webgl-framebuffer';
12
12
  */
13
13
  export class WebGLCanvasContext extends CanvasContext {
14
14
  readonly device: WebGLDevice;
15
- readonly format: TextureFormat = 'rgba8unorm';
16
- readonly depthStencilFormat: TextureFormat = 'depth24plus';
15
+ readonly handle: unknown = null;
17
16
 
18
- presentationSize: [number, number];
19
17
  private _framebuffer: WEBGLFramebuffer | null = null;
20
18
 
21
19
  get [Symbol.toStringTag](): string {
@@ -26,57 +24,19 @@ export class WebGLCanvasContext extends CanvasContext {
26
24
  // Note: Base class creates / looks up the canvas (unless under Node.js)
27
25
  super(props);
28
26
  this.device = device;
29
- this.presentationSize = [-1, -1];
27
+
28
+ // Base class constructor cannot access derived methods/fields, so we need to call these functions in the subclass constructor
30
29
  this._setAutoCreatedCanvasId(`${this.device.id}-canvas`);
31
- this.update();
30
+ this._updateDevice();
32
31
  }
33
32
 
34
33
  getCurrentFramebuffer(): WEBGLFramebuffer {
35
- this.update();
36
34
  // Setting handle to null returns a reference to the default framebuffer
37
35
  this._framebuffer = this._framebuffer || new WEBGLFramebuffer(this.device, {handle: null});
38
36
  return this._framebuffer;
39
37
  }
40
38
 
41
- /** Resizes and updates render targets if necessary */
42
- update() {
43
- const size = this.getPixelSize();
44
- const sizeChanged =
45
- size[0] !== this.presentationSize[0] || size[1] !== this.presentationSize[1];
46
- if (sizeChanged) {
47
- this.presentationSize = size;
48
- this.resize();
49
- }
50
- }
51
-
52
- /**
53
- * Resize the canvas' drawing buffer.
54
- *
55
- * Can match the canvas CSS size, and optionally also consider devicePixelRatio
56
- * Can be called every frame
57
- *
58
- * Regardless of size, the drawing buffer will always be scaled to the viewport, but
59
- * for best visual results, usually set to either:
60
- * canvas CSS width x canvas CSS height
61
- * canvas CSS width * devicePixelRatio x canvas CSS height * devicePixelRatio
62
- * See http://webgl2fundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html
63
- */
64
- resize(options?: {width?: number; height?: number; useDevicePixels?: boolean | number}): void {
65
- if (!this.device.gl) return;
39
+ // IMPLEMENTATION OF ABSTRACT METHODS
66
40
 
67
- // Resize browser context .
68
- if (this.canvas) {
69
- const devicePixelRatio = this.getDevicePixelRatio(options?.useDevicePixels);
70
- this.setDevicePixelRatio(devicePixelRatio, options);
71
- return;
72
- }
73
- }
74
-
75
- commit() {
76
- // gl.commit was ultimately removed from the WebGL standard??
77
- // if (this.offScreen && this.gl.commit) {
78
- // // @ts-expect-error gl.commit is not officially part of WebGL2RenderingContext
79
- // this.gl.commit();
80
- // }
81
- }
41
+ _updateDevice(): void {}
82
42
  }
@@ -25,14 +25,11 @@ import type {
25
25
  RenderPipelineProps,
26
26
  ComputePipeline,
27
27
  ComputePipelineProps,
28
- // RenderPass,
29
- RenderPassProps,
30
- ComputePass,
31
- ComputePassProps,
32
28
  // CommandEncoder,
33
29
  CommandEncoderProps,
34
30
  TransformFeedbackProps,
35
- QuerySetProps
31
+ QuerySetProps,
32
+ Resource
36
33
  } from '@luma.gl/core';
37
34
  import {Device, CanvasContext, log} from '@luma.gl/core';
38
35
  import type {GLExtensions} from '@luma.gl/constants';
@@ -53,9 +50,9 @@ import {WEBGLShader} from './resources/webgl-shader';
53
50
  import {WEBGLSampler} from './resources/webgl-sampler';
54
51
  import {WEBGLTexture} from './resources/webgl-texture';
55
52
  import {WEBGLFramebuffer} from './resources/webgl-framebuffer';
56
- import {WEBGLRenderPass} from './resources/webgl-render-pass';
57
53
  import {WEBGLRenderPipeline} from './resources/webgl-render-pipeline';
58
54
  import {WEBGLCommandEncoder} from './resources/webgl-command-encoder';
55
+ import {WEBGLCommandBuffer} from './resources/webgl-command-buffer';
59
56
  import {WEBGLVertexArray} from './resources/webgl-vertex-array';
60
57
  import {WEBGLTransformFeedback} from './resources/webgl-transform-feedback';
61
58
  import {WEBGLQuerySet} from './resources/webgl-query-set';
@@ -71,9 +68,7 @@ import {getWebGLExtension} from '../context/helpers/webgl-extensions';
71
68
 
72
69
  /** WebGPU style Device API for a WebGL context */
73
70
  export class WebGLDevice extends Device {
74
- //
75
71
  // Public `Device` API
76
- //
77
72
 
78
73
  /** type of this device */
79
74
  readonly type = 'webgl';
@@ -82,10 +77,14 @@ export class WebGLDevice extends Device {
82
77
  readonly handle: WebGL2RenderingContext;
83
78
  features: WebGLDeviceFeatures;
84
79
  limits: WebGLDeviceLimits;
85
-
86
80
  readonly info: DeviceInfo;
87
81
  readonly canvasContext: WebGLCanvasContext;
88
82
 
83
+ readonly preferredColorFormat = 'rgba8unorm';
84
+ readonly preferredDepthFormat = 'depth24plus';
85
+
86
+ commandEncoder: WEBGLCommandEncoder;
87
+
89
88
  readonly lost: Promise<{reason: 'destroyed'; message: string}>;
90
89
 
91
90
  private _resolveContextLost?: (value: {reason: 'destroyed'; message: string}) => void;
@@ -94,20 +93,25 @@ export class WebGLDevice extends Device {
94
93
  readonly gl: WebGL2RenderingContext;
95
94
  readonly debug: boolean = false;
96
95
 
97
- /** State used by luma.gl classes: TODO - move to canvasContext*/
98
- readonly _canvasSizeInfo = {clientWidth: 0, clientHeight: 0, devicePixelRatio: 1};
96
+ /** Store constants */
97
+ // @ts-ignore TODO fix
98
+ _constants: (TypedArray | null)[];
99
99
 
100
100
  /** State used by luma.gl classes - TODO - not used? */
101
101
  readonly _extensions: GLExtensions = {};
102
102
  _polyfilled: boolean = false;
103
103
 
104
104
  /** Instance of Spector.js (if initialized) */
105
- spectorJS: Spector;
105
+ spectorJS: Spector | null;
106
106
 
107
107
  //
108
108
  // Public API
109
109
  //
110
110
 
111
+ override toString(): string {
112
+ return `${this[Symbol.toStringTag]}(${this.id})`;
113
+ }
114
+
111
115
  constructor(props: DeviceProps) {
112
116
  super({...props, id: props.id || uid('webgl-device')});
113
117
 
@@ -188,8 +192,6 @@ export class WebGLDevice extends Device {
188
192
  this.features.initializeFeatures();
189
193
  }
190
194
 
191
- this.canvasContext.resize();
192
-
193
195
  // Install context state tracking
194
196
  const glState = new WebGLStateTracker(this.gl, {
195
197
  log: (...args: any[]) => log.log(1, ...args)()
@@ -206,6 +208,8 @@ export class WebGLDevice extends Device {
206
208
  log.level = Math.max(log.level, 1);
207
209
  }
208
210
  }
211
+
212
+ this.commandEncoder = new WEBGLCommandEncoder(this, {id: `${this}-command-encoder`});
209
213
  }
210
214
 
211
215
  /**
@@ -265,20 +269,10 @@ export class WebGLDevice extends Device {
265
269
  return new WEBGLRenderPipeline(this, props);
266
270
  }
267
271
 
268
- beginRenderPass(props: RenderPassProps): WEBGLRenderPass {
269
- return new WEBGLRenderPass(this, props);
270
- }
271
-
272
272
  createComputePipeline(props?: ComputePipelineProps): ComputePipeline {
273
273
  throw new Error('ComputePipeline not supported in WebGL');
274
274
  }
275
275
 
276
- beginComputePass(props: ComputePassProps): ComputePass {
277
- throw new Error('ComputePass not supported in WebGL');
278
- }
279
-
280
- private renderPass: WEBGLRenderPass | null = null;
281
-
282
276
  override createCommandEncoder(props: CommandEncoderProps = {}): WEBGLCommandEncoder {
283
277
  return new WEBGLCommandEncoder(this, props);
284
278
  }
@@ -288,10 +282,14 @@ export class WebGLDevice extends Device {
288
282
  * https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/commit
289
283
  * Chrome's offscreen canvas does not require gl.commit
290
284
  */
291
- submit(): void {
292
- this.renderPass?.end();
293
- this.renderPass = null;
294
- // this.canvasContext.commit();
285
+ submit(commandBuffer: WEBGLCommandBuffer): void {
286
+ if (!commandBuffer) {
287
+ commandBuffer = this.commandEncoder.finish();
288
+ this.commandEncoder.destroy();
289
+ this.commandEncoder = this.createCommandEncoder({id: `${this.id}-default-encoder`});
290
+ }
291
+
292
+ commandBuffer._executeCommands();
295
293
  }
296
294
 
297
295
  //
@@ -393,16 +391,6 @@ export class WebGLDevice extends Device {
393
391
  webglState.pop();
394
392
  }
395
393
 
396
- /**
397
- * Storing data on a special field on WebGLObjects makes that data visible in SPECTOR chrome debug extension
398
- * luma.gl ids and props can be inspected
399
- */
400
- setSpectorMetadata(handle: unknown, props: Record<string, unknown>) {
401
- // @ts-expect-error
402
- // eslint-disable-next-line camelcase
403
- handle.__SPECTOR_Metadata = props;
404
- }
405
-
406
394
  /**
407
395
  * Returns the GL.<KEY> constant that corresponds to a numeric value of a GL constant
408
396
  * Be aware that there are some duplicates especially for constants that are 0,
@@ -432,9 +420,6 @@ export class WebGLDevice extends Device {
432
420
  }, {});
433
421
  }
434
422
 
435
- /** Store constants */
436
- _constants: (TypedArray | null)[];
437
-
438
423
  /**
439
424
  * Set a constant value for a location. Disabled attributes at that location will read from this value
440
425
  * @note WebGL constants are stored globally on the WebGL context, not the VertexArray
@@ -473,6 +458,26 @@ export class WebGLDevice extends Device {
473
458
  getWebGLExtension(this.gl, name, this._extensions);
474
459
  return this._extensions;
475
460
  }
461
+
462
+ // INTERNAL SUPPORT METHODS FOR WEBGL RESOURCES
463
+
464
+ /**
465
+ * Storing data on a special field on WebGLObjects makes that data visible in SPECTOR chrome debug extension
466
+ * luma.gl ids and props can be inspected
467
+ */
468
+ _setWebGLDebugMetadata(
469
+ handle: unknown,
470
+ resource: Resource<any>,
471
+ options: {spector: Record<string, unknown>}
472
+ ): void {
473
+ // @ts-expect-error
474
+ handle.luma = resource;
475
+
476
+ const spectorMetadata = {props: options.spector, id: options.spector.id};
477
+ // @ts-expect-error
478
+ // eslint-disable-next-line camelcase
479
+ handle.__SPECTOR_Metadata = spectorMetadata;
480
+ }
476
481
  }
477
482
 
478
483
  /** Set constant float array attribute */
@@ -1,6 +1,8 @@
1
1
  // Forked from https://github.com/BabylonJS/Spector.js/blob/master/dist/spector.d.ts
2
2
  /* eslint-disable camelcase, no-shadow */
3
3
 
4
+ // @ts-nocheck
5
+
4
6
  interface IEvent<T> {
5
7
  add(callback: (element: T) => void, context?: any): number;
6
8
  remove(id: number): void;
@@ -1071,8 +1073,11 @@ export abstract class Spector {
1071
1073
  }
1072
1074
  protected static tryGetContextFromHelperField: unknown;
1073
1075
  protected static tryGetContextFromCanvas: unknown;
1076
+ // @ts-ignore TODO
1074
1077
  readonly onCaptureStarted: IEvent<any>;
1078
+ // @ts-ignore TODO
1075
1079
  readonly onCapture: IEvent<ICapture>;
1080
+ // @ts-ignore TODO
1076
1081
  readonly onError: IEvent<string>;
1077
1082
  protected readonly logger;
1078
1083
  protected readonly timeSpy;
@@ -19,7 +19,7 @@ type SpectorProps = {
19
19
 
20
20
  const LOG_LEVEL = 1;
21
21
 
22
- let spector: Spector = null;
22
+ let spector: Spector | null = null;
23
23
  let initialized: boolean = false;
24
24
 
25
25
  declare global {
@@ -112,7 +112,7 @@ function getDebugContext(
112
112
 
113
113
  // DEBUG TRACING
114
114
 
115
- function getFunctionString(functionName: string, functionArgs): string {
115
+ function getFunctionString(functionName: string, functionArgs: unknown[]): string {
116
116
  // Cover bug in webgl-debug-tools
117
117
  functionArgs = Array.from(functionArgs).map(arg => (arg === undefined ? 'undefined' : arg));
118
118
  let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);
@@ -120,7 +120,12 @@ function getFunctionString(functionName: string, functionArgs): string {
120
120
  return `gl.${functionName}(${args})`;
121
121
  }
122
122
 
123
- function onGLError(props: DebugContextProps, err, functionName: string, args: any[]): void {
123
+ function onGLError(
124
+ props: DebugContextProps,
125
+ err: number,
126
+ functionName: string,
127
+ args: unknown[]
128
+ ): void {
124
129
  // Cover bug in webgl-debug-tools
125
130
  args = Array.from(args).map(arg => (arg === undefined ? 'undefined' : arg));
126
131
  const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);
@@ -135,7 +140,7 @@ function onGLError(props: DebugContextProps, err, functionName: string, args: an
135
140
  function onValidateGLFunc(
136
141
  props: DebugContextProps,
137
142
  functionName: string,
138
- functionArgs: any[]
143
+ functionArgs: unknown[]
139
144
  ): void {
140
145
  let functionString: string = '';
141
146
  if (log.level >= 1) {
@@ -10,8 +10,11 @@ export function getWebGLExtension(
10
10
  name: string,
11
11
  extensions: GLExtensions
12
12
  ): unknown {
13
+ // @ts-ignore TODO
13
14
  if (extensions[name] === undefined) {
15
+ // @ts-ignore TODO
14
16
  extensions[name] = gl.getExtension(name) || null;
15
17
  }
18
+ // @ts-ignore TODO
16
19
  return extensions[name];
17
20
  }
@@ -32,16 +32,19 @@ export function setGLParameters(gl: WebGL2RenderingContext, parameters: GLParame
32
32
 
33
33
  for (const key in parameters) {
34
34
  const glConstant = Number(key);
35
+ // @ts-ignore TODO
35
36
  const setter = GL_PARAMETER_SETTERS[key];
36
37
  if (setter) {
37
38
  // Composite setters should only be called once, so save them
38
39
  if (typeof setter === 'string') {
40
+ // @ts-ignore TODO
39
41
  compositeSetters[setter] = true;
40
42
  } else {
41
43
  // if (gl[glConstant] !== undefined) {
42
44
  // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...
43
45
  // TODO - deep equal on values? only call setter if value has changed?
44
46
  // NOTE - the setter will automatically update this.state
47
+ // @ts-ignore TODO
45
48
  setter(gl, parameters[key], glConstant);
46
49
  }
47
50
  }
@@ -59,6 +62,7 @@ export function setGLParameters(gl: WebGL2RenderingContext, parameters: GLParame
59
62
  if (cache) {
60
63
  for (const key in compositeSetters) {
61
64
  // TODO - avoid calling composite setters if values have not changed.
65
+ // @ts-ignore TODO
62
66
  const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];
63
67
  // Note - if `trackContextState` has been called,
64
68
  // the setter will automatically update this.state.cache
@@ -92,15 +96,18 @@ export function getGLParameters(
92
96
  if (typeof parameters === 'number') {
93
97
  // single GL enum
94
98
  const key = parameters;
99
+ // @ts-ignore TODO
95
100
  const getter = GL_PARAMETER_GETTERS[key];
96
101
  return getter ? getter(gl, key) : gl.getParameter(key);
97
102
  }
98
103
 
99
104
  const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);
100
105
 
101
- const state = {};
106
+ const state: GLParameters = {};
102
107
  for (const key of parameterKeys) {
108
+ // @ts-ignore TODO
103
109
  const getter = GL_PARAMETER_GETTERS[key];
110
+ // @ts-ignore TODO
104
111
  state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));
105
112
  }
106
113
  return state;
@@ -119,7 +126,7 @@ export function resetGLParameters(gl: WebGL2RenderingContext): void {
119
126
  // Helpers
120
127
 
121
128
  // Returns true if given object is empty, false otherwise.
122
- function isObjectEmpty(object) {
129
+ function isObjectEmpty(object: Record<string, unknown>): boolean {
123
130
  // @ts-ignore dummy key variable
124
131
  for (const key in object) {
125
132
  return false;
@@ -2,6 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
+ // @ts-nocheck TODO fix
6
+
5
7
  // Tables describing WebGL parameters
6
8
  import {GL, GLParameters} from '@luma.gl/constants';
7
9
 
@@ -132,6 +132,7 @@ export function polyfillWebGL1Extensions(gl: WebGL2RenderingContext): void {
132
132
 
133
133
  // Injected extensions
134
134
  if (extensionName in boundExtensions) {
135
+ // @ts-ignore TODO string index
135
136
  return boundExtensions[extensionName];
136
137
  }
137
138
 
@@ -2,16 +2,17 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
+ import {TypedArray} from '@luma.gl/core';
6
+
5
7
  /** deeply compare two arrays */
6
- export function deepArrayEqual(x: any, y: any): boolean {
8
+ export function deepArrayEqual(
9
+ x: unknown | unknown[] | TypedArray,
10
+ y: unknown | unknown[] | TypedArray
11
+ ): boolean {
7
12
  if (x === y) {
8
13
  return true;
9
14
  }
10
- const isArrayX = Array.isArray(x) || ArrayBuffer.isView(x);
11
- const isArrayY = Array.isArray(y) || ArrayBuffer.isView(y);
12
- // @ts-expect-error TODO fix
13
- if (isArrayX && isArrayY && x.length === y.length) {
14
- // @ts-expect-error TODO fix
15
+ if (isArray(x) && isArray(y) && x.length === y.length) {
15
16
  for (let i = 0; i < x.length; ++i) {
16
17
  if (x[i] !== y[i]) {
17
18
  return false;
@@ -21,3 +22,7 @@ export function deepArrayEqual(x: any, y: any): boolean {
21
22
  }
22
23
  return false;
23
24
  }
25
+
26
+ function isArray(x: unknown): x is unknown[] {
27
+ return Array.isArray(x) || ArrayBuffer.isView(x);
28
+ }
@@ -2,6 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
+ // @ts-nocheck TODO - fix
6
+
5
7
  import {setGLParameters, getGLParameters} from '../parameters/unified-parameter-api';
6
8
  import {deepArrayEqual} from './deep-array-equal';
7
9
  import {
@@ -66,7 +68,9 @@ export class WebGLStateTracker {
66
68
  * temporarily modifying, and then restoring state.
67
69
  */
68
70
  trackState(gl: WebGL2RenderingContext, options?: {copyState?: boolean}): void {
69
- this.cache = options.copyState ? getGLParameters(gl) : Object.assign({}, GL_PARAMETER_DEFAULTS);
71
+ this.cache = options?.copyState
72
+ ? getGLParameters(gl)
73
+ : Object.assign({}, GL_PARAMETER_DEFAULTS);
70
74
 
71
75
  if (this.initialized) {
72
76
  throw new Error('WebGLStateTracker');
@@ -51,7 +51,7 @@ export function withGLParameters(
51
51
  // Helpers
52
52
 
53
53
  // Returns true if given object is empty, false otherwise.
54
- function isObjectEmpty(object) {
54
+ function isObjectEmpty(object: unknown): boolean {
55
55
  // @ts-ignore - dummy key variable
56
56
  for (const key in object) {
57
57
  return false;
package/src/index.ts CHANGED
@@ -37,16 +37,12 @@ export {WEBGLVertexArray} from './adapter/resources/webgl-vertex-array';
37
37
  // WebGL adapter classes
38
38
  export {WEBGLTransformFeedback} from './adapter/resources/webgl-transform-feedback';
39
39
 
40
- // WebGL adapter classes
41
- export {Accessor} from './deprecated/accessor';
42
- export type {AccessorObject} from './types';
43
-
44
40
  // Unified parameter API
45
41
 
46
42
  export {setDeviceParameters, withDeviceParameters} from './adapter/converters/device-parameters';
47
43
 
48
44
  // HELPERS - EXPERIMENTAL
49
- export {getShaderLayoutFromGLSL} from './adapter/helpers/get-shader-layout';
45
+ export {getShaderLayoutFromGLSL} from './adapter/helpers/get-shader-layout-from-glsl';
50
46
  export {WebGLStateTracker} from './context/state-tracker/webgl-state-tracker';
51
47
 
52
48
  // DEPRECATED TEST EXPORTS
@@ -1 +0,0 @@
1
- {"version":3,"file":"vertex-formats.d.ts","sourceRoot":"","sources":["../../../src/adapter/converters/vertex-formats.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAEvD,KAAK,UAAU,GACX,EAAE,CAAC,aAAa,GAChB,EAAE,CAAC,IAAI,GACP,EAAE,CAAC,cAAc,GACjB,EAAE,CAAC,KAAK,GACR,EAAE,CAAC,YAAY,GACf,EAAE,CAAC,GAAG,GACN,EAAE,CAAC,UAAU,GACb,EAAE,CAAC,KAAK,CAAC;AAEb,0CAA0C;AAC1C,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAa/F;AAED,sCAAsC;AACtC,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,UAAQ,GAAG,UAAU,CAepF;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,UAAU,GAElB,EAAE,CAAC,aAAa,GAChB,EAAE,CAAC,IAAI,GACP,EAAE,CAAC,cAAc,GACjB,EAAE,CAAC,KAAK,GACR,EAAE,CAAC,YAAY,GACf,EAAE,CAAC,GAAG,GACN,EAAE,CAAC,UAAU,GACb,EAAE,CAAC,KAAK,CAqBX"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vertex-formats.js","sourceRoot":"","sources":["../../../src/adapter/converters/vertex-formats.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AAatC,0CAA0C;AAC1C,MAAM,UAAU,qBAAqB,CAAC,IAAgB,EAAE,UAAyB;IAC/E,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACvC,kBAAkB;IAClB,QAAQ,UAAU,EAAE,CAAC;QACnB,kDAAkD;QAClD,KAAK,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC;QACpB,KAAK,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC;QAC3B,kDAAkD;QAClD,KAAK,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC;QAC3B,KAAK,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC;IAC7B,CAAC;IACD,yBAAyB;IACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,mBAAmB,CAAC,IAAgB,EAAE,UAAU,GAAG,KAAK;IACtE,kBAAkB;IAClB,QAAQ,IAAI,EAAE,CAAC;QACb,+DAA+D;QAC/D,WAAa,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrD,WAAsB,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC9D,WAAe,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QACxD,WAAwB,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QACjE,WAAc,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QACtD,WAAuB,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC9D,WAAe,OAAO,SAAS,CAAC;QAChC,WAAoB,OAAO,SAAS,CAAC;IACvC,CAAC;IACD,yBAAyB;IACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,QAAoB;IAUpB,kBAAkB;IAClB,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,CAAC,YAAwB;QACtC,KAAK,OAAO,CAAC,CAAC,YAAe;QAC7B,KAAK,QAAQ,CAAC,CAAC,YAAwB;QACvC,KAAK,QAAQ,CAAC,CAAC,YAAe;QAC9B,KAAK,QAAQ,CAAC,CAAC,YAAyB;QACxC,KAAK,QAAQ,CAAC,CAAC,YAAgB;QAC/B,KAAK,SAAS,CAAC,CAAC,YAAyB;QACzC,KAAK,SAAS,CAAC,CAAC,YAAgB;QAChC,KAAK,QAAQ,CAAC,CAAC,YAAuB;QACtC,KAAK,QAAQ,CAAC,CAAC,YAAc;QAC7B,+DAA+D;QAC/D,0CAA0C;QAC1C,iCAAiC;QACjC,KAAK,SAAS,CAAC,CAAC,YAAqB;QACrC,KAAK,SAAS,CAAC,CAAC,YAAgB;IAClC,CAAC;IACD,yBAAyB;IACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpC,CAAC"}
@@ -1,26 +0,0 @@
1
- import { ShaderUniformType, ShaderAttributeType, VertexFormat } from '@luma.gl/core';
2
- import { GL, GLUniformType, GLCompositeType, GLDataType } from '@luma.gl/constants';
3
- /** Check is uniform is of sampler type */
4
- export declare function isSamplerUniform(type: GLUniformType): boolean;
5
- /** Decomposes a composite type (GL.VEC3) into a basic type (GL.FLOAT) and components (3) */
6
- export declare function decodeGLUniformType(glUniformType: GL): {
7
- format: ShaderUniformType;
8
- components: number;
9
- glType: GLDataType;
10
- };
11
- /** Decomposes a composite type (GL.VEC3) into a basic type (GL.FLOAT) and components (3) */
12
- export declare function decodeGLAttributeType(glAttributeType: GL): {
13
- attributeType: ShaderAttributeType;
14
- vertexFormat: VertexFormat;
15
- components: number;
16
- };
17
- /** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */
18
- export declare function decomposeCompositeGLDataType(compositeGLDataType: GLCompositeType): {
19
- type: GLDataType;
20
- components: number;
21
- } | null;
22
- export declare function getCompositeGLDataType(type: GL, components: any): {
23
- glType: GLDataType;
24
- name: string;
25
- } | null;
26
- //# sourceMappingURL=decode-webgl-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decode-webgl-types.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/decode-webgl-types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAE,mBAAmB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACnF,OAAO,EAAC,EAAE,EAAE,aAAa,EAAiB,eAAe,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEjG,0CAA0C;AAC1C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAE7D;AA2DD,4FAA4F;AAC5F,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,EAAE,GAAG;IACtD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;CACpB,CAOA;AAED,4FAA4F;AAC5F,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,EAAE,GAAG;IAC1D,aAAa,EAAE,mBAAmB,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CAEpB,CASA;AAED,0FAA0F;AAC1F,wBAAgB,4BAA4B,CAC1C,mBAAmB,EAAE,eAAe,GACnC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAO/C;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,EAAE,EACR,UAAU,KAAA,GACT;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAkB3C"}