@luma.gl/webgl 9.0.0-beta.1 → 9.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -44,9 +44,7 @@ __export(src_exports, {
44
44
  _checkFloat32ColorAttachment: () => _checkFloat32ColorAttachment,
45
45
  assertWebGL2Context: () => assertWebGL2Context,
46
46
  assertWebGLContext: () => assertWebGLContext,
47
- clear: () => clear,
48
47
  convertGLToTextureFormat: () => convertGLToTextureFormat,
49
- copyToTexture: () => copyToTexture,
50
48
  getGLParameters: () => getGLParameters,
51
49
  getShaderLayout: () => getShaderLayout,
52
50
  getWebGL2Context: () => getWebGL2Context,
@@ -55,8 +53,6 @@ __export(src_exports, {
55
53
  polyfillContext: () => polyfillContext,
56
54
  popContextState: () => popContextState,
57
55
  pushContextState: () => pushContextState,
58
- readPixelsToArray: () => readPixelsToArray,
59
- readPixelsToBuffer: () => readPixelsToBuffer,
60
56
  registerHeadlessGL: () => registerHeadlessGL,
61
57
  resetGLParameters: () => resetGLParameters,
62
58
  setDeviceParameters: () => setDeviceParameters,
@@ -100,7 +96,7 @@ function createHeadlessContext(options) {
100
96
  }
101
97
 
102
98
  // src/adapter/webgl-device.ts
103
- var import_core28 = require("@luma.gl/core");
99
+ var import_core29 = require("@luma.gl/core");
104
100
  var import_env3 = require("@probe.gl/env");
105
101
 
106
102
  // src/context/polyfill/polyfill-context.ts
@@ -6009,98 +6005,6 @@ function readPixelsToBuffer(source, options) {
6009
6005
  }
6010
6006
  return webglBufferTarget;
6011
6007
  }
6012
- function copyToTexture(source, target, options) {
6013
- const {
6014
- sourceX = 0,
6015
- sourceY = 0,
6016
- // attachment = GL.COLOR_ATTACHMENT0, // TODO - support gl.readBuffer
6017
- targetMipmaplevel = 0,
6018
- targetInternalFormat = import_constants29.GL.RGBA
6019
- } = options || {};
6020
- let {
6021
- targetX,
6022
- targetY,
6023
- targetZ,
6024
- width,
6025
- // defaults to target width
6026
- height
6027
- // defaults to target height
6028
- } = options || {};
6029
- const { framebuffer, deleteFramebuffer } = getFramebuffer2(source);
6030
- (0, import_core27.assert)(framebuffer);
6031
- const webglFramebuffer = framebuffer;
6032
- const { device, handle } = webglFramebuffer;
6033
- const isSubCopy = typeof targetX !== "undefined" || typeof targetY !== "undefined" || typeof targetZ !== "undefined";
6034
- targetX = targetX || 0;
6035
- targetY = targetY || 0;
6036
- targetZ = targetZ || 0;
6037
- const prevHandle = device.gl.bindFramebuffer(import_constants29.GL.FRAMEBUFFER, handle);
6038
- (0, import_core27.assert)(target);
6039
- let texture = null;
6040
- let textureTarget;
6041
- if (target instanceof import_core27.Texture) {
6042
- texture = target;
6043
- width = Number.isFinite(width) ? width : texture.width;
6044
- height = Number.isFinite(height) ? height : texture.height;
6045
- texture.bind(0);
6046
- textureTarget = texture.target;
6047
- } else {
6048
- textureTarget = target;
6049
- }
6050
- if (!isSubCopy) {
6051
- device.gl.copyTexImage2D(
6052
- textureTarget,
6053
- targetMipmaplevel,
6054
- targetInternalFormat,
6055
- sourceX,
6056
- sourceY,
6057
- width,
6058
- height,
6059
- 0
6060
- /* border must be 0 */
6061
- );
6062
- } else {
6063
- switch (textureTarget) {
6064
- case import_constants29.GL.TEXTURE_2D:
6065
- case import_constants29.GL.TEXTURE_CUBE_MAP:
6066
- device.gl.copyTexSubImage2D(
6067
- textureTarget,
6068
- targetMipmaplevel,
6069
- targetX,
6070
- targetY,
6071
- sourceX,
6072
- sourceY,
6073
- width,
6074
- height
6075
- );
6076
- break;
6077
- case import_constants29.GL.TEXTURE_2D_ARRAY:
6078
- case import_constants29.GL.TEXTURE_3D:
6079
- device.assertWebGL2();
6080
- device.gl2.copyTexSubImage3D(
6081
- textureTarget,
6082
- targetMipmaplevel,
6083
- targetX,
6084
- targetY,
6085
- targetZ,
6086
- sourceX,
6087
- sourceY,
6088
- width,
6089
- height
6090
- );
6091
- break;
6092
- default:
6093
- }
6094
- }
6095
- if (texture) {
6096
- texture.unbind();
6097
- }
6098
- device.gl.bindFramebuffer(import_constants29.GL.FRAMEBUFFER, prevHandle || null);
6099
- if (deleteFramebuffer) {
6100
- framebuffer.destroy();
6101
- }
6102
- return texture;
6103
- }
6104
6008
  function getFramebuffer2(source) {
6105
6009
  if (!(source instanceof import_core27.Framebuffer)) {
6106
6010
  return { framebuffer: toFramebuffer(source), deleteFramebuffer: true };
@@ -6128,9 +6032,47 @@ function getPixelArray(pixelArray, type, format, width, height) {
6128
6032
  return new ArrayType(width * height * components);
6129
6033
  }
6130
6034
 
6035
+ // src/classic/clear.ts
6036
+ var import_core28 = require("@luma.gl/core");
6037
+ var GL_DEPTH_BUFFER_BIT2 = 256;
6038
+ var GL_STENCIL_BUFFER_BIT2 = 1024;
6039
+ var GL_COLOR_BUFFER_BIT2 = 16384;
6040
+ var ERR_ARGUMENTS = "clear: bad arguments";
6041
+ function clear(gl, options) {
6042
+ const device = WebGLDevice.attach(gl);
6043
+ const { framebuffer = null, color = null, depth = null, stencil = null } = options || {};
6044
+ const parameters = {};
6045
+ if (framebuffer) {
6046
+ parameters.framebuffer = framebuffer;
6047
+ }
6048
+ let clearFlags = 0;
6049
+ if (color) {
6050
+ clearFlags |= GL_COLOR_BUFFER_BIT2;
6051
+ if (color !== true) {
6052
+ parameters.clearColor = color;
6053
+ }
6054
+ }
6055
+ if (depth) {
6056
+ clearFlags |= GL_DEPTH_BUFFER_BIT2;
6057
+ if (depth !== true) {
6058
+ parameters.clearDepth = depth;
6059
+ }
6060
+ }
6061
+ if (stencil) {
6062
+ clearFlags |= GL_STENCIL_BUFFER_BIT2;
6063
+ if (depth !== true) {
6064
+ parameters.clearStencil = depth;
6065
+ }
6066
+ }
6067
+ (0, import_core28.assert)(clearFlags !== 0, ERR_ARGUMENTS);
6068
+ withGLParameters(device.gl, parameters, () => {
6069
+ device.gl.clear(clearFlags);
6070
+ });
6071
+ }
6072
+
6131
6073
  // src/adapter/webgl-device.ts
6132
6074
  var LOG_LEVEL2 = 1;
6133
- var _WebGLDevice = class extends import_core28.Device {
6075
+ var _WebGLDevice = class extends import_core29.Device {
6134
6076
  static isSupported() {
6135
6077
  return typeof WebGLRenderingContext !== "undefined" || isHeadlessGLRegistered();
6136
6078
  }
@@ -6162,7 +6104,7 @@ var _WebGLDevice = class extends import_core28.Device {
6162
6104
  if (gl instanceof _WebGLDevice) {
6163
6105
  return gl;
6164
6106
  }
6165
- if ((gl == null ? void 0 : gl.device) instanceof import_core28.Device) {
6107
+ if ((gl == null ? void 0 : gl.device) instanceof import_core29.Device) {
6166
6108
  return gl.device;
6167
6109
  }
6168
6110
  if (!isWebGL3(gl)) {
@@ -6171,26 +6113,26 @@ var _WebGLDevice = class extends import_core28.Device {
6171
6113
  return new _WebGLDevice({ gl });
6172
6114
  }
6173
6115
  static async create(props = {}) {
6174
- import_core28.log.groupCollapsed(LOG_LEVEL2, "WebGLDevice created")();
6116
+ import_core29.log.groupCollapsed(LOG_LEVEL2, "WebGLDevice created")();
6175
6117
  if (typeof props.canvas === "string") {
6176
- await import_core28.CanvasContext.pageLoaded;
6118
+ await import_core29.CanvasContext.pageLoaded;
6177
6119
  }
6178
- if (import_core28.log.get("debug") || props.debug) {
6120
+ if (import_core29.log.get("debug") || props.debug) {
6179
6121
  await loadWebGLDeveloperTools();
6180
6122
  }
6181
6123
  const { spector: spector2 } = props;
6182
- if (import_core28.log.get("spector") || spector2) {
6124
+ if (import_core29.log.get("spector") || spector2) {
6183
6125
  await loadSpectorJS();
6184
6126
  }
6185
- import_core28.log.probe(LOG_LEVEL2 + 1, "DOM is loaded")();
6127
+ import_core29.log.probe(LOG_LEVEL2 + 1, "DOM is loaded")();
6186
6128
  if (props.gl && props.gl.device) {
6187
6129
  return _WebGLDevice.attach(props.gl);
6188
6130
  }
6189
6131
  const device = new _WebGLDevice(props);
6190
6132
  const message2 = `Created ${device.info.type}${device.debug ? " debug" : ""} context: ${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContext.id}`;
6191
- import_core28.log.probe(LOG_LEVEL2, message2)();
6192
- import_core28.log.table(LOG_LEVEL2, device.info)();
6193
- import_core28.log.groupEnd(LOG_LEVEL2)();
6133
+ import_core29.log.probe(LOG_LEVEL2, message2)();
6134
+ import_core29.log.table(LOG_LEVEL2, device.info)();
6135
+ import_core29.log.groupEnd(LOG_LEVEL2)();
6194
6136
  return device;
6195
6137
  }
6196
6138
  //
@@ -6198,7 +6140,7 @@ var _WebGLDevice = class extends import_core28.Device {
6198
6140
  //
6199
6141
  constructor(props) {
6200
6142
  var _a, _b;
6201
- super({ ...props, id: props.id || (0, import_core28.uid)("webgl-device") });
6143
+ super({ ...props, id: props.id || (0, import_core29.uid)("webgl-device") });
6202
6144
  const device = (_a = props.gl) == null ? void 0 : _a.device;
6203
6145
  if (device) {
6204
6146
  throw new Error(`WebGL context already attached to device ${device.id}`);
@@ -6235,14 +6177,14 @@ var _WebGLDevice = class extends import_core28.Device {
6235
6177
  trackContextState(this.gl, {
6236
6178
  enable: enable2,
6237
6179
  copyState,
6238
- log: (...args) => import_core28.log.log(1, ...args)()
6180
+ log: (...args) => import_core29.log.log(1, ...args)()
6239
6181
  });
6240
6182
  if ((0, import_env3.isBrowser)() && props.debug) {
6241
6183
  this.gl = makeDebugContext(this.gl, { ...props, webgl2: this.isWebGL2, throwOnError: true });
6242
6184
  this.gl2 = this.gl;
6243
6185
  this.debug = true;
6244
- import_core28.log.level = Math.max(import_core28.log.level, 1);
6245
- import_core28.log.warn("WebGL debug mode activated. Performance reduced.")();
6186
+ import_core29.log.level = Math.max(import_core29.log.level, 1);
6187
+ import_core29.log.warn("WebGL debug mode activated. Performance reduced.")();
6246
6188
  }
6247
6189
  if ((0, import_env3.isBrowser)() && props.spector) {
6248
6190
  const canvas2 = this.handle.canvas || props.canvas;
@@ -6354,6 +6296,15 @@ var _WebGLDevice = class extends import_core28.Device {
6354
6296
  readPixelsToBufferWebGL2(source, options) {
6355
6297
  return readPixelsToBuffer(source, options);
6356
6298
  }
6299
+ setParametersWebGL(parameters) {
6300
+ setGLParameters(this, parameters);
6301
+ }
6302
+ withParametersWebGL(parameters, func) {
6303
+ withGLParameters(this, parameters, func);
6304
+ }
6305
+ clearWebGL(options) {
6306
+ clear(this, options);
6307
+ }
6357
6308
  //
6358
6309
  // WebGL-only API (not part of `Device` API)
6359
6310
  //
@@ -6439,7 +6390,7 @@ var _WebGLDevice = class extends import_core28.Device {
6439
6390
  this._constants = this._constants || new Array(this.limits.maxVertexAttributes).fill(null);
6440
6391
  const currentConstant = this._constants[location];
6441
6392
  if (currentConstant && compareConstantArrayValues2(currentConstant, constant)) {
6442
- import_core28.log.info(1, `setConstantAttribute(${location}) could have been skipped, value unchanged`)();
6393
+ import_core29.log.info(1, `setConstantAttribute(${location}) could have been skipped, value unchanged`)();
6443
6394
  }
6444
6395
  this._constants[location] = constant;
6445
6396
  switch (constant.constructor) {
@@ -6453,7 +6404,7 @@ var _WebGLDevice = class extends import_core28.Device {
6453
6404
  setConstantUintArray(this, location, constant);
6454
6405
  break;
6455
6406
  default:
6456
- (0, import_core28.assert)(false);
6407
+ (0, import_core29.assert)(false);
6457
6408
  }
6458
6409
  }
6459
6410
  };
@@ -6492,7 +6443,7 @@ function setConstantFloatArray(device, location, array) {
6492
6443
  device.gl.vertexAttrib4fv(location, array);
6493
6444
  break;
6494
6445
  default:
6495
- (0, import_core28.assert)(false);
6446
+ (0, import_core29.assert)(false);
6496
6447
  }
6497
6448
  }
6498
6449
  function setConstantIntArray(device, location, array) {
@@ -6516,41 +6467,3 @@ function compareConstantArrayValues2(v1, v2) {
6516
6467
  }
6517
6468
  return true;
6518
6469
  }
6519
-
6520
- // src/classic/clear.ts
6521
- var import_core29 = require("@luma.gl/core");
6522
- var GL_DEPTH_BUFFER_BIT2 = 256;
6523
- var GL_STENCIL_BUFFER_BIT2 = 1024;
6524
- var GL_COLOR_BUFFER_BIT2 = 16384;
6525
- var ERR_ARGUMENTS = "clear: bad arguments";
6526
- function clear(gl, options) {
6527
- const device = WebGLDevice.attach(gl);
6528
- const { framebuffer = null, color = null, depth = null, stencil = null } = options || {};
6529
- const parameters = {};
6530
- if (framebuffer) {
6531
- parameters.framebuffer = framebuffer;
6532
- }
6533
- let clearFlags = 0;
6534
- if (color) {
6535
- clearFlags |= GL_COLOR_BUFFER_BIT2;
6536
- if (color !== true) {
6537
- parameters.clearColor = color;
6538
- }
6539
- }
6540
- if (depth) {
6541
- clearFlags |= GL_DEPTH_BUFFER_BIT2;
6542
- if (depth !== true) {
6543
- parameters.clearDepth = depth;
6544
- }
6545
- }
6546
- if (stencil) {
6547
- clearFlags |= GL_STENCIL_BUFFER_BIT2;
6548
- if (depth !== true) {
6549
- parameters.clearStencil = depth;
6550
- }
6551
- }
6552
- (0, import_core29.assert)(clearFlags !== 0, ERR_ARGUMENTS);
6553
- withGLParameters(device.gl, parameters, () => {
6554
- device.gl.clear(clearFlags);
6555
- });
6556
- }
package/dist/index.d.ts CHANGED
@@ -19,14 +19,11 @@ export { Accessor } from './classic/accessor';
19
19
  export type { AccessorObject } from './types';
20
20
  export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from './context/context/webgl-checks';
21
21
  export { setDeviceParameters, withDeviceParameters } from './adapter/converters/device-parameters';
22
- export type { GLParameters } from '@luma.gl/constants';
23
- export { getGLParameters, setGLParameters, resetGLParameters } from './context/parameters/unified-parameter-api';
24
- export { withGLParameters } from './context/state-tracker/with-parameters';
25
22
  export { getShaderLayout } from './adapter/helpers/get-shader-layout';
26
23
  export { convertGLToTextureFormat, _checkFloat32ColorAttachment } from './adapter/converters/texture-formats';
27
24
  export { TEXTURE_FORMATS as _TEXTURE_FORMATS } from './adapter/converters/texture-formats';
28
- export { clear } from './classic/clear';
29
- export { readPixelsToBuffer, readPixelsToArray, copyToTexture } from './classic/copy-and-blit';
30
25
  export { trackContextState, pushContextState, popContextState } from './context/state-tracker/track-context-state';
31
26
  export { polyfillContext } from './context/polyfill/polyfill-context';
27
+ export { resetGLParameters, setGLParameters, getGLParameters } from './context/parameters/unified-parameter-api';
28
+ export { withGLParameters } from './context/state-tracker/with-parameters';
32
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,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;AAEtE,OAAO,EAAC,gBAAgB,EAAC,MAAM,wCAAwC,CAAC;AAGxE,YAAY,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AAGvE,OAAO,EAAC,sBAAsB,EAAC,MAAM,8CAA8C,CAAC;AAGpF,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAE5C,OAAO,EACL,OAAO,EAC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AM,yCAAyC,CAAC"}
package/dist/index.js CHANGED
@@ -16,13 +16,11 @@ export { WEBGLTransformFeedback } from "./adapter/resources/webgl-transform-feed
16
16
  export { Accessor } from "./classic/accessor.js";
17
17
  export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from "./context/context/webgl-checks.js";
18
18
  export { setDeviceParameters, withDeviceParameters } from "./adapter/converters/device-parameters.js";
19
- export { getGLParameters, setGLParameters, resetGLParameters } from "./context/parameters/unified-parameter-api.js";
20
- export { withGLParameters } from "./context/state-tracker/with-parameters.js";
21
19
  export { getShaderLayout } from "./adapter/helpers/get-shader-layout.js";
22
20
  export { convertGLToTextureFormat, _checkFloat32ColorAttachment } from "./adapter/converters/texture-formats.js";
23
21
  export { TEXTURE_FORMATS as _TEXTURE_FORMATS } from "./adapter/converters/texture-formats.js";
24
- export { clear } from "./classic/clear.js";
25
- export { readPixelsToBuffer, readPixelsToArray, copyToTexture } from "./classic/copy-and-blit.js";
26
22
  export { trackContextState, pushContextState, popContextState } from "./context/state-tracker/track-context-state.js";
27
23
  export { polyfillContext } from "./context/polyfill/polyfill-context.js";
24
+ export { resetGLParameters, setGLParameters, getGLParameters } from "./context/parameters/unified-parameter-api.js";
25
+ export { withGLParameters } from "./context/state-tracker/with-parameters.js";
28
26
  //# 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","WEBGLVertexArray","WEBGLRenderbuffer","WEBGLTransformFeedback","Accessor","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","setDeviceParameters","withDeviceParameters","getGLParameters","setGLParameters","resetGLParameters","withGLParameters","getShaderLayout","convertGLToTextureFormat","_checkFloat32ColorAttachment","TEXTURE_FORMATS","_TEXTURE_FORMATS","clear","readPixelsToBuffer","readPixelsToArray","copyToTexture","trackContextState","pushContextState","popContextState","polyfillContext"],"sources":["../src/index.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n// 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';\nexport {WEBGLVertexArray} from './adapter/resources/webgl-vertex-array';\n\n// Internal WebGL classes\nexport type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';\nexport {WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';\n\n// WebGL adapter classes \nexport {WEBGLTransformFeedback} from './adapter/resources/webgl-transform-feedback';\n\n// WebGL adapter classes\nexport {Accessor} from './classic/accessor';\nexport type {AccessorObject} from './types';\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 getGLParameters,\n setGLParameters,\n resetGLParameters\n} from './context/parameters/unified-parameter-api';\n\nexport {withGLParameters} from './context/state-tracker/with-parameters';\n\n// HELPERS - EXPERIMENTAL\nexport {getShaderLayout} from './adapter/helpers/get-shader-layout';\nexport {\n convertGLToTextureFormat,\n _checkFloat32ColorAttachment\n} 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, copyToTexture} from './classic/copy-and-blit';\n// State tracking\nexport {\n trackContextState,\n pushContextState,\n popContextState\n} from './context/state-tracker/track-context-state';\n// Polyfills (supports a subset of WebGL2 APIs on WebGL1 contexts)\nexport {polyfillContext} from './context/polyfill/polyfill-context';\n\n// HELPERS - EXPERIMENTAL\n// export {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';\n// export {convertGLToTextureFormat, _checkFloat32ColorAttachment} from './adapter/converters/texture-formats';\n// export {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';\n\n// // WebGL Types - Experimental exports\n// export type {\n// GLDrawMode,\n// GLPrimitive,\n// GLDataType,\n// GLPixelType,\n// GLUniformType,\n// GLSamplerType,\n// GLCompositeType,\n// GLFunction,\n// GLBlendEquation,\n// GLBlendFunction,\n// GLStencilOp,\n// GLSamplerParameters,\n// GLValueParameters,\n// GLFunctionParameters\n// } from '@luma.gl/constants';\n"],"mappings":"SAYQA,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,SAEfC,gBAAgB;AAAA,SAIhBC,iBAAiB;AAAA,SAGjBC,sBAAsB;AAAA,SAGtBC,QAAQ;AAAA,SAIdC,OAAO,EACPC,QAAQ,EACRC,gBAAgB,EAChBC,kBAAkB,EAClBC,mBAAmB;AAAA,SAKbC,mBAAmB,EAAEC,oBAAoB;AAAA,SAI/CC,eAAe,EACfC,eAAe,EACfC,iBAAiB;AAAA,SAGXC,gBAAgB;AAAA,SAGhBC,eAAe;AAAA,SAErBC,wBAAwB,EACxBC,4BAA4B;AAAA,SAItBC,eAAe,IAAIC,gBAAgB;AAAA,SAGnCC,KAAK;AAAA,SACLC,kBAAkB,EAAEC,iBAAiB,EAAEC,aAAa;AAAA,SAG1DC,iBAAiB,EACjBC,gBAAgB,EAChBC,eAAe;AAAA,SAGTC,eAAe"}
1
+ {"version":3,"file":"index.js","names":["registerHeadlessGL","WebGLDevice","WebGLCanvasContext","WebGLResource","WEBGLResource","WEBGLBuffer","WEBGLTexture","WEBGLShader","WEBGLSampler","WEBGLFramebuffer","WEBGLRenderPipeline","WEBGLCommandEncoder","WEBGLRenderPass","WEBGLVertexArray","WEBGLRenderbuffer","WEBGLTransformFeedback","Accessor","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","setDeviceParameters","withDeviceParameters","getShaderLayout","convertGLToTextureFormat","_checkFloat32ColorAttachment","TEXTURE_FORMATS","_TEXTURE_FORMATS","trackContextState","pushContextState","popContextState","polyfillContext","resetGLParameters","setGLParameters","getGLParameters","withGLParameters"],"sources":["../src/index.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n// 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';\nexport {WEBGLVertexArray} from './adapter/resources/webgl-vertex-array';\n\n// Internal WebGL classes\nexport type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';\nexport {WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';\n\n// WebGL adapter classes\nexport {WEBGLTransformFeedback} from './adapter/resources/webgl-transform-feedback';\n\n// WebGL adapter classes\nexport {Accessor} from './classic/accessor';\nexport type {AccessorObject} from './types';\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\n// HELPERS - EXPERIMENTAL\nexport {getShaderLayout} from './adapter/helpers/get-shader-layout';\nexport {\n convertGLToTextureFormat,\n _checkFloat32ColorAttachment\n} from './adapter/converters/texture-formats';\n\n// TEST EXPORTS\nexport {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';\n\n// DEPRECATED TEST EXPORTS\n// State tracking\nexport {\n trackContextState,\n pushContextState,\n popContextState\n} from './context/state-tracker/track-context-state';\n// Polyfills (supports a subset of WebGL2 APIs on WebGL1 contexts)\nexport {polyfillContext} from './context/polyfill/polyfill-context';\n\nexport {\n resetGLParameters,\n setGLParameters,\n getGLParameters\n} from './context/parameters/unified-parameter-api';\n\nexport {withGLParameters} from './context/state-tracker/with-parameters';\n"],"mappings":"SAYQA,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,SAEfC,gBAAgB;AAAA,SAIhBC,iBAAiB;AAAA,SAGjBC,sBAAsB;AAAA,SAGtBC,QAAQ;AAAA,SAIdC,OAAO,EACPC,QAAQ,EACRC,gBAAgB,EAChBC,kBAAkB,EAClBC,mBAAmB;AAAA,SAKbC,mBAAmB,EAAEC,oBAAoB;AAAA,SAGzCC,eAAe;AAAA,SAErBC,wBAAwB,EACxBC,4BAA4B;AAAA,SAItBC,eAAe,IAAIC,gBAAgB;AAAA,SAKzCC,iBAAiB,EACjBC,gBAAgB,EAChBC,eAAe;AAAA,SAGTC,eAAe;AAAA,SAGrBC,iBAAiB,EACjBC,eAAe,EACfC,eAAe;AAAA,SAGTC,gBAAgB"}