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

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 (60) hide show
  1. package/dist/adapter/converters/texture-formats.d.ts +2 -2
  2. package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
  3. package/dist/adapter/device-helpers/device-limits.d.ts +1 -1
  4. package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
  5. package/dist/adapter/helpers/get-shader-info.d.ts +1 -1
  6. package/dist/adapter/helpers/get-shader-info.d.ts.map +1 -1
  7. package/dist/adapter/objects/webgl-renderbuffer.d.ts +1 -1
  8. package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
  9. package/dist/adapter/objects/webgl-vertex-array-object.d.ts +1 -1
  10. package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
  11. package/dist/adapter/resources/webgl-command-buffer.d.ts +5 -5
  12. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
  13. package/dist/adapter/resources/webgl-framebuffer.d.ts +2 -2
  14. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
  15. package/dist/adapter/resources/webgl-render-pipeline.js +2 -1
  16. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  17. package/dist/adapter/resources/webgl-texture.d.ts +5 -5
  18. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  19. package/dist/classic/buffer.d.ts +1 -1
  20. package/dist/classic/buffer.d.ts.map +1 -1
  21. package/dist/classic/clear.d.ts +22 -0
  22. package/dist/classic/clear.d.ts.map +1 -0
  23. package/dist/classic/clear.js +88 -0
  24. package/dist/classic/clear.js.map +1 -0
  25. package/dist/classic/copy-and-blit.d.ts +45 -0
  26. package/dist/classic/copy-and-blit.d.ts.map +1 -0
  27. package/dist/classic/copy-and-blit.js +136 -0
  28. package/dist/classic/copy-and-blit.js.map +1 -0
  29. package/dist/classic/format-utils.d.ts +3 -0
  30. package/dist/classic/format-utils.d.ts.map +1 -0
  31. package/dist/classic/format-utils.js +38 -0
  32. package/dist/classic/format-utils.js.map +1 -0
  33. package/dist/context/context/create-browser-context.d.ts +17 -19
  34. package/dist/context/context/create-browser-context.d.ts.map +1 -1
  35. package/dist/context/context/create-browser-context.js +4 -4
  36. package/dist/context/context/create-browser-context.js.map +1 -1
  37. package/dist/context/context/create-headless-context.d.ts +1 -1
  38. package/dist/context/context/create-headless-context.d.ts.map +1 -1
  39. package/dist/context/debug/spector.d.ts +1 -3
  40. package/dist/context/debug/spector.d.ts.map +1 -1
  41. package/dist/context/debug/webgl-developer-tools.d.ts +1 -1
  42. package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
  43. package/dist/context/parameters/webgl-parameter-tables.d.ts +1 -1
  44. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  45. package/dist/dist.dev.js +220 -5
  46. package/dist/index.cjs +191 -6
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +2 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/types.d.ts +1 -1
  52. package/dist/types.d.ts.map +1 -1
  53. package/dist.min.js +22 -22
  54. package/package.json +5 -5
  55. package/src/adapter/resources/webgl-render-pipeline.ts +1 -1
  56. package/src/classic/clear.ts +110 -0
  57. package/src/classic/copy-and-blit.ts +189 -0
  58. package/src/classic/format-utils.ts +43 -0
  59. package/src/context/context/create-browser-context.ts +37 -30
  60. package/src/index.ts +6 -1
