@luma.gl/webgl 9.0.0-alpha.20 → 9.0.0-alpha.21

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 (111) hide show
  1. package/dist/adapter/converters/device-parameters.js +1 -1
  2. package/dist/adapter/converters/device-parameters.js.map +1 -1
  3. package/dist/adapter/converters/renderbuffer-formats.d.ts +2 -2
  4. package/dist/adapter/converters/renderbuffer-formats.d.ts.map +1 -1
  5. package/dist/adapter/converters/renderbuffer-formats.js +1 -2
  6. package/dist/adapter/converters/renderbuffer-formats.js.map +1 -1
  7. package/dist/adapter/helpers/get-shader-layout.js +1 -1
  8. package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
  9. package/dist/adapter/objects/webgl-renderbuffer.d.ts +3 -3
  10. package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
  11. package/dist/adapter/objects/webgl-renderbuffer.js +2 -2
  12. package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
  13. package/dist/adapter/objects/webgl-resource.d.ts +2 -2
  14. package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
  15. package/dist/adapter/objects/webgl-resource.js +2 -2
  16. package/dist/adapter/objects/webgl-resource.js.map +1 -1
  17. package/dist/adapter/objects/webgl-vertex-array-object.d.ts +6 -6
  18. package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
  19. package/dist/adapter/objects/webgl-vertex-array-object.js +2 -2
  20. package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -1
  21. package/dist/adapter/resources/webgl-buffer.d.ts +2 -2
  22. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
  23. package/dist/adapter/resources/webgl-buffer.js +1 -1
  24. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  25. package/dist/adapter/resources/webgl-command-buffer.d.ts +2 -2
  26. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
  27. package/dist/adapter/resources/webgl-command-buffer.js +1 -1
  28. package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
  29. package/dist/adapter/resources/webgl-command-encoder.d.ts +3 -3
  30. package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
  31. package/dist/adapter/resources/webgl-command-encoder.js +2 -2
  32. package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
  33. package/dist/adapter/resources/webgl-external-texture.js.map +1 -1
  34. package/dist/adapter/resources/webgl-framebuffer.d.ts +16 -16
  35. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
  36. package/dist/adapter/resources/webgl-framebuffer.js +10 -10
  37. package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
  38. package/dist/adapter/resources/webgl-render-pass.d.ts +2 -2
  39. package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
  40. package/dist/adapter/resources/webgl-render-pass.js +1 -1
  41. package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
  42. package/dist/adapter/resources/webgl-render-pipeline.d.ts +4 -4
  43. package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
  44. package/dist/adapter/resources/webgl-render-pipeline.js +4 -4
  45. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  46. package/dist/adapter/resources/webgl-sampler.d.ts +2 -2
  47. package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
  48. package/dist/adapter/resources/webgl-sampler.js +1 -1
  49. package/dist/adapter/resources/webgl-sampler.js.map +1 -1
  50. package/dist/adapter/resources/webgl-shader.d.ts +2 -2
  51. package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
  52. package/dist/adapter/resources/webgl-shader.js +1 -1
  53. package/dist/adapter/resources/webgl-shader.js.map +1 -1
  54. package/dist/adapter/resources/webgl-texture.d.ts +3 -3
  55. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  56. package/dist/adapter/resources/webgl-texture.js +3 -3
  57. package/dist/adapter/resources/webgl-texture.js.map +1 -1
  58. package/dist/adapter/webgl-canvas-context.d.ts +3 -3
  59. package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
  60. package/dist/adapter/webgl-canvas-context.js +2 -2
  61. package/dist/adapter/webgl-canvas-context.js.map +1 -1
  62. package/dist/adapter/webgl-device.d.ts +9 -9
  63. package/dist/adapter/webgl-device.d.ts.map +1 -1
  64. package/dist/adapter/webgl-device.js +9 -9
  65. package/dist/adapter/webgl-device.js.map +1 -1
  66. package/dist/classic/accessor.d.ts +1 -1
  67. package/dist/classic/accessor.d.ts.map +1 -1
  68. package/dist/classic/accessor.js +1 -1
  69. package/dist/classic/accessor.js.map +1 -1
  70. package/dist/classic/buffer.d.ts +3 -3
  71. package/dist/classic/buffer.d.ts.map +1 -1
  72. package/dist/classic/buffer.js +4 -4
  73. package/dist/classic/buffer.js.map +1 -1
  74. package/dist/context/parameters/unified-parameter-api.js +1 -1
  75. package/dist/context/parameters/unified-parameter-api.js.map +1 -1
  76. package/dist/context/state-tracker/with-parameters.js +1 -1
  77. package/dist/context/state-tracker/with-parameters.js.map +1 -1
  78. package/dist/dist.dev.js +5 -6
  79. package/dist/index.cjs +3 -3
  80. package/dist/index.d.ts +15 -15
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +15 -15
  83. package/dist/index.js.map +1 -1
  84. package/dist.min.js +21 -21
  85. package/package.json +4 -4
  86. package/src/.DS_Store +0 -0
  87. package/src/adapter/.DS_Store +0 -0
  88. package/src/adapter/converters/device-parameters.ts +1 -1
  89. package/src/adapter/converters/renderbuffer-formats.ts +1 -3
  90. package/src/adapter/helpers/get-shader-layout.ts +1 -1
  91. package/src/adapter/objects/webgl-renderbuffer.ts +3 -3
  92. package/src/adapter/objects/webgl-resource.ts +2 -2
  93. package/src/adapter/objects/webgl-vertex-array-object.ts +6 -6
  94. package/src/adapter/resources/webgl-buffer.ts +2 -2
  95. package/src/adapter/resources/webgl-command-buffer.ts +3 -3
  96. package/src/adapter/resources/webgl-command-encoder.ts +3 -3
  97. package/src/adapter/resources/webgl-external-texture.ts +1 -1
  98. package/src/adapter/resources/webgl-framebuffer.ts +24 -24
  99. package/src/adapter/resources/webgl-render-pass.ts +2 -2
  100. package/src/adapter/resources/webgl-render-pipeline.ts +6 -6
  101. package/src/adapter/resources/webgl-sampler.ts +2 -2
  102. package/src/adapter/resources/webgl-shader.ts +2 -2
  103. package/src/adapter/resources/webgl-texture.ts +4 -4
  104. package/src/adapter/webgl-canvas-context.ts +3 -3
  105. package/src/adapter/webgl-device.ts +10 -10
  106. package/src/classic/accessor.ts +1 -1
  107. package/src/classic/buffer.ts +4 -4
  108. package/src/context/.DS_Store +0 -0
  109. package/src/context/parameters/unified-parameter-api.ts +1 -1
  110. package/src/context/state-tracker/with-parameters.ts +1 -1
  111. package/src/index.ts +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"accessor.js","names":["assert","checkProps","GL","getTypedArrayFromGLType","DEFAULT_ACCESSOR_VALUES","offset","stride","type","FLOAT","size","divisor","normalized","integer","PROP_CHECKS","deprecatedProps","instanced","isInstanced","Accessor","getBytesPerElement","accessor","ArrayType","BYTES_PER_ELEMENT","getBytesPerVertex","resolve","_len","arguments","length","accessors","Array","_key","constructor","_defineProperty","_len2","_key2","forEach","_assign","Object","freeze","toString","JSON","stringify","BYTES_PER_VERTEX","props","undefined","INT","UNSIGNED_INT","normalize","buffer","index"],"sources":["../../src/classic/accessor.ts"],"sourcesContent":["import {assert, checkProps, Buffer, AccessorObject} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {getTypedArrayFromGLType} from './typed-array-utils';\n\nconst DEFAULT_ACCESSOR_VALUES = {\n offset: 0,\n stride: 0,\n type: GL.FLOAT,\n size: 1,\n divisor: 0,\n normalized: false,\n integer: false\n};\n\nconst PROP_CHECKS = {\n deprecatedProps: {\n instanced: 'divisor',\n isInstanced: 'divisor'\n }\n};\n\nexport default class Accessor implements AccessorObject {\n offset?: number;\n stride?: number;\n type?: number;\n size?: number;\n divisor?: number;\n normalized?: boolean;\n integer?: boolean;\n\n buffer?: Buffer;\n index?: number;\n\n static getBytesPerElement(accessor: Accessor | AccessorObject): number {\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || GL.FLOAT);\n return ArrayType.BYTES_PER_ELEMENT;\n }\n\n static getBytesPerVertex(accessor: AccessorObject): number {\n assert(accessor.size);\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || GL.FLOAT);\n return ArrayType.BYTES_PER_ELEMENT * accessor.size;\n }\n\n // Combines (merges) a list of accessors. On top of default values\n // Usually [programAccessor, bufferAccessor, appAccessor]\n // All props will be set in the returned object.\n // TODO check for conflicts between values in the supplied accessors\n static resolve(...accessors: AccessorObject[]): Accessor {\n return new Accessor(...[DEFAULT_ACCESSOR_VALUES, ...accessors]); // Default values\n }\n\n constructor(...accessors: AccessorObject[]) {\n accessors.forEach((accessor) => this._assign(accessor)); // Merge in sequence\n Object.freeze(this);\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n\n // ACCESSORS\n\n // TODO - remove>\n get BYTES_PER_ELEMENT(): number {\n return Accessor.getBytesPerElement(this);\n }\n\n get BYTES_PER_VERTEX(): number {\n return Accessor.getBytesPerVertex(this);\n }\n\n // PRIVATE\n\n // eslint-disable-next-line complexity, max-statements\n _assign(props: AccessorObject = {}): this {\n props = checkProps('Accessor', props, PROP_CHECKS);\n\n if (props.type !== undefined) {\n this.type = props.type;\n\n // Auto-deduce integer type?\n if (props.type === GL.INT || props.type === GL.UNSIGNED_INT) {\n this.integer = true;\n }\n }\n if (props.size !== undefined) {\n this.size = props.size;\n }\n if (props.offset !== undefined) {\n this.offset = props.offset;\n }\n if (props.stride !== undefined) {\n this.stride = props.stride;\n }\n // @ts-expect-error\n if (props.normalize !== undefined) {\n // @ts-expect-error\n this.normalized = props.normalize;\n }\n if (props.normalized !== undefined) {\n this.normalized = props.normalized;\n }\n if (props.integer !== undefined) {\n this.integer = props.integer;\n }\n\n // INSTANCE DIVISOR\n if (props.divisor !== undefined) {\n this.divisor = props.divisor;\n }\n\n // Buffer is optional\n if (props.buffer !== undefined) {\n this.buffer = props.buffer;\n }\n\n // The binding index (for binding e.g. Transform feedbacks and Uniform buffers)\n // TODO - should this be part of accessor?\n if (props.index !== undefined) {\n if (typeof props.index === 'boolean') {\n this.index = props.index ? 1 : 0;\n } else {\n this.index = props.index;\n }\n }\n\n // DEPRECATED\n // @ts-expect-error\n if (props.instanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.instanced ? 1 : 0;\n }\n // @ts-expect-error\n if (props.isInstanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.isInstanced ? 1 : 0;\n }\n\n if (this.offset === undefined) delete this.offset;\n if (this.stride === undefined) delete this.stride;\n if (this.type === undefined) delete this.type;\n if (this.size === undefined) delete this.size;\n if (this.divisor === undefined) delete this.divisor;\n if (this.normalized === undefined) delete this.normalized;\n if (this.integer === undefined) delete this.integer;\n \n if (this.buffer === undefined) delete this.buffer;\n if (this.index === undefined) delete this.index;\n \n return this;\n }\n}\n\n// TEST EXPORTS\nexport {DEFAULT_ACCESSOR_VALUES};\n"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,UAAU,QAA+B,cAAc;AACvE,OAAOC,EAAE,MAAM,oBAAoB;AAAC,SAC5BC,uBAAuB;AAE/B,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE,CAAC;EACTC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAEL,EAAE,CAACM,KAAK;EACdC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,UAAU,EAAE,KAAK;EACjBC,OAAO,EAAE;AACX,CAAC;AAED,MAAMC,WAAW,GAAG;EAClBC,eAAe,EAAE;IACfC,SAAS,EAAE,SAAS;IACpBC,WAAW,EAAE;EACf;AACF,CAAC;AAED,eAAe,MAAMC,QAAQ,CAA2B;EAYtD,OAAOC,k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CAACE,IAAI,KAAKkC,SAAS,EAAE,OAAO,IAAI,CAAClC,IAAI;IAC7C,IAAI,IAAI,CAACC,OAAO,KAAKiC,SAAS,EAAE,OAAO,IAAI,CAACjC,OAAO;IACnD,IAAI,IAAI,CAACC,UAAU,KAAKgC,SAAS,EAAE,OAAO,IAAI,CAAChC,UAAU;IACzD,IAAI,IAAI,CAACC,OAAO,KAAK+B,SAAS,EAAE,OAAO,IAAI,CAAC/B,OAAO;IAEnD,IAAI,IAAI,CAACmC,MAAM,KAAKJ,SAAS,EAAE,OAAO,IAAI,CAACI,MAAM;IACjD,IAAI,IAAI,CAACC,KAAK,KAAKL,SAAS,EAAE,OAAO,IAAI,CAACK,KAAK;IAE/C,OAAO,IAAI;EACb;AACF;AAGA,SAAQ5C,uBAAuB"}
1
+ {"version":3,"file":"accessor.js","names":["assert","checkProps","GL","getTypedArrayFromGLType","DEFAULT_ACCESSOR_VALUES","offset","stride","type","FLOAT","size","divisor","normalized","integer","PROP_CHECKS","deprecatedProps","instanced","isInstanced","Accessor","getBytesPerElement","accessor","ArrayType","BYTES_PER_ELEMENT","getBytesPerVertex","resolve","_len","arguments","length","accessors","Array","_key","constructor","_defineProperty","_len2","_key2","forEach","_assign","Object","freeze","toString","JSON","stringify","BYTES_PER_VERTEX","props","undefined","INT","UNSIGNED_INT","normalize","buffer","index"],"sources":["../../src/classic/accessor.ts"],"sourcesContent":["import {assert, checkProps, Buffer, AccessorObject} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {getTypedArrayFromGLType} from './typed-array-utils';\n\nconst DEFAULT_ACCESSOR_VALUES = {\n offset: 0,\n stride: 0,\n type: GL.FLOAT,\n size: 1,\n divisor: 0,\n normalized: false,\n integer: false\n};\n\nconst PROP_CHECKS = {\n deprecatedProps: {\n instanced: 'divisor',\n isInstanced: 'divisor'\n }\n};\n\nexport class Accessor implements AccessorObject {\n offset?: number;\n stride?: number;\n type?: number;\n size?: number;\n divisor?: number;\n normalized?: boolean;\n integer?: boolean;\n\n buffer?: Buffer;\n index?: number;\n\n static getBytesPerElement(accessor: Accessor | AccessorObject): number {\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || GL.FLOAT);\n return ArrayType.BYTES_PER_ELEMENT;\n }\n\n static getBytesPerVertex(accessor: AccessorObject): number {\n assert(accessor.size);\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || GL.FLOAT);\n return ArrayType.BYTES_PER_ELEMENT * accessor.size;\n }\n\n // Combines (merges) a list of accessors. On top of default values\n // Usually [programAccessor, bufferAccessor, appAccessor]\n // All props will be set in the returned object.\n // TODO check for conflicts between values in the supplied accessors\n static resolve(...accessors: AccessorObject[]): Accessor {\n return new Accessor(...[DEFAULT_ACCESSOR_VALUES, ...accessors]); // Default values\n }\n\n constructor(...accessors: AccessorObject[]) {\n accessors.forEach((accessor) => this._assign(accessor)); // Merge in sequence\n Object.freeze(this);\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n\n // ACCESSORS\n\n // TODO - remove>\n get BYTES_PER_ELEMENT(): number {\n return Accessor.getBytesPerElement(this);\n }\n\n get BYTES_PER_VERTEX(): number {\n return Accessor.getBytesPerVertex(this);\n }\n\n // PRIVATE\n\n // eslint-disable-next-line complexity, max-statements\n _assign(props: AccessorObject = {}): this {\n props = checkProps('Accessor', props, PROP_CHECKS);\n\n if (props.type !== undefined) {\n this.type = props.type;\n\n // Auto-deduce integer type?\n if (props.type === GL.INT || props.type === GL.UNSIGNED_INT) {\n this.integer = true;\n }\n }\n if (props.size !== undefined) {\n this.size = props.size;\n }\n if (props.offset !== undefined) {\n this.offset = props.offset;\n }\n if (props.stride !== undefined) {\n this.stride = props.stride;\n }\n // @ts-expect-error\n if (props.normalize !== undefined) {\n // @ts-expect-error\n this.normalized = props.normalize;\n }\n if (props.normalized !== undefined) {\n this.normalized = props.normalized;\n }\n if (props.integer !== undefined) {\n this.integer = props.integer;\n }\n\n // INSTANCE DIVISOR\n if (props.divisor !== undefined) {\n this.divisor = props.divisor;\n }\n\n // Buffer is optional\n if (props.buffer !== undefined) {\n this.buffer = props.buffer;\n }\n\n // The binding index (for binding e.g. Transform feedbacks and Uniform buffers)\n // TODO - should this be part of accessor?\n if (props.index !== undefined) {\n if (typeof props.index === 'boolean') {\n this.index = props.index ? 1 : 0;\n } else {\n this.index = props.index;\n }\n }\n\n // DEPRECATED\n // @ts-expect-error\n if (props.instanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.instanced ? 1 : 0;\n }\n // @ts-expect-error\n if (props.isInstanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.isInstanced ? 1 : 0;\n }\n\n if (this.offset === undefined) delete this.offset;\n if (this.stride === undefined) delete this.stride;\n if (this.type === undefined) delete this.type;\n if (this.size === undefined) delete this.size;\n if (this.divisor === undefined) delete this.divisor;\n if (this.normalized === undefined) delete this.normalized;\n if (this.integer === undefined) delete this.integer;\n \n if (this.buffer === undefined) delete this.buffer;\n if (this.index === undefined) delete this.index;\n \n return this;\n }\n}\n\n// TEST EXPORTS\nexport {DEFAULT_ACCESSOR_VALUES};\n"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,UAAU,QAA+B,cAAc;AACvE,OAAOC,EAAE,MAAM,oBAAoB;AAAC,SAC5BC,uBAAuB;AAE/B,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE,CAAC;EACTC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAEL,EAAE,CAACM,KAAK;EACdC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,UAAU,EAAE,KAAK;EACjBC,OAAO,EAAE;AACX,CAAC;AAED,MAAMC,WAAW,GAAG;EAClBC,eAAe,EAAE;IACfC,SAAS,EAAE,SAAS;IACpBC,WAAW,EAAE;EACf;AACF,CAAC;AAED,OAAO,MAAMC,QAAQ,CAA2B;EAY9C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AI,IAAI,CAACE,IAAI,KAAKkC,SAAS,EAAE,OAAO,IAAI,CAAClC,IAAI;IAC7C,IAAI,IAAI,CAACC,OAAO,KAAKiC,SAAS,EAAE,OAAO,IAAI,CAACjC,OAAO;IACnD,IAAI,IAAI,CAACC,UAAU,KAAKgC,SAAS,EAAE,OAAO,IAAI,CAAChC,UAAU;IACzD,IAAI,IAAI,CAACC,OAAO,KAAK+B,SAAS,EAAE,OAAO,IAAI,CAAC/B,OAAO;IAEnD,IAAI,IAAI,CAACmC,MAAM,KAAKJ,SAAS,EAAE,OAAO,IAAI,CAACI,MAAM;IACjD,IAAI,IAAI,CAACC,KAAK,KAAKL,SAAS,EAAE,OAAO,IAAI,CAACK,KAAK;IAE/C,OAAO,IAAI;EACb;AACF;AAGA,SAAQ5C,uBAAuB"}
@@ -1,8 +1,8 @@
1
1
  import type { Device, BufferProps, TypedArray } from '@luma.gl/api';
2
2
  import GL from '@luma.gl/constants';
3
3
  import { AccessorObject } from '../types';
4
- import Accessor from './accessor';
5
- import WEBGLBuffer from '../adapter/resources/webgl-buffer';
4
+ import { Accessor } from './accessor';
5
+ import { WEBGLBuffer } from '../adapter/resources/webgl-buffer';
6
6
  /** WebGL Buffer interface */
7
7
  export declare type ClassicBufferProps = BufferProps & {
8
8
  handle?: WebGLBuffer;
@@ -19,7 +19,7 @@ export declare type ClassicBufferProps = BufferProps & {
19
19
  type?: number;
20
20
  };
21
21
  /** WebGL Buffer interface */
22
- export default class ClassicBuffer extends WEBGLBuffer {
22
+ export declare class ClassicBuffer extends WEBGLBuffer {
23
23
  usage: number;
24
24
  accessor: Accessor;
25
25
  constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);
@@ -1 +1 @@
1
- {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/classic/buffer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,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sCP;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAwBhF,MAAM,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAcnD,YAAY,IAAI;QACd,IAAI,EAAE,GAAG,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;KAChB;IAQH,mBAAmB;IAOnB,QAAQ,CAAC,IAAI,KAAA,EAAE,MAAM,GAAE,MAAU,EAAE,UAAU,GAAE,MAAiC,GAAG,IAAI;IAwBvF,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,SAAkB,GAAG,IAAI;IA8BtE,UAAU;IAKV,yBAAyB,CAAC,aAAa,EAAE,MAAM;IAQ/C,UAAU,CAAC,IAAI,KAAA;IAQf,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,GAAG;IAQ5B,2CAA2C;IAC3C,IAAI,IAAI,WAEP;CACF"}
@@ -2,10 +2,10 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import { assert, checkProps } from '@luma.gl/api';
3
3
  import GL from '@luma.gl/constants';
4
4
  import { assertWebGL2Context } from "../context/context/webgl-checks.js";
5
- import Accessor from "./accessor.js";
5
+ import { Accessor } from "./accessor.js";
6
6
  import { getGLTypeFromTypedArray, getTypedArrayFromGLType } from "./typed-array-utils.js";
7
- import WebGLDevice from "../adapter/webgl-device.js";
8
- import WEBGLBuffer from "../adapter/resources/webgl-buffer.js";
7
+ import { WebGLDevice } from "../adapter/webgl-device.js";
8
+ import { WEBGLBuffer } from "../adapter/resources/webgl-buffer.js";
9
9
  const DEBUG_DATA_LENGTH = 10;
10
10
  const DEPRECATED_PROPS = {
11
11
  offset: 'accessor.offset',
@@ -47,7 +47,7 @@ function getWEBGLBufferProps(props) {
47
47
  }
48
48
  return bufferProps;
49
49
  }
50
- export default class ClassicBuffer extends WEBGLBuffer {
50
+ export class ClassicBuffer extends WEBGLBuffer {
51
51
  constructor(device) {
52
52
  let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
53
53
  super(WebGLDevice.attach(device), getWEBGLBufferProps(props));
@@ -1 +1 @@
1
- {"version":3,"file":"buffer.js","names":["assert","checkProps","GL","assertWebGL2Context","Accessor","getGLTypeFromTypedArray","getTypedArrayFromGLType","WebGLDevice","WEBGLBuffer","DEBUG_DATA_LENGTH","DEPRECATED_PROPS","offset","stride","type","size","divisor","normalized","integer","instanced","isInstanced","PROP_CHECKS_INITIALIZE","removedProps","replacedProps","bytes","deprecatedProps","PROP_CHECKS_SET_PROPS","getWEBGLBufferProps","props","ArrayBuffer","isView","data","byteLength","bufferProps","byteOffset","ClassicBuffer","constructor","device","arguments","length","undefined","attach","_defineProperty","setAccessor","Object","assign","accessor","seal","write","subData","getElementCount","Math","round","getBytesPerElement","getVertexCount","getBytesPerVertex","initialize","Number","isFinite","webglUsage","STATIC_DRAW","debugData","_setData","_setByteLength","setProps","buffer","reallocate","bytesUsed","setData","options","srcOffset","target","gl","webgl2","COPY_WRITE_BUFFER","bindBuffer","handle","bufferSubData","_inferType","copyData","sourceBuffer","readOffset","writeOffset","gl2","COPY_READ_BUFFER","copyBufferSubData","getData","_this$gl","dstData","srcByteOffset","dstOffset","ArrayType","FLOAT","clamped","sourceAvailableElementCount","_getAvailableElementCount","dstElementOffset","dstAvailableElementCount","dstElementCount","min","copyElementCount","getBufferSubData","bind","index","UNIFORM_BUFFER","TRANSFORM_FEEDBACK_BUFFER","_this$gl2","bindBufferRange","_this$gl3","bindBufferBase","unbind","isIndexedBuffer","_this$gl4","getDebugData","changed","invalidateDebugData","trackDeallocatedMemory","_getTarget","bufferData","slice","trackAllocatedMemory","Float32Array","sourceElementOffset","BYTES_PER_ELEMENT","getParameter","pname","value","getBufferParameter"],"sources":["../../src/classic/buffer.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport type {Device, BufferProps, TypedArray} from '@luma.gl/api';\nimport {assert, checkProps} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {assertWebGL2Context} from '../context/context/webgl-checks';\nimport {AccessorObject} from '../types';\nimport Accessor from './accessor';\nimport {getGLTypeFromTypedArray, getTypedArrayFromGLType} from './typed-array-utils';\n\nimport WebGLDevice from '../adapter/webgl-device';\nimport WEBGLBuffer from '../adapter/resources/webgl-buffer';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n// Shared prop checks for constructor and setProps\nconst DEPRECATED_PROPS = {\n offset: 'accessor.offset',\n stride: 'accessor.stride',\n type: 'accessor.type',\n size: 'accessor.size',\n divisor: 'accessor.divisor',\n normalized: 'accessor.normalized',\n integer: 'accessor.integer',\n instanced: 'accessor.divisor',\n isInstanced: 'accessor.divisor'\n};\n\n// Prop checks for constructor\nconst PROP_CHECKS_INITIALIZE = {\n removedProps: {},\n replacedProps: {\n bytes: 'byteLength'\n },\n // new Buffer() with individual accessor props is still used in apps, emit warnings\n deprecatedProps: DEPRECATED_PROPS\n};\n\n// Prop checks for setProps\nconst PROP_CHECKS_SET_PROPS = {\n // Buffer.setProps() with individual accessor props is rare => emit errors\n removedProps: DEPRECATED_PROPS\n};\n\nfunction getWEBGLBufferProps(props: ClassicBufferProps | ArrayBufferView | number): BufferProps {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n return {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n else if (typeof props === 'number') {\n return {byteLength: props };\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n const bufferProps = {...props };\n if (bufferProps.offset) {\n bufferProps.byteOffset = bufferProps.offset;\n }\n return bufferProps;\n}\n\n/** WebGL Buffer interface */\nexport type ClassicBufferProps = BufferProps & {\n handle?: WebGLBuffer;\n\n target?: number;\n webglUsage?: number;\n\n accessor?: AccessorObject;\n\n /** @deprecated */\n index?: number;\n /** @deprecated */\n offset?: number;\n /** @deprecated */\n size?: number;\n /** @deprecated */\n type?: number\n}\n\n/** WebGL Buffer interface */\nexport default class ClassicBuffer extends WEBGLBuffer {\n usage: number;\n accessor: Accessor;\n\n constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);\n constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);\n constructor(device: Device | WebGLRenderingContext, byteLength: number);\n\n constructor(device: Device | WebGLRenderingContext, props = {}) {\n super(WebGLDevice.attach(device), getWEBGLBufferProps(props));\n\n // Base class initializes\n // this.initialize(props);\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, (props as ClassicBufferProps).accessor));\n\n // infer GL type from supplied typed array\n if (this.props.data) {\n const type = getGLTypeFromTypedArray(this.props.data as TypedArray);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n }\n\n Object.seal(this);\n }\n\n override write(data: TypedArray, byteOffset?: number): void {\n this.subData({data, offset: byteOffset});\n }\n\n // returns number of elements in the buffer (assuming that the full buffer is used)\n getElementCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));\n }\n\n // returns number of vertices in the buffer (assuming that the full buffer is used)\n getVertexCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerVertex(accessor));\n }\n\n // Creates and initializes the buffer object's data store.\n // Signature: `new Buffer(gl, {data: new Float32Array(...)})`\n // Signature: `new Buffer(gl, new Float32Array(...))`\n // Signature: `new Buffer(gl, 100)`\n initialize(props: ClassicBufferProps = {}): this {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n props = {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n if (Number.isFinite(props)) {\n // @ts-expect-error\n props = {byteLength: props};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n\n // Initialize member fields\n this.webglUsage = props.webglUsage || GL.STATIC_DRAW;\n this.debugData = null;\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, props.accessor));\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._setData(props.data, props.offset, props.byteLength);\n } else {\n this._setByteLength(props.byteLength || 0);\n }\n\n return this;\n }\n\n setProps(props: ClassicBufferProps): this {\n props = checkProps('Buffer', props, PROP_CHECKS_SET_PROPS);\n\n if ('accessor' in props) {\n this.setAccessor(props.accessor);\n }\n\n return this;\n }\n\n // Optionally stores an accessor with the buffer, makes it easier to use it as an attribute later\n // {type, size = 1, offset = 0, stride = 0, normalized = false, integer = false, divisor = 0}\n setAccessor(accessor: AccessorObject | Accessor): this {\n // NOTE: From luma.gl v7.0, Accessors have an optional `buffer `field\n // (mainly to support \"interleaving\")\n // To avoid confusion, ensure `buffer.accessor` does not have a `buffer.accessor.buffer` field:\n accessor = Object.assign({}, accessor);\n // @ts-expect-error\n delete accessor.buffer;\n\n // This new statement ensures that an \"accessor object\" is re-packaged as an Accessor instance\n this.accessor = new Accessor(accessor);\n return this;\n }\n\n // Allocate a bigger GPU buffer (if the current buffer is not big enough).\n // If a reallocation is triggered it clears the buffer\n // Returns:\n // `true`: buffer was reallocated, data was cleared\n // `false`: buffer was big enough, data is intact\n reallocate(byteLength: number): boolean {\n if (byteLength > this.byteLength) {\n this._setByteLength(byteLength);\n return true;\n }\n this.bytesUsed = byteLength;\n return false;\n }\n\n // Update with new data. Reinitializes the buffer\n setData(props: ClassicBufferProps) {\n return this.initialize(props);\n }\n\n // Updates a subset of a buffer object's data store.\n // Data (Typed Array or ArrayBuffer), length is inferred unless provided\n // Offset into buffer\n // WebGL2 only: Offset into srcData\n // WebGL2 only: Number of bytes to be copied\n subData(options: TypedArray | {data: TypedArray, offset?: number; srcOffset?: number; byteLength?: number, length?: number}) {\n // Signature: buffer.subData(new Float32Array([...]))\n if (ArrayBuffer.isView(options)) {\n options = {data: options};\n }\n\n const {data, offset = 0, srcOffset = 0} = options;\n const byteLength = options.byteLength || options.length;\n\n assert(data);\n\n // Create the buffer - binding it here for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n // @ts-expect-error\n const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n this.gl.bindBuffer(target, this.handle);\n // WebGL2: subData supports additional srcOffset and length parameters\n if (srcOffset !== 0 || byteLength !== undefined) {\n assertWebGL2Context(this.gl);\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, offset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n this.debugData = null;\n\n this._inferType(data);\n\n return this;\n }\n\n /**\n * Copies part of the data of another buffer into this buffer\n * @note WEBGL2 ONLY\n */\n copyData(options: {\n sourceBuffer: any;\n readOffset?: number;\n writeOffset?: number;\n size: any;\n }): this {\n const {sourceBuffer, readOffset = 0, writeOffset = 0, size} = options;\n const {gl, gl2} = this;\n assertWebGL2Context(gl);\n\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n gl.bindBuffer(GL.COPY_READ_BUFFER, sourceBuffer.handle);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, this.handle);\n gl2?.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);\n gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n this.debugData = null;\n\n return this;\n }\n\n /**\n * Reads data from buffer into an ArrayBufferView or SharedArrayBuffer.\n * @note WEBGL2 ONLY\n */\n override getData(options?: {\n dstData?: any;\n srcByteOffset?: number;\n dstOffset?: number;\n length?: number;\n }): any {\n let {dstData = null, length = 0} = options || {};\n const {srcByteOffset = 0, dstOffset = 0} = options || {};\n assertWebGL2Context(this.gl);\n\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);\n\n const dstElementOffset = dstOffset;\n\n let dstAvailableElementCount;\n let dstElementCount;\n if (dstData) {\n dstElementCount = dstData.length;\n dstAvailableElementCount = dstElementCount - dstElementOffset;\n } else {\n // Allocate ArrayBufferView with enough size to copy all eligible data.\n dstAvailableElementCount = Math.min(\n sourceAvailableElementCount,\n length || sourceAvailableElementCount\n );\n dstElementCount = dstElementOffset + dstAvailableElementCount;\n }\n\n const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);\n length = length || copyElementCount;\n assert(length <= copyElementCount);\n dstData = dstData || new ArrayType(dstElementCount);\n\n // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);\n this.gl2?.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n return dstData;\n }\n\n /**\n * Binds a buffer to a given binding point (target).\n * GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER take an index, and optionally a range.\n * - GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER need an index to affect state\n * - GL.UNIFORM_BUFFER: `offset` must be aligned to GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT.\n * - GL.UNIFORM_BUFFER: `size` must be a minimum of GL.UNIFORM_BLOCK_SIZE_DATA.\n */\n bind(options?: {target?: number; index?: any; offset?: number; size: any}): this {\n const {\n target = this.target, // target for the bind operation\n index = this.accessor && this.accessor.index, // index = index of target (indexed bind point)\n offset = 0,\n size\n } = options || {};\n // NOTE: While GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER could\n // be used as direct binding points, they will not affect transform feedback or\n // uniform buffer state. Instead indexed bindings need to be made.\n if (target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER) {\n if (size !== undefined) {\n this.gl2?.bindBufferRange(target, index, this.handle, offset, size);\n } else {\n assert(offset === 0); // Make sure offset wasn't supplied\n this.gl2?.bindBufferBase(target, index, this.handle);\n }\n } else {\n this.gl.bindBuffer(target, this.handle);\n }\n\n return this;\n }\n\n unbind(options?: {target?: any; index?: any}): this {\n const {target = this.target, index = this.accessor && this.accessor.index} = options || {};\n const isIndexedBuffer = target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER;\n if (isIndexedBuffer) {\n this.gl2?.bindBufferBase(target, index, null);\n } else {\n this.gl.bindBuffer(target, null);\n }\n return this;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n // Returns a short initial data array\n getDebugData(): {\n data: any;\n changed: boolean;\n } {\n if (!this.debugData) {\n this.debugData = this.getData({length: Math.min(DEBUG_DATA_LENGTH, this.byteLength)});\n return {data: this.debugData, changed: true};\n }\n return {data: this.debugData, changed: false};\n }\n\n invalidateDebugData() {\n this.debugData = null;\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _setData(data, offset: number = 0, byteLength: number = data.byteLength + offset): this {\n assert(ArrayBuffer.isView(data));\n\n this.trackDeallocatedMemory();\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, offset, data);\n this.gl.bindBuffer(target, null);\n\n this.debugData = data.slice(0, DEBUG_DATA_LENGTH);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n\n // infer GL type from supplied typed array\n const type = getGLTypeFromTypedArray(data);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _setByteLength(byteLength: number, webglUsage = this.webglUsage): this {\n assert(byteLength >= 0);\n\n this.trackDeallocatedMemory();\n\n // Workaround needed for Safari (#291):\n // gl.bufferData with size equal to 0 crashes. Instead create zero sized array.\n let data = byteLength;\n if (byteLength === 0) {\n // @ts-expect-error\n data = new Float32Array(0);\n }\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.webglUsage = webglUsage;\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n this.trackAllocatedMemory(byteLength);\n\n return this;\n }\n\n // Binding a buffer for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n _getTarget() {\n // @ts-expect-error\n return this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getAvailableElementCount(srcByteOffset: number) {\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;\n return this.getElementCount() - sourceElementOffset;\n }\n\n // Automatically infers type from typed array passed to setData\n // Note: No longer that useful, since type is now autodeduced from the compiled shaders\n _inferType(data) {\n if (!this.accessor.type) {\n this.setAccessor(new Accessor(this.accessor, {type: getGLTypeFromTypedArray(data)}));\n }\n }\n\n // RESOURCE METHODS\n\n getParameter(pname: GL): any {\n this.gl.bindBuffer(this.target, this.handle);\n const value = this.gl.getBufferParameter(this.target, pname);\n this.gl.bindBuffer(this.target, null);\n return value;\n }\n\n // DEPRECATIONS - v7.0\n /** @deprecated Use Buffer.accessor.type */\n get type() {\n return this.accessor.type;\n }\n}\n"],"mappings":";AAGA,SAAQA,MAAM,EAAEC,UAAU,QAAO,cAAc;AAC/C,OAAOC,EAAE,MAAM,oBAAoB;AAAC,SAC5BC,mBAAmB;AAAA,OAEpBC,QAAQ;AAAA,SACPC,uBAAuB,EA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uBAAuB,CAACyB,IAAI;MAAC,CAAC,CAAC,CAAC;IACtF;EACF;EAIA6F,YAAYA,CAACC,KAAS,EAAO;IAC3B,IAAI,CAACrD,EAAE,CAACG,UAAU,CAAC,IAAI,CAACJ,MAAM,EAAE,IAAI,CAACK,MAAM,CAAC;IAC5C,MAAMkD,KAAK,GAAG,IAAI,CAACtD,EAAE,CAACuD,kBAAkB,CAAC,IAAI,CAACxD,MAAM,EAAEsD,KAAK,CAAC;IAC5D,IAAI,CAACrD,EAAE,CAACG,UAAU,CAAC,IAAI,CAACJ,MAAM,EAAE,IAAI,CAAC;IACrC,OAAOuD,KAAK;EACd;EAIA,IAAIhH,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACgC,QAAQ,CAAChC,IAAI;EAC3B;AACF"}
1
+ {"version":3,"file":"buffer.js","names":["assert","checkProps","GL","assertWebGL2Context","Accessor","getGLTypeFromTypedArray","getTypedArrayFromGLType","WebGLDevice","WEBGLBuffer","DEBUG_DATA_LENGTH","DEPRECATED_PROPS","offset","stride","type","size","divisor","normalized","integer","instanced","isInstanced","PROP_CHECKS_INITIALIZE","removedProps","replacedProps","bytes","deprecatedProps","PROP_CHECKS_SET_PROPS","getWEBGLBufferProps","props","ArrayBuffer","isView","data","byteLength","bufferProps","byteOffset","ClassicBuffer","constructor","device","arguments","length","undefined","attach","_defineProperty","setAccessor","Object","assign","accessor","seal","write","subData","getElementCount","Math","round","getBytesPerElement","getVertexCount","getBytesPerVertex","initialize","Number","isFinite","webglUsage","STATIC_DRAW","debugData","_setData","_setByteLength","setProps","buffer","reallocate","bytesUsed","setData","options","srcOffset","target","gl","webgl2","COPY_WRITE_BUFFER","bindBuffer","handle","bufferSubData","_inferType","copyData","sourceBuffer","readOffset","writeOffset","gl2","COPY_READ_BUFFER","copyBufferSubData","getData","_this$gl","dstData","srcByteOffset","dstOffset","ArrayType","FLOAT","clamped","sourceAvailableElementCount","_getAvailableElementCount","dstElementOffset","dstAvailableElementCount","dstElementCount","min","copyElementCount","getBufferSubData","bind","index","UNIFORM_BUFFER","TRANSFORM_FEEDBACK_BUFFER","_this$gl2","bindBufferRange","_this$gl3","bindBufferBase","unbind","isIndexedBuffer","_this$gl4","getDebugData","changed","invalidateDebugData","trackDeallocatedMemory","_getTarget","bufferData","slice","trackAllocatedMemory","Float32Array","sourceElementOffset","BYTES_PER_ELEMENT","getParameter","pname","value","getBufferParameter"],"sources":["../../src/classic/buffer.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport type {Device, BufferProps, TypedArray} from '@luma.gl/api';\nimport {assert, checkProps} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {assertWebGL2Context} from '../context/context/webgl-checks';\nimport {AccessorObject} from '../types';\nimport {Accessor} from './accessor';\nimport {getGLTypeFromTypedArray, getTypedArrayFromGLType} from './typed-array-utils';\n\nimport {WebGLDevice} from '../adapter/webgl-device';\nimport {WEBGLBuffer} from '../adapter/resources/webgl-buffer';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n// Shared prop checks for constructor and setProps\nconst DEPRECATED_PROPS = {\n offset: 'accessor.offset',\n stride: 'accessor.stride',\n type: 'accessor.type',\n size: 'accessor.size',\n divisor: 'accessor.divisor',\n normalized: 'accessor.normalized',\n integer: 'accessor.integer',\n instanced: 'accessor.divisor',\n isInstanced: 'accessor.divisor'\n};\n\n// Prop checks for constructor\nconst PROP_CHECKS_INITIALIZE = {\n removedProps: {},\n replacedProps: {\n bytes: 'byteLength'\n },\n // new Buffer() with individual accessor props is still used in apps, emit warnings\n deprecatedProps: DEPRECATED_PROPS\n};\n\n// Prop checks for setProps\nconst PROP_CHECKS_SET_PROPS = {\n // Buffer.setProps() with individual accessor props is rare => emit errors\n removedProps: DEPRECATED_PROPS\n};\n\nfunction getWEBGLBufferProps(props: ClassicBufferProps | ArrayBufferView | number): BufferProps {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n return {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n else if (typeof props === 'number') {\n return {byteLength: props };\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n const bufferProps = {...props };\n if (bufferProps.offset) {\n bufferProps.byteOffset = bufferProps.offset;\n }\n return bufferProps;\n}\n\n/** WebGL Buffer interface */\nexport type ClassicBufferProps = BufferProps & {\n handle?: WebGLBuffer;\n\n target?: number;\n webglUsage?: number;\n\n accessor?: AccessorObject;\n\n /** @deprecated */\n index?: number;\n /** @deprecated */\n offset?: number;\n /** @deprecated */\n size?: number;\n /** @deprecated */\n type?: number\n}\n\n/** WebGL Buffer interface */\nexport class ClassicBuffer extends WEBGLBuffer {\n usage: number;\n accessor: Accessor;\n\n constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);\n constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);\n constructor(device: Device | WebGLRenderingContext, byteLength: number);\n\n constructor(device: Device | WebGLRenderingContext, props = {}) {\n super(WebGLDevice.attach(device), getWEBGLBufferProps(props));\n\n // Base class initializes\n // this.initialize(props);\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, (props as ClassicBufferProps).accessor));\n\n // infer GL type from supplied typed array\n if (this.props.data) {\n const type = getGLTypeFromTypedArray(this.props.data as TypedArray);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n }\n\n Object.seal(this);\n }\n\n override write(data: TypedArray, byteOffset?: number): void {\n this.subData({data, offset: byteOffset});\n }\n\n // returns number of elements in the buffer (assuming that the full buffer is used)\n getElementCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));\n }\n\n // returns number of vertices in the buffer (assuming that the full buffer is used)\n getVertexCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerVertex(accessor));\n }\n\n // Creates and initializes the buffer object's data store.\n // Signature: `new Buffer(gl, {data: new Float32Array(...)})`\n // Signature: `new Buffer(gl, new Float32Array(...))`\n // Signature: `new Buffer(gl, 100)`\n initialize(props: ClassicBufferProps = {}): this {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n props = {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n if (Number.isFinite(props)) {\n // @ts-expect-error\n props = {byteLength: props};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n\n // Initialize member fields\n this.webglUsage = props.webglUsage || GL.STATIC_DRAW;\n this.debugData = null;\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, props.accessor));\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._setData(props.data, props.offset, props.byteLength);\n } else {\n this._setByteLength(props.byteLength || 0);\n }\n\n return this;\n }\n\n setProps(props: ClassicBufferProps): this {\n props = checkProps('Buffer', props, PROP_CHECKS_SET_PROPS);\n\n if ('accessor' in props) {\n this.setAccessor(props.accessor);\n }\n\n return this;\n }\n\n // Optionally stores an accessor with the buffer, makes it easier to use it as an attribute later\n // {type, size = 1, offset = 0, stride = 0, normalized = false, integer = false, divisor = 0}\n setAccessor(accessor: AccessorObject | Accessor): this {\n // NOTE: From luma.gl v7.0, Accessors have an optional `buffer `field\n // (mainly to support \"interleaving\")\n // To avoid confusion, ensure `buffer.accessor` does not have a `buffer.accessor.buffer` field:\n accessor = Object.assign({}, accessor);\n // @ts-expect-error\n delete accessor.buffer;\n\n // This new statement ensures that an \"accessor object\" is re-packaged as an Accessor instance\n this.accessor = new Accessor(accessor);\n return this;\n }\n\n // Allocate a bigger GPU buffer (if the current buffer is not big enough).\n // If a reallocation is triggered it clears the buffer\n // Returns:\n // `true`: buffer was reallocated, data was cleared\n // `false`: buffer was big enough, data is intact\n reallocate(byteLength: number): boolean {\n if (byteLength > this.byteLength) {\n this._setByteLength(byteLength);\n return true;\n }\n this.bytesUsed = byteLength;\n return false;\n }\n\n // Update with new data. Reinitializes the buffer\n setData(props: ClassicBufferProps) {\n return this.initialize(props);\n }\n\n // Updates a subset of a buffer object's data store.\n // Data (Typed Array or ArrayBuffer), length is inferred unless provided\n // Offset into buffer\n // WebGL2 only: Offset into srcData\n // WebGL2 only: Number of bytes to be copied\n subData(options: TypedArray | {data: TypedArray, offset?: number; srcOffset?: number; byteLength?: number, length?: number}) {\n // Signature: buffer.subData(new Float32Array([...]))\n if (ArrayBuffer.isView(options)) {\n options = {data: options};\n }\n\n const {data, offset = 0, srcOffset = 0} = options;\n const byteLength = options.byteLength || options.length;\n\n assert(data);\n\n // Create the buffer - binding it here for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n // @ts-expect-error\n const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n this.gl.bindBuffer(target, this.handle);\n // WebGL2: subData supports additional srcOffset and length parameters\n if (srcOffset !== 0 || byteLength !== undefined) {\n assertWebGL2Context(this.gl);\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, offset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n this.debugData = null;\n\n this._inferType(data);\n\n return this;\n }\n\n /**\n * Copies part of the data of another buffer into this buffer\n * @note WEBGL2 ONLY\n */\n copyData(options: {\n sourceBuffer: any;\n readOffset?: number;\n writeOffset?: number;\n size: any;\n }): this {\n const {sourceBuffer, readOffset = 0, writeOffset = 0, size} = options;\n const {gl, gl2} = this;\n assertWebGL2Context(gl);\n\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n gl.bindBuffer(GL.COPY_READ_BUFFER, sourceBuffer.handle);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, this.handle);\n gl2?.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);\n gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n this.debugData = null;\n\n return this;\n }\n\n /**\n * Reads data from buffer into an ArrayBufferView or SharedArrayBuffer.\n * @note WEBGL2 ONLY\n */\n override getData(options?: {\n dstData?: any;\n srcByteOffset?: number;\n dstOffset?: number;\n length?: number;\n }): any {\n let {dstData = null, length = 0} = options || {};\n const {srcByteOffset = 0, dstOffset = 0} = options || {};\n assertWebGL2Context(this.gl);\n\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);\n\n const dstElementOffset = dstOffset;\n\n let dstAvailableElementCount;\n let dstElementCount;\n if (dstData) {\n dstElementCount = dstData.length;\n dstAvailableElementCount = dstElementCount - dstElementOffset;\n } else {\n // Allocate ArrayBufferView with enough size to copy all eligible data.\n dstAvailableElementCount = Math.min(\n sourceAvailableElementCount,\n length || sourceAvailableElementCount\n );\n dstElementCount = dstElementOffset + dstAvailableElementCount;\n }\n\n const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);\n length = length || copyElementCount;\n assert(length <= copyElementCount);\n dstData = dstData || new ArrayType(dstElementCount);\n\n // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);\n this.gl2?.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n return dstData;\n }\n\n /**\n * Binds a buffer to a given binding point (target).\n * GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER take an index, and optionally a range.\n * - GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER need an index to affect state\n * - GL.UNIFORM_BUFFER: `offset` must be aligned to GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT.\n * - GL.UNIFORM_BUFFER: `size` must be a minimum of GL.UNIFORM_BLOCK_SIZE_DATA.\n */\n bind(options?: {target?: number; index?: any; offset?: number; size: any}): this {\n const {\n target = this.target, // target for the bind operation\n index = this.accessor && this.accessor.index, // index = index of target (indexed bind point)\n offset = 0,\n size\n } = options || {};\n // NOTE: While GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER could\n // be used as direct binding points, they will not affect transform feedback or\n // uniform buffer state. Instead indexed bindings need to be made.\n if (target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER) {\n if (size !== undefined) {\n this.gl2?.bindBufferRange(target, index, this.handle, offset, size);\n } else {\n assert(offset === 0); // Make sure offset wasn't supplied\n this.gl2?.bindBufferBase(target, index, this.handle);\n }\n } else {\n this.gl.bindBuffer(target, this.handle);\n }\n\n return this;\n }\n\n unbind(options?: {target?: any; index?: any}): this {\n const {target = this.target, index = this.accessor && this.accessor.index} = options || {};\n const isIndexedBuffer = target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER;\n if (isIndexedBuffer) {\n this.gl2?.bindBufferBase(target, index, null);\n } else {\n this.gl.bindBuffer(target, null);\n }\n return this;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n // Returns a short initial data array\n getDebugData(): {\n data: any;\n changed: boolean;\n } {\n if (!this.debugData) {\n this.debugData = this.getData({length: Math.min(DEBUG_DATA_LENGTH, this.byteLength)});\n return {data: this.debugData, changed: true};\n }\n return {data: this.debugData, changed: false};\n }\n\n invalidateDebugData() {\n this.debugData = null;\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _setData(data, offset: number = 0, byteLength: number = data.byteLength + offset): this {\n assert(ArrayBuffer.isView(data));\n\n this.trackDeallocatedMemory();\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, offset, data);\n this.gl.bindBuffer(target, null);\n\n this.debugData = data.slice(0, DEBUG_DATA_LENGTH);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n\n // infer GL type from supplied typed array\n const type = getGLTypeFromTypedArray(data);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _setByteLength(byteLength: number, webglUsage = this.webglUsage): this {\n assert(byteLength >= 0);\n\n this.trackDeallocatedMemory();\n\n // Workaround needed for Safari (#291):\n // gl.bufferData with size equal to 0 crashes. Instead create zero sized array.\n let data = byteLength;\n if (byteLength === 0) {\n // @ts-expect-error\n data = new Float32Array(0);\n }\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.webglUsage = webglUsage;\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n this.trackAllocatedMemory(byteLength);\n\n return this;\n }\n\n // Binding a buffer for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n _getTarget() {\n // @ts-expect-error\n return this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getAvailableElementCount(srcByteOffset: number) {\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;\n return this.getElementCount() - sourceElementOffset;\n }\n\n // Automatically infers type from typed array passed to setData\n // Note: No longer that useful, since type is now autodeduced from the compiled shaders\n _inferType(data) {\n if (!this.accessor.type) {\n this.setAccessor(new Accessor(this.accessor, {type: getGLTypeFromTypedArray(data)}));\n }\n }\n\n // RESOURCE METHODS\n\n getParameter(pname: GL): any {\n this.gl.bindBuffer(this.target, this.handle);\n const value = this.gl.getBufferParameter(this.target, pname);\n this.gl.bindBuffer(this.target, null);\n return value;\n }\n\n // DEPRECATIONS - v7.0\n /** @deprecated Use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AAmB;EACrD;EAIA5C,UAAUA,CAAC/C,IAAI,EAAE;IACf,IAAI,CAAC,IAAI,CAACe,QAAQ,CAAChC,IAAI,EAAE;MACvB,IAAI,CAAC6B,WAAW,CAAC,IAAItC,QAAQ,CAAC,IAAI,CAACyC,QAAQ,EAAE;QAAChC,IAAI,EAAER,uBAAuB,CAACyB,IAAI;MAAC,CAAC,CAAC,CAAC;IACtF;EACF;EAIA6F,YAAYA,CAACC,KAAS,EAAO;IAC3B,IAAI,CAACrD,EAAE,CAACG,UAAU,CAAC,IAAI,CAACJ,MAAM,EAAE,IAAI,CAACK,MAAM,CAAC;IAC5C,MAAMkD,KAAK,GAAG,IAAI,CAACtD,EAAE,CAACuD,kBAAkB,CAAC,IAAI,CAACxD,MAAM,EAAEsD,KAAK,CAAC;IAC5D,IAAI,CAACrD,EAAE,CAACG,UAAU,CAAC,IAAI,CAACJ,MAAM,EAAE,IAAI,CAAC;IACrC,OAAOuD,KAAK;EACd;EAIA,IAAIhH,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACgC,QAAQ,CAAChC,IAAI;EAC3B;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { GL_PARAMETER_DEFAULTS, GL_PARAMETER_SETTERS, GL_COMPOSITE_PARAMETER_SETTERS, GL_PARAMETER_GETTERS } from "./webgl-parameter-tables.js";
2
- import WebGLDevice from "../../adapter/webgl-device.js";
2
+ import { WebGLDevice } from "../../adapter/webgl-device.js";
3
3
  export function setParameters(device, parameters) {
4
4
  const webglDevice = WebGLDevice.attach(device);
5
5
  const gl = webglDevice.gl;
@@ -1 +1 @@
1
- {"version":3,"file":"unified-parameter-api.js","names":["GL_PARAMETER_DEFAULTS","GL_PARAMETER_SETTERS","GL_COMPOSITE_PARAMETER_SETTERS","GL_PARAMETER_GETTERS","WebGLDevice","setParameters","device","parameters","webglDevice","attach","gl","isObjectEmpty","compositeSetters","key","glConstant","Number","setter","cache","state","compositeSetter","getParameters","arguments","length","undefined","getter","getParameter","parameterKeys","Array","isArray","Object","keys","resetParameters","object"],"sources":["../../../src/context/parameters/unified-parameter-api.ts"],"sourcesContent":["// Provides a unified API for getting and setting any WebGL parameter\n// Also knows default values of all parameters, enabling fast cache initialization\n// Provides base functionality for the state caching.\nimport {Device} from '@luma.gl/api';\nimport type {GLParameters} from '../../types/webgl';\nimport {\n GL_PARAMETER_DEFAULTS,\n GL_PARAMETER_SETTERS,\n GL_COMPOSITE_PARAMETER_SETTERS,\n GL_PARAMETER_GETTERS\n} from './webgl-parameter-tables';\n\nimport WebGLDevice from '../../adapter/webgl-device';\n\nexport type {GLParameters};\n\n/**\n * Sets any GL parameter regardless of function (gl.blendMode, ...)\n *\n * @note requires a `cache` object to be set on the context (gl.state.cache)\n * This object is used to fill in any missing values for composite setter functions\n */\nexport function setParameters(\n device: Device | WebGLRenderingContext,\n parameters: GLParameters\n): void {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n return;\n }\n\n const compositeSetters = {};\n\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n\n for (const key in parameters) {\n const glConstant = Number(key);\n const setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n } else {\n // if (gl[glConstant] !== undefined) {\n // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...\n // TODO - deep equal on values? only call setter if value has changed?\n // NOTE - the setter will automatically update this.state\n setter(gl, parameters[key], glConstant);\n }\n }\n }\n\n // HANDLE COMPOSITE SETTERS\n\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n // @ts-expect-error\n const cache = gl.state && gl.state.cache;\n if (cache) {\n for (const key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, parameters, cache);\n }\n }\n\n // Add a log for the else case?\n}\n\n/**\n * Reads the entire WebGL state from a context\n\n // default to querying all parameters\n\n * @returns - a newly created map, with values keyed by GL parameters\n *\n * @note Copies the state from a context (gl.getParameter should not be overriden)\n * Reads the entire WebGL state from a context\n *\n * @note This can generates a huge amount of synchronous driver roundtrips and should be\n * considered a very slow operation, to be used only if/when a context already manipulated\n * by external code needs to be synchronized for the first time\n */\nexport function getParameters(\n device: Device | WebGLRenderingContext,\n parameters: keyof GLParameters | (keyof GLParameters)[] | GLParameters = GL_PARAMETER_DEFAULTS\n): GLParameters {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n // support both arrays of parameters and objects (keys represent parameters)\n\n if (typeof parameters === 'number') {\n // single GL enum\n const key = parameters;\n const getter = GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n\n const state = {};\n for (const key of parameterKeys) {\n const getter = GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n return state;\n}\n\n/**\n * Reset all parameters to a (almost) pure context state\n * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,\n * NOT the canvas size dimensions, so they will have to be properly set after\n * calling this function.\n */\nexport function resetParameters(device: Device | WebGLRenderingContext): void {\n setParameters(device, GL_PARAMETER_DEFAULTS);\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"mappings":"SAMEA,qBAAqB,EACrBC,oBAAoB,EACpBC,8BAA8B,EAC9BC,oBAAoB;AAAA,OAGfC,WAAW;AAUlB,OAAO,SAASC,aAAaA,CAC3BC,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,UAAU;IACtB,MAAMiB,MAAM,GAAGrB,oBAAoB,CAACU,GAAG,CAAC;IACxC,OAAOW,MAAM,GAAGA,MAAM,CAACd,EAAE,EAAEG,GAAG,CAAC,GAAGH,EAAE,CAACe,YAAY,CAACZ,GAAG,CAAC;EACxD;EAEA,MAAMa,aAAa,GAAGC,KAAK,CAACC,OAAO,CAACrB,UAAU,CAAC,GAAGA,UAAU,GAAGsB,MAAM,CAACC,IAAI,CAACvB,UAAU,CAAC;EAEtF,MAAMW,KAAK,GAAG,CAAC,CAAC;EAChB,KAAK,MAAML,GAAG,IAAIa,aAAa,EAAE;IAC/B,MAAMF,MAAM,GAAGrB,oBAAoB,CAACU,GAAG,CAAC;IACxCK,KAAK,CAACL,GAAG,CAAC,GAAGW,MAAM,GAAGA,MAAM,CAACd,EAAE,EAAEK,MAAM,CAACF,GAAG,CAAC,CAAC,GAAGH,EAAE,CAACe,YAAY,CAACV,MAAM,CAACF,GAAG,CAAC,CAAC;EAC9E;EACA,OAAOK,KAAK;AACd;AAQA,OAAO,SAASa,eAAeA,CAACzB,MAAsC,EAAQ;EAC5ED,aAAa,CAACC,MAAM,EAAEN,qBAAqB,CAAC;AAC9C;AAKA,SAASW,aAAaA,CAACqB,MAAM,EAAE;EAE7B,KAAK,MAAMnB,GAAG,IAAImB,MAAM,EAAE;IACxB,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb"}
1
+ {"version":3,"file":"unified-parameter-api.js","names":["GL_PARAMETER_DEFAULTS","GL_PARAMETER_SETTERS","GL_COMPOSITE_PARAMETER_SETTERS","GL_PARAMETER_GETTERS","WebGLDevice","setParameters","device","parameters","webglDevice","attach","gl","isObjectEmpty","compositeSetters","key","glConstant","Number","setter","cache","state","compositeSetter","getParameters","arguments","length","undefined","getter","getParameter","parameterKeys","Array","isArray","Object","keys","resetParameters","object"],"sources":["../../../src/context/parameters/unified-parameter-api.ts"],"sourcesContent":["// Provides a unified API for getting and setting any WebGL parameter\n// Also knows default values of all parameters, enabling fast cache initialization\n// Provides base functionality for the state caching.\nimport {Device} from '@luma.gl/api';\nimport type {GLParameters} from '../../types/webgl';\nimport {\n GL_PARAMETER_DEFAULTS,\n GL_PARAMETER_SETTERS,\n GL_COMPOSITE_PARAMETER_SETTERS,\n GL_PARAMETER_GETTERS\n} from './webgl-parameter-tables';\n\nimport {WebGLDevice} from '../../adapter/webgl-device';\n\nexport type {GLParameters};\n\n/**\n * Sets any GL parameter regardless of function (gl.blendMode, ...)\n *\n * @note requires a `cache` object to be set on the context (gl.state.cache)\n * This object is used to fill in any missing values for composite setter functions\n */\nexport function setParameters(\n device: Device | WebGLRenderingContext,\n parameters: GLParameters\n): void {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n return;\n }\n\n const compositeSetters = {};\n\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n\n for (const key in parameters) {\n const glConstant = Number(key);\n const setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n } else {\n // if (gl[glConstant] !== undefined) {\n // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...\n // TODO - deep equal on values? only call setter if value has changed?\n // NOTE - the setter will automatically update this.state\n setter(gl, parameters[key], glConstant);\n }\n }\n }\n\n // HANDLE COMPOSITE SETTERS\n\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n // @ts-expect-error\n const cache = gl.state && gl.state.cache;\n if (cache) {\n for (const key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, parameters, cache);\n }\n }\n\n // Add a log for the else case?\n}\n\n/**\n * Reads the entire WebGL state from a context\n\n // default to querying all parameters\n\n * @returns - a newly created map, with values keyed by GL parameters\n *\n * @note Copies the state from a context (gl.getParameter should not be overriden)\n * Reads the entire WebGL state from a context\n *\n * @note This can generates a huge amount of synchronous driver roundtrips and should be\n * considered a very slow operation, to be used only if/when a context already manipulated\n * by external code needs to be synchronized for the first time\n */\nexport function getParameters(\n device: Device | WebGLRenderingContext,\n parameters: keyof GLParameters | (keyof GLParameters)[] | GLParameters = GL_PARAMETER_DEFAULTS\n): GLParameters {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n // support both arrays of parameters and objects (keys represent parameters)\n\n if (typeof parameters === 'number') {\n // single GL enum\n const key = parameters;\n const getter = GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n\n const state = {};\n for (const key of parameterKeys) {\n const getter = GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n return state;\n}\n\n/**\n * Reset all parameters to a (almost) pure context state\n * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,\n * NOT the canvas size dimensions, so they will have to be properly set after\n * calling this function.\n */\nexport function resetParameters(device: Device | WebGLRenderingContext): void {\n setParameters(device, GL_PARAMETER_DEFAULTS);\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"mappings":"SAMEA,qBAAqB,EACrBC,oBAAoB,EACpBC,8BAA8B,EAC9BC,oBAAoB;AAAA,SAGdC,WAAW;AAUnB,OAAO,SAASC,aAAaA,CAC3BC,MAAsC,EACtCC,UAAwB,EAClB;EACN,MAAMC,WAAW,GAAGJ,WAAW,CAACK,MAAM,CAACH,MAAM,CAAC;EAC9C,MAAMI,EAAE,GAAGF,WAA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AAC,GAAGH,EAAE,CAACe,YAAY,CAACZ,GAAG,CAAC;EACxD;EAEA,MAAMa,aAAa,GAAGC,KAAK,CAACC,OAAO,CAACrB,UAAU,CAAC,GAAGA,UAAU,GAAGsB,MAAM,CAACC,IAAI,CAACvB,UAAU,CAAC;EAEtF,MAAMW,KAAK,GAAG,CAAC,CAAC;EAChB,KAAK,MAAML,GAAG,IAAIa,aAAa,EAAE;IAC/B,MAAMF,MAAM,GAAGrB,oBAAoB,CAACU,GAAG,CAAC;IACxCK,KAAK,CAACL,GAAG,CAAC,GAAGW,MAAM,GAAGA,MAAM,CAACd,EAAE,EAAEK,MAAM,CAACF,GAAG,CAAC,CAAC,GAAGH,EAAE,CAACe,YAAY,CAACV,MAAM,CAACF,GAAG,CAAC,CAAC;EAC9E;EACA,OAAOK,KAAK;AACd;AAQA,OAAO,SAASa,eAAeA,CAACzB,MAAsC,EAAQ;EAC5ED,aAAa,CAACC,MAAM,EAAEN,qBAAqB,CAAC;AAC9C;AAKA,SAASW,aAAaA,CAACqB,MAAM,EAAE;EAE7B,KAAK,MAAMnB,GAAG,IAAImB,MAAM,EAAE;IACxB,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb"}
@@ -1,4 +1,4 @@
1
- import { default as WebGLDevice } from "../../adapter/webgl-device.js";
1
+ import { WebGLDevice } from "../../adapter/webgl-device.js";
2
2
  import { setParameters } from "../parameters/unified-parameter-api.js";
3
3
  import { pushContextState, popContextState } from "./track-context-state.js";
4
4
  export function withParameters(device, parameters, func) {
@@ -1 +1 @@
1
- {"version":3,"file":"with-parameters.js","names":["default","WebGLDevice","setParameters","pushContextState","popContextState","withParameters","device","parameters","func","webglDevice","attach","gl","isObjectEmpty","nocatch","value","object","key"],"sources":["../../../src/context/state-tracker/with-parameters.ts"],"sourcesContent":["import type {Device} from '@luma.gl/api';\nimport {default as WebGLDevice} from '../../adapter/webgl-device';\nimport {GLParameters, setParameters} from '../parameters/unified-parameter-api';\nimport {pushContextState, popContextState} from './track-context-state';\n\n/**\n * Execute a function with a set of temporary WebGL parameter overrides\n * - Saves current \"global\" WebGL context settings\n * - Sets the supplies WebGL context parameters,\n * - Executes supplied function\n * - Restores parameters\n * - Returns the return value of the supplied function\n */\nexport function withParameters(device: Device | WebGLRenderingContext, parameters: GLParameters & {nocatch?: boolean}, func: any): any {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(device);\n }\n\n const {nocatch = true} = parameters;\n\n pushContextState(gl);\n setParameters(gl, parameters);\n\n // Setup is done, call the function\n let value;\n\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n value = func(gl);\n popContextState(gl);\n } else {\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func(gl);\n } finally {\n popContextState(gl);\n }\n }\n\n return value;\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore - dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"mappings":"SACQA,OAAO,IAAIC,WAAW;AAAA,SACRC,aAAa;AAAA,SAC3BC,gBAAgB,EAAEC,eAAe;AAUzC,OAAO,SAASC,cAAcA,CAACC,MAAsC,EAAEC,UAA8C,EAAEC,IAAS,EAAO;EACrI,MAAMC,WAAW,GAAGR,WAAW,CAACS,MAAM,CAACJ,MAAM,CAAC;EAC9C,MAAMK,EAAE,GAAGF,WAAW,CAACE,EAAE;EAEzB,IAAIC,aAAa,CAACL,UAAU,CAAC,EAAE;IAE7B,OAAOC,IAAI,CAACF,MAAM,CAAC;EACrB;EAEA,MAAM;IAACO,OAAO,GAAG;EAAI,CAAC,GAAGN,UAAU;EAEnCJ,gBAAgB,CAACQ,EAAE,CAAC;EACpBT,aAAa,CAACS,EAAE,EAAEJ,UAAU,CAAC;EAG7B,IAAIO,KAAK;EAET,IAAID,OAAO,EAAE;IAEXC,KAAK,GAAGN,IAAI,CAACG,EAAE,CAAC;IAChBP,eAAe,CAACO,EAAE,CAAC;EACrB,CAAC,MAAM;IAEL,IAAI;MACFG,KAAK,GAAGN,IAAI,CAACG,EAAE,CAAC;IAClB,CAAC,SAAS;MACRP,eAAe,CAACO,EAAE,CAAC;IACrB;EACF;EAEA,OAAOG,KAAK;AACd;AAKA,SAASF,aAAaA,CAACG,MAAM,EAAE;EAE7B,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACxB,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb"}
1
+ {"version":3,"file":"with-parameters.js","names":["WebGLDevice","setParameters","pushContextState","popContextState","withParameters","device","parameters","func","webglDevice","attach","gl","isObjectEmpty","nocatch","value","object","key"],"sources":["../../../src/context/state-tracker/with-parameters.ts"],"sourcesContent":["import type {Device} from '@luma.gl/api';\nimport {WebGLDevice} from '../../adapter/webgl-device';\nimport {GLParameters, setParameters} from '../parameters/unified-parameter-api';\nimport {pushContextState, popContextState} from './track-context-state';\n\n/**\n * Execute a function with a set of temporary WebGL parameter overrides\n * - Saves current \"global\" WebGL context settings\n * - Sets the supplies WebGL context parameters,\n * - Executes supplied function\n * - Restores parameters\n * - Returns the return value of the supplied function\n */\nexport function withParameters(device: Device | WebGLRenderingContext, parameters: GLParameters & {nocatch?: boolean}, func: any): any {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(device);\n }\n\n const {nocatch = true} = parameters;\n\n pushContextState(gl);\n setParameters(gl, parameters);\n\n // Setup is done, call the function\n let value;\n\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n value = func(gl);\n popContextState(gl);\n } else {\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func(gl);\n } finally {\n popContextState(gl);\n }\n }\n\n return value;\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore - dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"mappings":"SACQA,WAAW;AAAA,SACGC,aAAa;AAAA,SAC3BC,gBAAgB,EAAEC,eAAe;AAUzC,OAAO,SAASC,cAAcA,CAACC,MAAsC,EAAEC,UAA8C,EAAEC,IAAS,EAAO;EACrI,MAAMC,WAAW,GAAGR,WAAW,CAACS,MAAM,CAACJ,MAAM,CAAC;EAC9C,MAAMK,EAAE,GAAGF,WAAW,CAACE,EAAE;EAEzB,IAAIC,aAAa,CAACL,UAAU,CAAC,EAAE;IAE7B,OAAOC,IAAI,CAACF,MAAM,CAAC;EACrB;EAEA,MAAM;IAACO,OAAO,GAAG;EAAI,CAAC,GAAGN,UAAU;EAEnCJ,gBAAgB,CAACQ,EAAE,CAAC;EACpBT,aAAa,CAACS,EAAE,EAAEJ,UAAU,CAAC;EAG7B,IAAIO,KAAK;EAET,IAAID,OAAO,EAAE;IAEXC,KAAK,GAAGN,IAAI,CAACG,EAAE,CAAC;IAChBP,eAAe,CAACO,EAAE,CAAC;EACrB,CAAC,MAAM;IAEL,IAAI;MACFG,KAAK,GAAGN,IAAI,CAACG,EAAE,CAAC;IAClB,CAAC,SAAS;MACRP,eAAe,CAACO,EAAE,CAAC;IACrB;EACF;EAEA,OAAOG,KAAK;AACd;AAKA,SAASF,aAAaA,CAACG,MAAM,EAAE;EAE7B,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACxB,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb"}
package/dist/dist.dev.js CHANGED
@@ -927,7 +927,7 @@ var __exports__ = (() => {
927
927
  var lumaStats = new StatsManager();
928
928
 
929
929
  // ../api/src/init.ts
930
- function init() {
930
+ function initializeLuma() {
931
931
  const VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
932
932
  const STARTUP_MESSAGE = "set luma.log.level=1 (or higher) to trace rendering";
933
933
  if (globalThis.luma && globalThis.luma.VERSION !== VERSION3) {
@@ -948,8 +948,7 @@ var __exports__ = (() => {
948
948
  }
949
949
  return VERSION3;
950
950
  }
951
- var VERSION2 = init();
952
- var init_default = globalThis.luma;
951
+ var VERSION2 = initializeLuma();
953
952
 
954
953
  // ../api/src/lib/utils/utils.ts
955
954
  var uidCounters = {};
@@ -7065,7 +7064,7 @@ void main(void) {}`;
7065
7064
  /** Attach one attachment */
7066
7065
  _attachOne(attachmentPoint, attachment) {
7067
7066
  if (attachment instanceof WEBGLRenderbuffer) {
7068
- this._attachRenderbuffer(attachmentPoint, attachment);
7067
+ this._attachWEBGLRenderbuffer(attachmentPoint, attachment);
7069
7068
  return attachment;
7070
7069
  } else if (Array.isArray(attachment)) {
7071
7070
  const [texture, layer = 0, level = 0] = attachment;
@@ -7077,13 +7076,13 @@ void main(void) {}`;
7077
7076
  }
7078
7077
  throw new Error("attach");
7079
7078
  }
7080
- _attachRenderbuffer(attachment, renderbuffer) {
7079
+ _attachWEBGLRenderbuffer(attachment, renderbuffer) {
7081
7080
  this.gl.framebufferRenderbuffer(GL.FRAMEBUFFER, attachment, GL.RENDERBUFFER, renderbuffer.handle);
7082
7081
  }
7083
7082
  /**
7084
7083
  * @param attachment
7085
7084
  * @param texture
7086
- * @param layer = 0 - index into WebGLTextureArray and Texture3D or face for `TextureCubeMap`
7085
+ * @param layer = 0 - index into WEBGLTextureArray and Texture3D or face for `TextureCubeMap`
7087
7086
  * @param level = 0 - mipmapLevel (must be 0 in WebGL1)
7088
7087
  */
7089
7088
  _attachTexture(attachment, texture, layer, level) {
package/dist/index.cjs CHANGED
@@ -3920,7 +3920,7 @@ var WEBGLFramebuffer = class extends import_api14.Framebuffer {
3920
3920
  /** Attach one attachment */
3921
3921
  _attachOne(attachmentPoint, attachment) {
3922
3922
  if (attachment instanceof WEBGLRenderbuffer) {
3923
- this._attachRenderbuffer(attachmentPoint, attachment);
3923
+ this._attachWEBGLRenderbuffer(attachmentPoint, attachment);
3924
3924
  return attachment;
3925
3925
  } else if (Array.isArray(attachment)) {
3926
3926
  const [texture, layer = 0, level = 0] = attachment;
@@ -3932,7 +3932,7 @@ var WEBGLFramebuffer = class extends import_api14.Framebuffer {
3932
3932
  }
3933
3933
  throw new Error("attach");
3934
3934
  }
3935
- _attachRenderbuffer(attachment, renderbuffer) {
3935
+ _attachWEBGLRenderbuffer(attachment, renderbuffer) {
3936
3936
  this.gl.framebufferRenderbuffer(
3937
3937
  import_constants14.default.FRAMEBUFFER,
3938
3938
  attachment,
@@ -3943,7 +3943,7 @@ var WEBGLFramebuffer = class extends import_api14.Framebuffer {
3943
3943
  /**
3944
3944
  * @param attachment
3945
3945
  * @param texture
3946
- * @param layer = 0 - index into WebGLTextureArray and Texture3D or face for `TextureCubeMap`
3946
+ * @param layer = 0 - index into WEBGLTextureArray and Texture3D or face for `TextureCubeMap`
3947
3947
  * @param level = 0 - mipmapLevel (must be 0 in WebGL1)
3948
3948
  */
3949
3949
  _attachTexture(attachment, texture, layer, level) {
package/dist/index.d.ts CHANGED
@@ -1,23 +1,23 @@
1
1
  export type { WebGLLimits } from './adapter/device-helpers/device-limits';
2
2
  export { registerHeadlessGL } from './context/context/create-headless-context';
3
- export { default as WebGLDevice } from './adapter/webgl-device';
4
- export { default as WebGLCanvasContext } from './adapter/webgl-canvas-context';
5
- export { default as WEBGLResource, default as WebGLResource } from './adapter/objects/webgl-resource';
6
- export { default as WEBGLBuffer } from './adapter/resources/webgl-buffer';
7
- export { default as WEBGLTexture } from './adapter/resources/webgl-texture';
8
- export { default as WEBGLShader } from './adapter/resources/webgl-shader';
9
- export { default as WEBGLSampler } from './adapter/resources/webgl-sampler';
10
- export { default as WEBGLFramebuffer } from './adapter/resources/webgl-framebuffer';
11
- export { default as WEBGLRenderPipeline } from './adapter/resources/webgl-render-pipeline';
12
- export { default as WEBGLCommandEncoder } from './adapter/resources/webgl-command-encoder';
13
- export { default as WEBGLRenderPass } from './adapter/resources/webgl-render-pass';
3
+ export { WebGLDevice } from './adapter/webgl-device';
4
+ export { WebGLCanvasContext } from './adapter/webgl-canvas-context';
5
+ export { WebGLResource, WebGLResource as WEBGLResource } from './adapter/objects/webgl-resource';
6
+ export { WEBGLBuffer } from './adapter/resources/webgl-buffer';
7
+ export { WEBGLTexture } from './adapter/resources/webgl-texture';
8
+ export { WEBGLShader } from './adapter/resources/webgl-shader';
9
+ export { WEBGLSampler } from './adapter/resources/webgl-sampler';
10
+ export { WEBGLFramebuffer } from './adapter/resources/webgl-framebuffer';
11
+ export { WEBGLRenderPipeline } from './adapter/resources/webgl-render-pipeline';
12
+ export { WEBGLCommandEncoder } from './adapter/resources/webgl-command-encoder';
13
+ export { WEBGLRenderPass } from './adapter/resources/webgl-render-pass';
14
14
  export type { RenderbufferProps } from './adapter/objects/webgl-renderbuffer';
15
- export { default as WEBGLRenderbuffer } from './adapter/objects/webgl-renderbuffer';
16
- export { default as WEBGLVertexArrayObject } from './adapter/objects/webgl-vertex-array-object';
17
- export { default as Accessor } from './classic/accessor';
15
+ export { WEBGLRenderbuffer } from './adapter/objects/webgl-renderbuffer';
16
+ export { WEBGLVertexArrayObject } from './adapter/objects/webgl-vertex-array-object';
17
+ export { Accessor } from './classic/accessor';
18
18
  export type { AccessorObject } from './types';
19
19
  export type { ClassicBufferProps, ClassicBufferProps as BufferProps } from './classic/buffer';
20
- export { default as ClassicBuffer, default as Buffer } from './classic/buffer';
20
+ export { ClassicBuffer, ClassicBuffer as Buffer } from './classic/buffer';
21
21
  export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from './context/context/webgl-checks';
22
22
  export { setDeviceParameters, withDeviceParameters } from './adapter/converters/device-parameters';
23
23
  export type { GLParameters } from './types/webgl';
@@ -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,O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AAC,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,eAAe,CAAC;AAChD,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,4BAA4B,EAAC,MAAM,sCAAsC,CAAC"}
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  export { registerHeadlessGL } from "./context/context/create-headless-context.js";
2
- export { default as WebGLDevice } from "./adapter/webgl-device.js";
3
- export { default as WebGLCanvasContext } from "./adapter/webgl-canvas-context.js";
4
- export { default as WEBGLResource, default as WebGLResource } from "./adapter/objects/webgl-resource.js";
5
- export { default as WEBGLBuffer } from "./adapter/resources/webgl-buffer.js";
6
- export { default as WEBGLTexture } from "./adapter/resources/webgl-texture.js";
7
- export { default as WEBGLShader } from "./adapter/resources/webgl-shader.js";
8
- export { default as WEBGLSampler } from "./adapter/resources/webgl-sampler.js";
9
- export { default as WEBGLFramebuffer } from "./adapter/resources/webgl-framebuffer.js";
10
- export { default as WEBGLRenderPipeline } from "./adapter/resources/webgl-render-pipeline.js";
11
- export { default as WEBGLCommandEncoder } from "./adapter/resources/webgl-command-encoder.js";
12
- export { default as WEBGLRenderPass } from "./adapter/resources/webgl-render-pass.js";
13
- export { default as WEBGLRenderbuffer } from "./adapter/objects/webgl-renderbuffer.js";
14
- export { default as WEBGLVertexArrayObject } from "./adapter/objects/webgl-vertex-array-object.js";
15
- export { default as Accessor } from "./classic/accessor.js";
16
- export { default as ClassicBuffer, default as Buffer } from "./classic/buffer.js";
2
+ export { WebGLDevice } from "./adapter/webgl-device.js";
3
+ export { WebGLCanvasContext } from "./adapter/webgl-canvas-context.js";
4
+ export { WebGLResource, WebGLResource as WEBGLResource } from "./adapter/objects/webgl-resource.js";
5
+ export { WEBGLBuffer } from "./adapter/resources/webgl-buffer.js";
6
+ export { WEBGLTexture } from "./adapter/resources/webgl-texture.js";
7
+ export { WEBGLShader } from "./adapter/resources/webgl-shader.js";
8
+ export { WEBGLSampler } from "./adapter/resources/webgl-sampler.js";
9
+ export { WEBGLFramebuffer } from "./adapter/resources/webgl-framebuffer.js";
10
+ export { WEBGLRenderPipeline } from "./adapter/resources/webgl-render-pipeline.js";
11
+ export { WEBGLCommandEncoder } from "./adapter/resources/webgl-command-encoder.js";
12
+ export { WEBGLRenderPass } from "./adapter/resources/webgl-render-pass.js";
13
+ export { WEBGLRenderbuffer } from "./adapter/objects/webgl-renderbuffer.js";
14
+ export { WEBGLVertexArrayObject } from "./adapter/objects/webgl-vertex-array-object.js";
15
+ export { Accessor } from "./classic/accessor.js";
16
+ export { ClassicBuffer, ClassicBuffer as Buffer } from "./classic/buffer.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
19
  export { getParameters, setParameters, resetParameters } from "./context/parameters/unified-parameter-api.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["registerHeadlessGL","default","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","_checkFloat32ColorAttachment"],"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 {default as WebGLDevice} from './adapter/webgl-device';\nexport {default as WebGLCanvasContext} from './adapter/webgl-canvas-context';\n\n// WebGL Resource classes\nexport {default as WEBGLResource, default as WebGLResource} from './adapter/objects/webgl-resource';\nexport {default as WEBGLBuffer} from './adapter/resources/webgl-buffer';\nexport {default as WEBGLTexture} from './adapter/resources/webgl-texture';\n// export {default as WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';\nexport {default as WEBGLShader} from './adapter/resources/webgl-shader';\nexport {default as WEBGLSampler} from './adapter/resources/webgl-sampler';\nexport {default as WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';\n\nexport {default as WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';\n// export {default as WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';\nexport {default as WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';\nexport {default as WEBGLRenderPass} from './adapter/resources/webgl-render-pass';\n// export {default as WEBGLComputePass} from './adapter/resources/webgl-compute-pass';\n\n// non-api resources\nexport type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';\nexport {default as WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';\nexport {default as WEBGLVertexArrayObject} from './adapter/objects/webgl-vertex-array-object';\n\n// WebGL adapter classes (Legacy, will be moved to gltools)\nexport {default as Accessor} from './classic/accessor';\nexport type {AccessorObject} from './types';\nexport type {ClassicBufferProps, ClassicBufferProps as BufferProps} from './classic/buffer';\nexport {default as ClassicBuffer, default 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 './types/webgl';\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 {_checkFloat32ColorAttachment} from './adapter/converters/texture-formats';\n"],"mappings":"SASQA,kBAAkB;AAAA,SAGlBC,OAAO,IAAIC,WAAW;AAAA,SACtBD,OAAO,IAAIE,kBAAkB;AAAA,SAG7BF,OAAO,IAAIG,aAAa,EAAEH,OAAO,IAAII,aAAa;AAAA,SAClDJ,OAAO,IAAIK,WAAW;AAAA,SACtBL,OAAO,IAAIM,YAAY;AAAA,SAEvBN,OAAO,IAAIO,WAAW;AAAA,SACtBP,OAAO,IAAIQ,YAAY;AAAA,SACvBR,OAAO,IAAIS,gBAAgB;AAAA,SAE3BT,OAAO,IAAIU,mBAAmB;AAAA,SAE9BV,OAAO,IAAIW,mBAAmB;AAAA,SAC9BX,OAAO,IAAIY,eAAe;AAAA,SAK1BZ,OAAO,IAAIa,iBAAiB;AAAA,SAC5Bb,OAAO,IAAIc,sBAAsB;AAAA,SAGjCd,OAAO,IAAIe,QAAQ;AAAA,SAGnBf,OAAO,IAAIgB,aAAa,EAAEhB,OAAO,IAAIiB,MAAM;AAAA,SAGjDC,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,4BAA4B"}
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","_checkFloat32ColorAttachment"],"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 gltools)\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 './types/webgl';\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 {_checkFloat32ColorAttachment} from './adapter/converters/texture-formats';\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,4BAA4B"}