package/dist/dist.dev.js CHANGED
@@ -52,6 +52,7 @@ var __exports__ = (() => {
52
52
  _checkFloat32ColorAttachment: () => _checkFloat32ColorAttachment,
53
53
  assertWebGL2Context: () => assertWebGL2Context,
54
54
  assertWebGLContext: () => assertWebGLContext,
55
+ clear: () => clear,
55
56
  convertGLToTextureFormat: () => convertGLToTextureFormat,
56
57
  getParameters: () => getParameters,
57
58
  getProgramBindings: () => getProgramBindings,
@@ -62,6 +63,8 @@ var __exports__ = (() => {
62
63
  polyfillContext: () => polyfillContext,
63
64
  popContextState: () => popContextState,
64
65
  pushContextState: () => pushContextState,
66
+ readPixelsToArray: () => readPixelsToArray,
67
+ readPixelsToBuffer: () => readPixelsToBuffer,
65
68
  registerHeadlessGL: () => registerHeadlessGL,
66
69
  resetParameters: () => resetParameters,
67
70
  setDeviceParameters: () => setDeviceParameters,
@@ -4333,11 +4336,11 @@ var __exports__ = (() => {
4333
4336
  webgl2: false
4334
4337
  };
4335
4338
  }
4336
- if (props.webgl2) {
4337
- gl = gl || canvas.getContext("webgl2", props);
4339
+ if (!gl && props.webgl2) {
4340
+ gl = canvas.getContext("webgl2", props);
4338
4341
  }
4339
- if (props.webgl1) {
4340
- gl = gl || canvas.getContext("webgl", props);
4342
+ if (!gl && props.webgl1) {
4343
+ gl = canvas.getContext("webgl", props);
4341
4344
  }
4342
4345
  canvas.removeEventListener("webglcontextcreationerror", onCreateError, false);
4343
4346
  if (!gl) {
@@ -9023,7 +9026,7 @@ ${formattedLog}`)();
9023
9026
  type,
9024
9027
  textureUnit
9025
9028
  } = uniformLayout;
9026
- const value = this.uniforms[name] || textureUnit;
9029
+ const value = this.uniforms[name] ?? textureUnit;
9027
9030
  if (value !== void 0) {
9028
9031
  setUniform(this.device.gl, location, type, value);
9029
9032
  }
@@ -9630,6 +9633,218 @@ ${formattedLog}`)();
9630
9633
  }
9631
9634
  return Boolean(gl && gl._version === 2);
9632
9635
  }
9636
+
9637
+ // src/classic/clear.ts
9638
+ var GL_DEPTH_BUFFER_BIT2 = 256;
9639
+ var GL_STENCIL_BUFFER_BIT2 = 1024;
9640
+ var GL_COLOR_BUFFER_BIT2 = 16384;
9641
+ var ERR_ARGUMENTS = "clear: bad arguments";
9642
+ function clear(gl, options) {
9643
+ const device = WebGLDevice.attach(gl);
9644
+ const {
9645
+ framebuffer = null,
9646
+ color = null,
9647
+ depth = null,
9648
+ stencil = null
9649
+ } = options || {};
9650
+ const parameters = {};
9651
+ if (framebuffer) {
9652
+ parameters.framebuffer = framebuffer;
9653
+ }
9654
+ let clearFlags = 0;
9655
+ if (color) {
9656
+ clearFlags |= GL_COLOR_BUFFER_BIT2;
9657
+ if (color !== true) {
9658
+ parameters.clearColor = color;
9659
+ }
9660
+ }
9661
+ if (depth) {
9662
+ clearFlags |= GL_DEPTH_BUFFER_BIT2;
9663
+ if (depth !== true) {
9664
+ parameters.clearDepth = depth;
9665
+ }
9666
+ }
9667
+ if (stencil) {
9668
+ clearFlags |= GL_STENCIL_BUFFER_BIT2;
9669
+ if (depth !== true) {
9670
+ parameters.clearStencil = depth;
9671
+ }
9672
+ }
9673
+ assert2(clearFlags !== 0, ERR_ARGUMENTS);
9674
+ withParameters(device.gl, parameters, () => {
9675
+ device.gl.clear(clearFlags);
9676
+ });
9677
+ }
9678
+
9679
+ // src/classic/format-utils.ts
9680
+ function glFormatToComponents(format) {
9681
+ switch (format) {
9682
+ case GL.ALPHA:
9683
+ case GL.R32F:
9684
+ case GL.RED:
9685
+ return 1;
9686
+ case GL.RG32F:
9687
+ case GL.RG:
9688
+ return 2;
9689
+ case GL.RGB:
9690
+ case GL.RGB32F:
9691
+ return 3;
9692
+ case GL.RGBA:
9693
+ case GL.RGBA32F:
9694
+ return 4;
9695
+ default:
9696
+ assert2(false);
9697
+ return 0;
9698
+ }
9699
+ }
9700
+ function glTypeToBytes(type) {
9701
+ switch (type) {
9702
+ case GL.UNSIGNED_BYTE:
9703
+ return 1;
9704
+ case GL.UNSIGNED_SHORT_5_6_5:
9705
+ case GL.UNSIGNED_SHORT_4_4_4_4:
9706
+ case GL.UNSIGNED_SHORT_5_5_5_1:
9707
+ return 2;
9708
+ case GL.FLOAT:
9709
+ return 4;
9710
+ default:
9711
+ assert2(false);
9712
+ return 0;
9713
+ }
9714
+ }
9715
+
9716
+ // src/classic/copy-and-blit.ts
9717
+ function readPixelsToArray(source, options) {
9718
+ const {
9719
+ sourceX = 0,
9720
+ sourceY = 0,
9721
+ sourceFormat = GL.RGBA
9722
+ } = options || {};
9723
+ let {
9724
+ sourceAttachment = GL.COLOR_ATTACHMENT0,
9725
+ // TODO - support gl.readBuffer
9726
+ target = null,
9727
+ // following parameters are auto deduced if not provided
9728
+ sourceWidth,
9729
+ sourceHeight,
9730
+ sourceType
9731
+ } = options || {};
9732
+ const {
9733
+ framebuffer,
9734
+ deleteFramebuffer
9735
+ } = getFramebuffer2(source);
9736
+ assert2(framebuffer);
9737
+ const {
9738
+ gl,
9739
+ handle
9740
+ } = framebuffer;
9741
+ sourceWidth = sourceWidth || framebuffer.width;
9742
+ sourceHeight = sourceHeight || framebuffer.height;
9743
+ if (sourceAttachment === GL.COLOR_ATTACHMENT0 && handle === null) {
9744
+ sourceAttachment = GL.FRONT;
9745
+ }
9746
+ const attachment = sourceAttachment - GL.COLOR_ATTACHMENT0;
9747
+ sourceType = sourceType || framebuffer.colorAttachments[attachment].type;
9748
+ target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);
9749
+ sourceType = sourceType || getGLTypeFromTypedArray(target);
9750
+ const prevHandle2 = gl.bindFramebuffer(GL.FRAMEBUFFER, handle);
9751
+ gl.readPixels(sourceX, sourceY, sourceWidth, sourceHeight, sourceFormat, sourceType, target);
9752
+ gl.bindFramebuffer(GL.FRAMEBUFFER, prevHandle2 || null);
9753
+ if (deleteFramebuffer) {
9754
+ framebuffer.destroy();
9755
+ }
9756
+ return target;
9757
+ }
9758
+ function readPixelsToBuffer(source, options) {
9759
+ const {
9760
+ sourceX = 0,
9761
+ sourceY = 0,
9762
+ sourceFormat = GL.RGBA,
9763
+ targetByteOffset = 0
9764
+ } = options || {};
9765
+ let {
9766
+ target,
9767
+ sourceWidth,
9768
+ sourceHeight,
9769
+ sourceType
9770
+ } = options || {};
9771
+ const {
9772
+ framebuffer,
9773
+ deleteFramebuffer
9774
+ } = getFramebuffer2(source);
9775
+ assert2(framebuffer);
9776
+ sourceWidth = sourceWidth || framebuffer.width;
9777
+ sourceHeight = sourceHeight || framebuffer.height;
9778
+ const webglFramebuffer = framebuffer;
9779
+ const gl2 = webglFramebuffer.device.assertWebGL2();
9780
+ sourceType = sourceType || (target ? target.type : GL.UNSIGNED_BYTE);
9781
+ if (!target) {
9782
+ const components = glFormatToComponents(sourceFormat);
9783
+ const byteCount = glTypeToBytes(sourceType);
9784
+ const byteLength = targetByteOffset + sourceWidth * sourceHeight * components * byteCount;
9785
+ target = new ClassicBuffer(gl2, {
9786
+ byteLength,
9787
+ accessor: {
9788
+ type: sourceType,
9789
+ size: components
9790
+ }
9791
+ });
9792
+ }
9793
+ target.bind({
9794
+ target: GL.PIXEL_PACK_BUFFER
9795
+ });
9796
+ withParameters(gl2, {
9797
+ framebuffer
9798
+ }, () => {
9799
+ gl2.readPixels(sourceX, sourceY, sourceWidth, sourceHeight, sourceFormat, sourceType, targetByteOffset);
9800
+ });
9801
+ target.unbind({
9802
+ target: GL.PIXEL_PACK_BUFFER
9803
+ });
9804
+ if (deleteFramebuffer) {
9805
+ framebuffer.destroy();
9806
+ }
9807
+ return target;
9808
+ }
9809
+ function getFramebuffer2(source) {
9810
+ if (!(source instanceof Framebuffer)) {
9811
+ return {
9812
+ framebuffer: toFramebuffer(source),
9813
+ deleteFramebuffer: true
9814
+ };
9815
+ }
9816
+ return {
9817
+ framebuffer: source,
9818
+ deleteFramebuffer: false
9819
+ };
9820
+ }
9821
+ function toFramebuffer(texture, props) {
9822
+ const {
9823
+ device,
9824
+ width,
9825
+ height,
9826
+ id
9827
+ } = texture;
9828
+ const framebuffer = device.createFramebuffer({
9829
+ ...props,
9830
+ id: `framebuffer-for-${id}`,
9831
+ width,
9832
+ height,
9833
+ colorAttachments: [texture]
9834
+ });
9835
+ return framebuffer;
9836
+ }
9837
+ function getPixelArray(pixelArray, type, format, width, height) {
9838
+ if (pixelArray) {
9839
+ return pixelArray;
9840
+ }
9841
+ type = type || GL.UNSIGNED_BYTE;
9842
+ const ArrayType = getTypedArrayFromGLType(type, {
9843
+ clamped: false
9844
+ });
9845
+ const components = glFormatToComponents(format);
9846
+ return new ArrayType(width * height * components);
9847
+ }
9633
9848
  return __toCommonJS(src_exports);
9634
9849
  })();
9635
9850
  return __exports__;
package/dist/index.cjs CHANGED
@@ -87,6 +87,7 @@ __export(src_exports, {
87
87
  _checkFloat32ColorAttachment: () => _checkFloat32ColorAttachment,
88
88
  assertWebGL2Context: () => assertWebGL2Context,
89
89
  assertWebGLContext: () => assertWebGLContext,
90
+ clear: () => clear,
90
91
  convertGLToTextureFormat: () => convertGLToTextureFormat,
91
92
  getParameters: () => getParameters,
92
93
  getProgramBindings: () => getProgramBindings,
@@ -97,6 +98,8 @@ __export(src_exports, {
97
98
  polyfillContext: () => polyfillContext,
98
99
  popContextState: () => popContextState,
99
100
  pushContextState: () => pushContextState,
101
+ readPixelsToArray: () => readPixelsToArray,
102
+ readPixelsToBuffer: () => readPixelsToBuffer,
100
103
  registerHeadlessGL: () => registerHeadlessGL,
101
104
  resetParameters: () => resetParameters,
102
105
  setDeviceParameters: () => setDeviceParameters,
@@ -1523,11 +1526,11 @@ function createBrowserContext(canvas, props) {
1523
1526
  if (props.type === "webgl1") {
1524
1527
  props = __spreadProps(__spreadValues({}, props), { webgl2: false });
1525
1528
  }
1526
- if (props.webgl2) {
1527
- gl = gl || canvas.getContext("webgl2", props);
1529
+ if (!gl && props.webgl2) {
1530
+ gl = canvas.getContext("webgl2", props);
1528
1531
  }
1529
- if (props.webgl1) {
1530
- gl = gl || canvas.getContext("webgl", props);
1532
+ if (!gl && props.webgl1) {
1533
+ gl = canvas.getContext("webgl", props);
1531
1534
  }
1532
1535
  canvas.removeEventListener("webglcontextcreationerror", onCreateError, false);
1533
1536
  if (!gl) {
@@ -1541,7 +1544,11 @@ function createBrowserContext(canvas, props) {
1541
1544
  }
1542
1545
  if (props.onContextRestored) {
1543
1546
  const { onContextRestored } = props;
1544
- canvas.addEventListener("webglcontextrestored", (event) => onContextRestored(event), false);
1547
+ canvas.addEventListener(
1548
+ "webglcontextrestored",
1549
+ (event) => onContextRestored(event),
1550
+ false
1551
+ );
1545
1552
  }
1546
1553
  return gl;
1547
1554
  }
@@ -5556,9 +5563,10 @@ var WEBGLRenderPipeline = class extends import_api23.RenderPipeline {
5556
5563
  }
5557
5564
  }
5558
5565
  _applyUniforms() {
5566
+ var _a;
5559
5567
  for (const uniformLayout of this.layout.uniforms || []) {
5560
5568
  const { name, location, type, textureUnit } = uniformLayout;
5561
- const value = this.uniforms[name] || textureUnit;
5569
+ const value = (_a = this.uniforms[name]) != null ? _a : textureUnit;
5562
5570
  if (value !== void 0) {
5563
5571
  setUniform(this.device.gl, location, type, value);
5564
5572
  }
@@ -6133,3 +6141,180 @@ function isWebGL22(gl) {
6133
6141
  }
6134
6142
  return Boolean(gl && gl._version === 2);
6135
6143
  }
6144
+
6145
+ // src/classic/clear.ts
6146
+ var import_api27 = require("@luma.gl/api");
6147
+ var GL_DEPTH_BUFFER_BIT2 = 256;
6148
+ var GL_STENCIL_BUFFER_BIT2 = 1024;
6149
+ var GL_COLOR_BUFFER_BIT2 = 16384;
6150
+ var ERR_ARGUMENTS = "clear: bad arguments";
6151
+ function clear(gl, options) {
6152
+ const device = WebGLDevice.attach(gl);
6153
+ const { framebuffer = null, color = null, depth = null, stencil = null } = options || {};
6154
+ const parameters = {};
6155
+ if (framebuffer) {
6156
+ parameters.framebuffer = framebuffer;
6157
+ }
6158
+ let clearFlags = 0;
6159
+ if (color) {
6160
+ clearFlags |= GL_COLOR_BUFFER_BIT2;
6161
+ if (color !== true) {
6162
+ parameters.clearColor = color;
6163
+ }
6164
+ }
6165
+ if (depth) {
6166
+ clearFlags |= GL_DEPTH_BUFFER_BIT2;
6167
+ if (depth !== true) {
6168
+ parameters.clearDepth = depth;
6169
+ }
6170
+ }
6171
+ if (stencil) {
6172
+ clearFlags |= GL_STENCIL_BUFFER_BIT2;
6173
+ if (depth !== true) {
6174
+ parameters.clearStencil = depth;
6175
+ }
6176
+ }
6177
+ (0, import_api27.assert)(clearFlags !== 0, ERR_ARGUMENTS);
6178
+ withParameters(device.gl, parameters, () => {
6179
+ device.gl.clear(clearFlags);
6180
+ });
6181
+ }
6182
+
6183
+ // src/classic/copy-and-blit.ts
6184
+ var import_api29 = require("@luma.gl/api");
6185
+ var import_constants28 = __toESM(require("@luma.gl/constants"), 1);
6186
+
6187
+ // src/classic/format-utils.ts
6188
+ var import_api28 = require("@luma.gl/api");
6189
+ var import_constants27 = __toESM(require("@luma.gl/constants"), 1);
6190
+ function glFormatToComponents(format) {
6191
+ switch (format) {
6192
+ case import_constants27.default.ALPHA:
6193
+ case import_constants27.default.R32F:
6194
+ case import_constants27.default.RED:
6195
+ return 1;
6196
+ case import_constants27.default.RG32F:
6197
+ case import_constants27.default.RG:
6198
+ return 2;
6199
+ case import_constants27.default.RGB:
6200
+ case import_constants27.default.RGB32F:
6201
+ return 3;
6202
+ case import_constants27.default.RGBA:
6203
+ case import_constants27.default.RGBA32F:
6204
+ return 4;
6205
+ default:
6206
+ (0, import_api28.assert)(false);
6207
+ return 0;
6208
+ }
6209
+ }
6210
+ function glTypeToBytes(type) {
6211
+ switch (type) {
6212
+ case import_constants27.default.UNSIGNED_BYTE:
6213
+ return 1;
6214
+ case import_constants27.default.UNSIGNED_SHORT_5_6_5:
6215
+ case import_constants27.default.UNSIGNED_SHORT_4_4_4_4:
6216
+ case import_constants27.default.UNSIGNED_SHORT_5_5_5_1:
6217
+ return 2;
6218
+ case import_constants27.default.FLOAT:
6219
+ return 4;
6220
+ default:
6221
+ (0, import_api28.assert)(false);
6222
+ return 0;
6223
+ }
6224
+ }
6225
+
6226
+ // src/classic/copy-and-blit.ts
6227
+ function readPixelsToArray(source, options) {
6228
+ const { sourceX = 0, sourceY = 0, sourceFormat = import_constants28.default.RGBA } = options || {};
6229
+ let {
6230
+ sourceAttachment = import_constants28.default.COLOR_ATTACHMENT0,
6231
+ // TODO - support gl.readBuffer
6232
+ target = null,
6233
+ // following parameters are auto deduced if not provided
6234
+ sourceWidth,
6235
+ sourceHeight,
6236
+ sourceType
6237
+ } = options || {};
6238
+ const { framebuffer, deleteFramebuffer } = getFramebuffer2(source);
6239
+ (0, import_api29.assert)(framebuffer);
6240
+ const { gl, handle } = framebuffer;
6241
+ sourceWidth = sourceWidth || framebuffer.width;
6242
+ sourceHeight = sourceHeight || framebuffer.height;
6243
+ if (sourceAttachment === import_constants28.default.COLOR_ATTACHMENT0 && handle === null) {
6244
+ sourceAttachment = import_constants28.default.FRONT;
6245
+ }
6246
+ const attachment = sourceAttachment - import_constants28.default.COLOR_ATTACHMENT0;
6247
+ sourceType = sourceType || framebuffer.colorAttachments[attachment].type;
6248
+ target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);
6249
+ sourceType = sourceType || getGLTypeFromTypedArray(target);
6250
+ const prevHandle2 = gl.bindFramebuffer(import_constants28.default.FRAMEBUFFER, handle);
6251
+ gl.readPixels(sourceX, sourceY, sourceWidth, sourceHeight, sourceFormat, sourceType, target);
6252
+ gl.bindFramebuffer(import_constants28.default.FRAMEBUFFER, prevHandle2 || null);
6253
+ if (deleteFramebuffer) {
6254
+ framebuffer.destroy();
6255
+ }
6256
+ return target;
6257
+ }
6258
+ function readPixelsToBuffer(source, options) {
6259
+ const { sourceX = 0, sourceY = 0, sourceFormat = import_constants28.default.RGBA, targetByteOffset = 0 } = options || {};
6260
+ let { target, sourceWidth, sourceHeight, sourceType } = options || {};
6261
+ const { framebuffer, deleteFramebuffer } = getFramebuffer2(source);
6262
+ (0, import_api29.assert)(framebuffer);
6263
+ sourceWidth = sourceWidth || framebuffer.width;
6264
+ sourceHeight = sourceHeight || framebuffer.height;
6265
+ const webglFramebuffer = framebuffer;
6266
+ const gl2 = webglFramebuffer.device.assertWebGL2();
6267
+ sourceType = sourceType || (target ? target.type : import_constants28.default.UNSIGNED_BYTE);
6268
+ if (!target) {
6269
+ const components = glFormatToComponents(sourceFormat);
6270
+ const byteCount = glTypeToBytes(sourceType);
6271
+ const byteLength = targetByteOffset + sourceWidth * sourceHeight * components * byteCount;
6272
+ target = new ClassicBuffer(gl2, { byteLength, accessor: { type: sourceType, size: components } });
6273
+ }
6274
+ target.bind({ target: import_constants28.default.PIXEL_PACK_BUFFER });
6275
+ withParameters(gl2, { framebuffer }, () => {
6276
+ gl2.readPixels(
6277
+ sourceX,
6278
+ sourceY,
6279
+ sourceWidth,
6280
+ sourceHeight,
6281
+ sourceFormat,
6282
+ sourceType,
6283
+ targetByteOffset
6284
+ );
6285
+ });
6286
+ target.unbind({ target: import_constants28.default.PIXEL_PACK_BUFFER });
6287
+ if (deleteFramebuffer) {
6288
+ framebuffer.destroy();
6289
+ }
6290
+ return target;
6291
+ }
6292
+ function getFramebuffer2(source) {
6293
+ if (!(source instanceof import_api29.Framebuffer)) {
6294
+ return { framebuffer: toFramebuffer(source), deleteFramebuffer: true };
6295
+ }
6296
+ return { framebuffer: source, deleteFramebuffer: false };
6297
+ }
6298
+ function toFramebuffer(texture, props) {
6299
+ const { device, width, height, id } = texture;
6300
+ const framebuffer = device.createFramebuffer(
6301
+ __spreadProps(__spreadValues({}, props), {
6302
+ id: `framebuffer-for-${id}`,
6303
+ width,
6304
+ height,
6305
+ colorAttachments: [
6306
+ texture
6307
+ ]
6308
+ })
6309
+ );
6310
+ return framebuffer;
6311
+ }
6312
+ function getPixelArray(pixelArray, type, format, width, height) {
6313
+ if (pixelArray) {
6314
+ return pixelArray;
6315
+ }
6316
+ type = type || import_constants28.default.UNSIGNED_BYTE;
6317
+ const ArrayType = getTypedArrayFromGLType(type, { clamped: false });
6318
+ const components = glFormatToComponents(format);
6319
+ return new ArrayType(width * height * components);
6320
+ }
package/dist/index.d.ts CHANGED
@@ -28,4 +28,6 @@ export { polyfillContext } from './context/polyfill/polyfill-context';
28
28
  export { getShaderLayout, getProgramBindings } from './adapter/helpers/get-shader-layout';
29
29
  export { convertGLToTextureFormat, _checkFloat32ColorAttachment } from './adapter/converters/texture-formats';
30
30
  export { TEXTURE_FORMATS as _TEXTURE_FORMATS } from './adapter/converters/texture-formats';
31
+ export { clear } from './classic/clear';
32
+ export { readPixelsToBuffer, readPixelsToArray } from './classic/copy-and-blit';
31
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,YAAY,EAAC,WAAW,EAAC,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2CAA2C,CAAC;AAG7E,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAGlE,OAAO,EAAC,aAAa,EAAE,aAAa,IAAI,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAE/D,OAAO,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAC,gBAAgB,EAAC,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAE9E,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAC,eAAe,EAAC,MAAM,uCAAuC,CAAC;AAItE,YAAY,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAC,sBAAsB,EAAC,MAAM,6CAA6C,CAAC;AAGnF,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAC,kBAAkB,EAAE,kBAAkB,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAC,aAAa,EAAE,aAAa,IAAI,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAExE,OAAO,EACL,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAEjG,YAAY,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,aAAa,EACb,aAAa,EACb,eAAe,EAChB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EACL,cAAc,EACf,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAGpE,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAC,wBAAwB,EAAE,4BAA4B,EAAC,MAAM,sCAAsC,CAAC;AAE5G,OAAO,EAAC,eAAe,IAAI,gBAAgB,EAAC,MAAM,sCAAsC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,YAAY,EAAC,WAAW,EAAC,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2CAA2C,CAAC;AAG7E,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAGlE,OAAO,EAAC,aAAa,EAAE,aAAa,IAAI,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAE/D,OAAO,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAC,gBAAgB,EAAC,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAE9E,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAC,eAAe,EAAC,MAAM,uCAAuC,CAAC;AAItE,YAAY,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAC,sBAAsB,EAAC,MAAM,6CAA6C,CAAC;AAGnF,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAC,kBAAkB,EAAE,kBAAkB,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAC,aAAa,EAAE,aAAa,IAAI,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAExE,OAAO,EACL,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAEjG,YAAY,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,aAAa,EACb,aAAa,EACb,eAAe,EAChB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EACL,cAAc,EACf,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAGpE,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAC,wBAAwB,EAAE,4BAA4B,EAAC,MAAM,sCAAsC,CAAC;AAG5G,OAAO,EAAC,eAAe,IAAI,gBAAgB,EAAC,MAAM,sCAAsC,CAAC;AAGzF,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -23,4 +23,6 @@ export { polyfillContext } from "./context/polyfill/polyfill-context.js";
23
23
  export { getShaderLayout, getProgramBindings } from "./adapter/helpers/get-shader-layout.js";
24
24
  export { convertGLToTextureFormat, _checkFloat32ColorAttachment } from "./adapter/converters/texture-formats.js";
25
25
  export { TEXTURE_FORMATS as _TEXTURE_FORMATS } from "./adapter/converters/texture-formats.js";
26
+ export { clear } from "./classic/clear.js";
27
+ export { readPixelsToBuffer, readPixelsToArray } from "./classic/copy-and-blit.js";
26
28
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["registerHeadlessGL","WebGLDevice","WebGLCanvasContext","WebGLResource","WEBGLResource","WEBGLBuffer","WEBGLTexture","WEBGLShader","WEBGLSampler","WEBGLFramebuffer","WEBGLRenderPipeline","WEBGLCommandEncoder","WEBGLRenderPass","WEBGLRenderbuffer","WEBGLVertexArrayObject","Accessor","ClassicBuffer","Buffer","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","setDeviceParameters","withDeviceParameters","getParameters","setParameters","resetParameters","withParameters","trackContextState","pushContextState","popContextState","polyfillContext","getShaderLayout","getProgramBindings","convertGLToTextureFormat","_checkFloat32ColorAttachment","TEXTURE_FORMATS","_TEXTURE_FORMATS"],"sources":["../src/index.ts"],"sourcesContent":["// luma.gl Base WebGL wrapper library\n// Provides simple class/function wrappers around the low level webgl objects\n// These classes are intentionally close to the WebGL API\n// but make it easier to use.\n// Higher level abstractions can be built on these classes\n\n// Types\nexport type {WebGLLimits} from './adapter/device-helpers/device-limits';\n\nexport {registerHeadlessGL} from './context/context/create-headless-context';\n\n// WebGL adapter classes\nexport {WebGLDevice} from './adapter/webgl-device';\nexport {WebGLCanvasContext} from './adapter/webgl-canvas-context';\n\n// WebGL Resource classes\nexport {WebGLResource, WebGLResource as WEBGLResource} from './adapter/objects/webgl-resource';\nexport {WEBGLBuffer} from './adapter/resources/webgl-buffer';\nexport {WEBGLTexture} from './adapter/resources/webgl-texture';\n// export {WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';\nexport {WEBGLShader} from './adapter/resources/webgl-shader';\nexport {WEBGLSampler} from './adapter/resources/webgl-sampler';\nexport {WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';\n\nexport {WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';\n// export {WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';\nexport {WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';\nexport {WEBGLRenderPass} from './adapter/resources/webgl-render-pass';\n// export {WEBGLComputePass} from './adapter/resources/webgl-compute-pass';\n\n// non-api resources\nexport type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';\nexport {WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';\nexport {WEBGLVertexArrayObject} from './adapter/objects/webgl-vertex-array-object';\n\n// WebGL adapter classes (Legacy, will be moved to webgl-legacy)\nexport {Accessor} from './classic/accessor';\nexport type {AccessorObject} from './types';\nexport type {ClassicBufferProps, ClassicBufferProps as BufferProps} from './classic/buffer';\nexport {ClassicBuffer, ClassicBuffer as Buffer} from './classic/buffer';\n\nexport {\n isWebGL,\n isWebGL2,\n getWebGL2Context,\n assertWebGLContext,\n assertWebGL2Context\n} from './context/context/webgl-checks';\n\n// Unified parameter API\n\nexport {setDeviceParameters, withDeviceParameters} from './adapter/converters/device-parameters';\n\nexport type {GLParameters} from '@luma.gl/constants';\nexport {\n getParameters,\n setParameters,\n resetParameters\n} from './context/parameters/unified-parameter-api';\n\nexport {\n withParameters\n} from './context/state-tracker/with-parameters';\n\n// State tracking\nexport {\n trackContextState,\n pushContextState,\n popContextState\n} from './context/state-tracker/track-context-state';\n\n// Polyfills (supports a subset of WebGL2 APIs on WebGL1 contexts)\nexport {polyfillContext} from './context/polyfill/polyfill-context';\n\n// HELPERS - EXPERIMENTAL\nexport {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';\nexport {convertGLToTextureFormat, _checkFloat32ColorAttachment} from './adapter/converters/texture-formats';\n\nexport {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';"],"mappings":"SASQA,kBAAkB;AAAA,SAGlBC,WAAW;AAAA,SACXC,kBAAkB;AAAA,SAGlBC,aAAa,EAAEA,aAAa,IAAIC,aAAa;AAAA,SAC7CC,WAAW;AAAA,SACXC,YAAY;AAAA,SAEZC,WAAW;AAAA,SACXC,YAAY;AAAA,SACZC,gBAAgB;AAAA,SAEhBC,mBAAmB;AAAA,SAEnBC,mBAAmB;AAAA,SACnBC,eAAe;AAAA,SAKfC,iBAAiB;AAAA,SACjBC,sBAAsB;AAAA,SAGtBC,QAAQ;AAAA,SAGRC,aAAa,EAAEA,aAAa,IAAIC,MAAM;AAAA,SAG5CC,OAAO,EACPC,QAAQ,EACRC,gBAAgB,EAChBC,kBAAkB,EAClBC,mBAAmB;AAAA,SAKbC,mBAAmB,EAAEC,oBAAoB;AAAA,SAI/CC,aAAa,EACbC,aAAa,EACbC,eAAe;AAAA,SAIfC,cAAc;AAAA,SAKdC,iBAAiB,EACjBC,gBAAgB,EAChBC,eAAe;AAAA,SAITC,eAAe;AAAA,SAGfC,eAAe,EAAEC,kBAAkB;AAAA,SACnCC,wBAAwB,EAAEC,4BAA4B;AAAA,SAEtDC,eAAe,IAAIC,gBAAgB"}
1
+ {"version":3,"file":"index.js","names":["registerHeadlessGL","WebGLDevice","WebGLCanvasContext","WebGLResource","WEBGLResource","WEBGLBuffer","WEBGLTexture","WEBGLShader","WEBGLSampler","WEBGLFramebuffer","WEBGLRenderPipeline","WEBGLCommandEncoder","WEBGLRenderPass","WEBGLRenderbuffer","WEBGLVertexArrayObject","Accessor","ClassicBuffer","Buffer","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","setDeviceParameters","withDeviceParameters","getParameters","setParameters","resetParameters","withParameters","trackContextState","pushContextState","popContextState","polyfillContext","getShaderLayout","getProgramBindings","convertGLToTextureFormat","_checkFloat32ColorAttachment","TEXTURE_FORMATS","_TEXTURE_FORMATS","clear","readPixelsToBuffer","readPixelsToArray"],"sources":["../src/index.ts"],"sourcesContent":["// luma.gl Base WebGL wrapper library\n// Provides simple class/function wrappers around the low level webgl objects\n// These classes are intentionally close to the WebGL API\n// but make it easier to use.\n// Higher level abstractions can be built on these classes\n\n// Types\nexport type {WebGLLimits} from './adapter/device-helpers/device-limits';\n\nexport {registerHeadlessGL} from './context/context/create-headless-context';\n\n// WebGL adapter classes\nexport {WebGLDevice} from './adapter/webgl-device';\nexport {WebGLCanvasContext} from './adapter/webgl-canvas-context';\n\n// WebGL Resource classes\nexport {WebGLResource, WebGLResource as WEBGLResource} from './adapter/objects/webgl-resource';\nexport {WEBGLBuffer} from './adapter/resources/webgl-buffer';\nexport {WEBGLTexture} from './adapter/resources/webgl-texture';\n// export {WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';\nexport {WEBGLShader} from './adapter/resources/webgl-shader';\nexport {WEBGLSampler} from './adapter/resources/webgl-sampler';\nexport {WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';\n\nexport {WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';\n// export {WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';\nexport {WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';\nexport {WEBGLRenderPass} from './adapter/resources/webgl-render-pass';\n// export {WEBGLComputePass} from './adapter/resources/webgl-compute-pass';\n\n// non-api resources\nexport type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';\nexport {WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';\nexport {WEBGLVertexArrayObject} from './adapter/objects/webgl-vertex-array-object';\n\n// WebGL adapter classes (Legacy, will be moved to webgl-legacy)\nexport {Accessor} from './classic/accessor';\nexport type {AccessorObject} from './types';\nexport type {ClassicBufferProps, ClassicBufferProps as BufferProps} from './classic/buffer';\nexport {ClassicBuffer, ClassicBuffer as Buffer} from './classic/buffer';\n\nexport {\n isWebGL,\n isWebGL2,\n getWebGL2Context,\n assertWebGLContext,\n assertWebGL2Context\n} from './context/context/webgl-checks';\n\n// Unified parameter API\n\nexport {setDeviceParameters, withDeviceParameters} from './adapter/converters/device-parameters';\n\nexport type {GLParameters} from '@luma.gl/constants';\nexport {\n getParameters,\n setParameters,\n resetParameters\n} from './context/parameters/unified-parameter-api';\n\nexport {\n withParameters\n} from './context/state-tracker/with-parameters';\n\n// State tracking\nexport {\n trackContextState,\n pushContextState,\n popContextState\n} from './context/state-tracker/track-context-state';\n\n// Polyfills (supports a subset of WebGL2 APIs on WebGL1 contexts)\nexport {polyfillContext} from './context/polyfill/polyfill-context';\n\n// HELPERS - EXPERIMENTAL\nexport {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';\nexport {convertGLToTextureFormat, _checkFloat32ColorAttachment} from './adapter/converters/texture-formats';\n\n// TEST EXPORTS\nexport {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';\n\n// DEPRECATED EXPORTS\nexport {clear} from './classic/clear';\nexport {readPixelsToBuffer, readPixelsToArray} from './classic/copy-and-blit';\n"],"mappings":"SASQA,kBAAkB;AAAA,SAGlBC,WAAW;AAAA,SACXC,kBAAkB;AAAA,SAGlBC,aAAa,EAAEA,aAAa,IAAIC,aAAa;AAAA,SAC7CC,WAAW;AAAA,SACXC,YAAY;AAAA,SAEZC,WAAW;AAAA,SACXC,YAAY;AAAA,SACZC,gBAAgB;AAAA,SAEhBC,mBAAmB;AAAA,SAEnBC,mBAAmB;AAAA,SACnBC,eAAe;AAAA,SAKfC,iBAAiB;AAAA,SACjBC,sBAAsB;AAAA,SAGtBC,QAAQ;AAAA,SAGRC,aAAa,EAAEA,aAAa,IAAIC,MAAM;AAAA,SAG5CC,OAAO,EACPC,QAAQ,EACRC,gBAAgB,EAChBC,kBAAkB,EAClBC,mBAAmB;AAAA,SAKbC,mBAAmB,EAAEC,oBAAoB;AAAA,SAI/CC,aAAa,EACbC,aAAa,EACbC,eAAe;AAAA,SAIfC,cAAc;AAAA,SAKdC,iBAAiB,EACjBC,gBAAgB,EAChBC,eAAe;AAAA,SAITC,eAAe;AAAA,SAGfC,eAAe,EAAEC,kBAAkB;AAAA,SACnCC,wBAAwB,EAAEC,4BAA4B;AAAA,SAGtDC,eAAe,IAAIC,gBAAgB;AAAA,SAGnCC,KAAK;AAAA,SACLC,kBAAkB,EAAEC,iBAAiB"}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type AccessorObject = {
1
+ export type AccessorObject = {
2
2
  size?: number;
3
3
  index?: number;
4
4
  type?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}