@luma.gl/webgl 9.0.0 → 9.0.3

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.
@@ -14,6 +14,7 @@ export declare class WebGLDeviceFeatures extends DeviceFeatures {
14
14
  [Symbol.iterator](): IterableIterator<DeviceFeature>;
15
15
  has(feature: DeviceFeature): boolean;
16
16
  initializeFeatures(): void;
17
+ getFeatures(): DeviceFeature[];
17
18
  /** Extract all WebGL features */
18
19
  protected getWebGLFeature(feature: DeviceFeature): boolean;
19
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-device-features.d.ts","sourceRoot":"","sources":["../../../src/adapter/device-helpers/webgl-device-features.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AA8BhD;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,SAAS,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACrC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC;IACnC,SAAS,CAAC,cAAc,qBAA4B;gBAGlD,EAAE,EAAE,sBAAsB,EAC1B,UAAU,EAAE,YAAY,EACxB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAU1D,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,aAAa,CAAC;IAc5C,GAAG,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAuB7C,kBAAkB;IAUlB,iCAAiC;IACjC,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;CAU3D"}
1
+ {"version":3,"file":"webgl-device-features.d.ts","sourceRoot":"","sources":["../../../src/adapter/device-helpers/webgl-device-features.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AA8BhD;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,SAAS,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACrC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC;IACnC,SAAS,CAAC,cAAc,qBAA4B;gBAGlD,EAAE,EAAE,sBAAsB,EAC1B,UAAU,EAAE,YAAY,EACxB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAU1D,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,aAAa,CAAC;IAU5C,GAAG,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAuB7C,kBAAkB;IAWlB,WAAW;IAIX,iCAAiC;IACjC,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;CAU3D"}
@@ -48,12 +48,8 @@ export class WebGLDeviceFeatures extends DeviceFeatures {
48
48
  getWebGLExtension(gl, 'EXT_color_buffer_float', extensions);
49
49
  }
50
50
  *[Symbol.iterator]() {
51
- for (const feature of Object.keys(WEBGL_FEATURES)) {
52
- if (this.has(feature)) {
53
- yield feature;
54
- }
55
- }
56
- for (const feature of Object.keys(TEXTURE_FEATURES)) {
51
+ const features = this.getFeatures();
52
+ for (const feature of features) {
57
53
  if (this.has(feature)) {
58
54
  yield feature;
59
55
  }
@@ -79,13 +75,17 @@ export class WebGLDeviceFeatures extends DeviceFeatures {
79
75
  }
80
76
  // FOR DEVICE
81
77
  initializeFeatures() {
82
- // @ts-expect-error
83
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
84
- for (const feature of this) {
85
- // WebGL extensions are initialized by requesting them
78
+ // Initialize all features by checking them.
79
+ // Except WEBGL_polygon_mode since Chrome logs ugly console warnings
80
+ const features = this.getFeatures().filter(feature => feature !== 'polygon-mode-webgl');
81
+ for (const feature of features) {
82
+ this.has(feature);
86
83
  }
87
84
  }
88
85
  // IMPLEMENTATION
86
+ getFeatures() {
87
+ return [...Object.keys(WEBGL_FEATURES), ...Object.keys(TEXTURE_FEATURES)];
88
+ }
89
89
  /** Extract all WebGL features */
90
90
  getWebGLFeature(feature) {
91
91
  const featureInfo = WEBGL_FEATURES[feature];
@@ -31,7 +31,9 @@ export declare class WEBGLRenderPipeline extends RenderPipeline {
31
31
  * Bindings include: textures, samplers and uniform buffers
32
32
  * @todo needed for portable model
33
33
  */
34
- setBindings(bindings: Record<string, Binding>): void;
34
+ setBindings(bindings: Record<string, Binding>, options?: {
35
+ disableWarnings?: boolean;
36
+ }): void;
35
37
  /** @todo needed for portable model
36
38
  * @note The WebGL API is offers many ways to draw things
37
39
  * This function unifies those ways into a single call using common parameters with sane defaults
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-render-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-render-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,mBAAmB,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC9E,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAsC,MAAM,eAAe,CAAC;AAUlF,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAK3C,OAAO,EAAC,sBAAsB,EAAC,sCAAmC;AAKlE,oCAAoC;AACpC,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,yDAAyD;IACzD,MAAM,EAAE,WAAW,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,YAAY,CAAC;IACrB,oBAAoB;IACpB,EAAE,EAAE,WAAW,CAAC;IAChB,sBAAsB;IACtB,EAAE,EAAE,WAAW,CAAC;IAChB,mEAAmE;IACn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AI;IAQxB;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAC,GAAG,IAAI;IAyD3F;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE;QACZ,UAAU,EAAE,UAAU,CAAC;QACvB,wBAAwB;QACxB,WAAW,EAAE,WAAW,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;KAC5C,GAAG,OAAO;IAgGF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;cAkBhD,YAAY;IA2B5B,wFAAwF;IACxF,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY;IAmB9D;;;;OAIG;IACH,cAAc,IAAI,SAAS,GAAG,SAAS,GAAG,YAAY;IAmBtD,6DAA6D;IACvD,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB3C;;;;OAIG;IACH,sBAAsB;IAatB,iDAAiD;IACjD,cAAc;IAyFd;;;OAGG;IACH,cAAc;CASf"}
@@ -77,7 +77,7 @@ export class WEBGLRenderPipeline extends RenderPipeline {
77
77
  * Bindings include: textures, samplers and uniform buffers
78
78
  * @todo needed for portable model
79
79
  */
80
- setBindings(bindings) {
80
+ setBindings(bindings, options) {
81
81
  // if (log.priority >= 2) {
82
82
  // checkUniformValues(uniforms, this.id, this._uniformSetters);
83
83
  // }
@@ -92,7 +92,9 @@ export class WEBGLRenderPipeline extends RenderPipeline {
92
92
  const validBindings = this.shaderLayout.bindings
93
93
  .map(binding => `"${binding.name}"`)
94
94
  .join(', ');
95
- log.warn(`Unknown binding "${name}" in render pipeline "${this.id}", expected one of ${validBindings}`)();
95
+ if (options?.disableWarnings) {
96
+ log.warn(`Unknown binding "${name}" in render pipeline "${this.id}", expected one of ${validBindings}`)();
97
+ }
96
98
  continue; // eslint-disable-line no-continue
97
99
  }
98
100
  if (!value) {
@@ -25,7 +25,6 @@ export declare class WEBGLVertexArray extends VertexArray {
25
25
  setBuffer(location: number, attributeBuffer: Buffer): void;
26
26
  /** Set a location in vertex attributes array to a constant value, disables the location */
27
27
  setConstantWebGL(location: number, value: TypedArray): void;
28
- init: boolean;
29
28
  bindBeforeRender(): void;
30
29
  unbindAfterRender(): void;
31
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-vertex-array.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-vertex-array.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAc,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,WAAW,EAA6B,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AAGtC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAO5C,gCAAgC;AAChC,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;IAED,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IAExC,kCAAkC;IAClC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,WAAW,CAAQ;IAE3B,6EAA6E;IAC7E,MAAM,CAAC,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;gBAKpD,MAAM,EAAE,WAAW,EA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CAAC,MAAM,EAAE,sBAAsB,CAAC;IAExC,kCAAkC;IAClC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,WAAW,CAAQ;IAE3B,6EAA6E;IAC7E,MAAM,CAAC,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;gBAKpD,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,gBAAgB;IAMhD,OAAO,IAAI,IAAI;IAexB;;;;;OAKG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAgBhD,gGAAgG;IAChG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;IAgC1D,2FAA2F;IAClF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;IAK3D,gBAAgB,IAAI,IAAI;IAKxB,iBAAiB,IAAI,IAAI;IAOlC;;;;;OAKG;IACH,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAU1C;;;OAGG;IAcH,gCAAgC;IAChC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;IAsBvC;;;;;OAKG;IACH,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,IAAI;IAiBxD;;;;;OAKG;IACH,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM;CA8BnE"}
@@ -54,11 +54,10 @@ export class WEBGLVertexArray extends VertexArray {
54
54
  }
55
55
  // In WebGL The GL.ELEMENT_ARRAY_BUFFER_BINDING is stored on the VertexArrayObject
56
56
  this.device.gl.bindVertexArray(this.handle);
57
- // TODO - this initial binding does not seem to take effect? see bindBeforeRender()
58
57
  this.device.gl.bindBuffer(34963, buffer ? buffer.handle : null);
59
- // log.log(1, 'VertexArray.setIndexBuffer', indexBuffer)();
60
- // log.log(1, `Binding vertex array ${this.id}`, buffer?.id)();
61
58
  this.indexBuffer = buffer;
59
+ // Unbind to prevent unintended changes to the VAO.
60
+ this.device.gl.bindVertexArray(null);
62
61
  }
63
62
  /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */
64
63
  setBuffer(location, attributeBuffer) {
@@ -84,30 +83,21 @@ export class WEBGLVertexArray extends VertexArray {
84
83
  // Set the step mode 0=vertex, 1=instance
85
84
  this.device.gl.vertexAttribDivisor(location, divisor || 0);
86
85
  this.attributes[location] = buffer;
86
+ // Unbind to prevent unintended changes to the VAO.
87
+ this.device.gl.bindVertexArray(null);
87
88
  }
88
89
  /** Set a location in vertex attributes array to a constant value, disables the location */
89
90
  setConstantWebGL(location, value) {
90
91
  this._enable(location, false);
91
92
  this.attributes[location] = value;
92
93
  }
93
- init = false;
94
94
  bindBeforeRender() {
95
95
  this.device.gl.bindVertexArray(this.handle);
96
- // TODO - the initial bind does not seem to take effect.
97
- if (!this.init) {
98
- // log.log(1, `Binding vertex array ${this.id}`, this.indexBuffer?.id)();
99
- const webglBuffer = this.indexBuffer;
100
- this.device.gl.bindBuffer(34963, webglBuffer?.handle || null);
101
- this.init = true;
102
- }
103
96
  this._applyConstantAttributes();
104
97
  }
105
98
  unbindAfterRender() {
106
- // log.log(1, `Unbinding vertex array ${this.id}`)();
107
- // TODO technically this is not necessary, but we might be interfacing
108
- // with code that does not use vertex array objects
99
+ // Unbind to prevent unintended changes to the VAO.
109
100
  this.device.gl.bindVertexArray(null);
110
- // this.device.gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, null);
111
101
  }
112
102
  // Internal methods
113
103
  /**
package/dist/dist.dev.js CHANGED
@@ -2060,12 +2060,8 @@ var __exports__ = (() => {
2060
2060
  getWebGLExtension(gl, "EXT_color_buffer_float", extensions);
2061
2061
  }
2062
2062
  *[Symbol.iterator]() {
2063
- for (const feature of Object.keys(WEBGL_FEATURES)) {
2064
- if (this.has(feature)) {
2065
- yield feature;
2066
- }
2067
- }
2068
- for (const feature of Object.keys(TEXTURE_FEATURES)) {
2063
+ const features = this.getFeatures();
2064
+ for (const feature of features) {
2069
2065
  if (this.has(feature)) {
2070
2066
  yield feature;
2071
2067
  }
@@ -2089,10 +2085,15 @@ var __exports__ = (() => {
2089
2085
  }
2090
2086
  // FOR DEVICE
2091
2087
  initializeFeatures() {
2092
- for (const feature of this) {
2088
+ const features = this.getFeatures().filter((feature) => feature !== "polygon-mode-webgl");
2089
+ for (const feature of features) {
2090
+ this.has(feature);
2093
2091
  }
2094
2092
  }
2095
2093
  // IMPLEMENTATION
2094
+ getFeatures() {
2095
+ return [...Object.keys(WEBGL_FEATURES), ...Object.keys(TEXTURE_FEATURES)];
2096
+ }
2096
2097
  /** Extract all WebGL features */
2097
2098
  getWebGLFeature(feature) {
2098
2099
  const featureInfo = WEBGL_FEATURES[feature];
@@ -3699,38 +3700,35 @@ var __exports__ = (() => {
3699
3700
  // src/context/debug/webgl-developer-tools.ts
3700
3701
  var import_core13 = __toESM(require_core(), 1);
3701
3702
 
3703
+ // ../../node_modules/@probe.gl/env/dist/lib/globals.js
3704
+ var document_ = globalThis.document || {};
3705
+ var process_ = globalThis.process || {};
3706
+ var console_ = globalThis.console;
3707
+ var navigator_ = globalThis.navigator || {};
3708
+
3702
3709
  // ../../node_modules/@probe.gl/env/dist/lib/is-electron.js
3703
3710
  function isElectron(mockUserAgent) {
3704
- if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
3711
+ if (typeof window !== "undefined" && window.process?.type === "renderer") {
3705
3712
  return true;
3706
3713
  }
3707
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
3714
+ if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
3708
3715
  return true;
3709
3716
  }
3710
- const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
3717
+ const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
3711
3718
  const userAgent = mockUserAgent || realUserAgent;
3712
- if (userAgent && userAgent.indexOf("Electron") >= 0) {
3713
- return true;
3714
- }
3715
- return false;
3719
+ return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
3716
3720
  }
3717
3721
 
3718
3722
  // ../../node_modules/@probe.gl/env/dist/lib/is-browser.js
3719
3723
  function isBrowser() {
3720
- const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
3724
+ const isNode = (
3725
+ // @ts-expect-error
3726
+ typeof process === "object" && String(process) === "[object process]" && !process?.browser
3727
+ );
3721
3728
  return !isNode || isElectron();
3722
3729
  }
3723
3730
 
3724
- // ../../node_modules/@probe.gl/env/dist/lib/globals.js
3725
- var self_ = globalThis.self || globalThis.window || globalThis.global;
3726
- var window_ = globalThis.window || globalThis.self || globalThis.global;
3727
- var document_ = globalThis.document || {};
3728
- var process_ = globalThis.process || {};
3729
- var console_ = globalThis.console;
3730
- var navigator_ = globalThis.navigator || {};
3731
-
3732
3731
  // ../../node_modules/@probe.gl/env/dist/lib/get-browser.js
3733
- var window2 = globalThis;
3734
3732
  function getBrowser(mockUserAgent) {
3735
3733
  if (!mockUserAgent && !isBrowser()) {
3736
3734
  return "Node";
@@ -3742,18 +3740,13 @@ var __exports__ = (() => {
3742
3740
  if (userAgent.indexOf("Edge") > -1) {
3743
3741
  return "Edge";
3744
3742
  }
3745
- const isMSIE = userAgent.indexOf("MSIE ") !== -1;
3746
- const isTrident = userAgent.indexOf("Trident/") !== -1;
3747
- if (isMSIE || isTrident) {
3748
- return "IE";
3749
- }
3750
- if (window2.chrome) {
3743
+ if (globalThis.chrome) {
3751
3744
  return "Chrome";
3752
3745
  }
3753
- if (window2.safari) {
3746
+ if (globalThis.safari) {
3754
3747
  return "Safari";
3755
3748
  }
3756
- if (window2.mozInnerScreenX) {
3749
+ if (globalThis.mozInnerScreenX) {
3757
3750
  return "Firefox";
3758
3751
  }
3759
3752
  return "Unknown";
@@ -4797,14 +4790,16 @@ ${source2}`;
4797
4790
  * Bindings include: textures, samplers and uniform buffers
4798
4791
  * @todo needed for portable model
4799
4792
  */
4800
- setBindings(bindings) {
4793
+ setBindings(bindings, options) {
4801
4794
  for (const [name, value] of Object.entries(bindings)) {
4802
4795
  const binding = this.shaderLayout.bindings.find((binding2) => binding2.name === name) || this.shaderLayout.bindings.find((binding2) => binding2.name === `${name}Uniforms`);
4803
4796
  if (!binding) {
4804
4797
  const validBindings = this.shaderLayout.bindings.map((binding2) => `"${binding2.name}"`).join(", ");
4805
- import_core17.log.warn(
4806
- `Unknown binding "${name}" in render pipeline "${this.id}", expected one of ${validBindings}`
4807
- )();
4798
+ if (options?.disableWarnings) {
4799
+ import_core17.log.warn(
4800
+ `Unknown binding "${name}" in render pipeline "${this.id}", expected one of ${validBindings}`
4801
+ )();
4802
+ }
4808
4803
  continue;
4809
4804
  }
4810
4805
  if (!value) {
@@ -5358,8 +5353,8 @@ ${source2}`;
5358
5353
  /**
5359
5354
  // Set (bind/unbind) an elements buffer, for indexed rendering.
5360
5355
  // Must be a Buffer bound to GL.ELEMENT_ARRAY_BUFFER or null. Constants not supported
5361
- *
5362
- * @param elementBuffer
5356
+ *
5357
+ * @param elementBuffer
5363
5358
  */
5364
5359
  setIndexBuffer(indexBuffer) {
5365
5360
  const buffer = indexBuffer;
@@ -5369,6 +5364,7 @@ ${source2}`;
5369
5364
  this.device.gl.bindVertexArray(this.handle);
5370
5365
  this.device.gl.bindBuffer(34963 /* ELEMENT_ARRAY_BUFFER */, buffer ? buffer.handle : null);
5371
5366
  this.indexBuffer = buffer;
5367
+ this.device.gl.bindVertexArray(null);
5372
5368
  }
5373
5369
  /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */
5374
5370
  setBuffer(location, attributeBuffer) {
@@ -5387,20 +5383,15 @@ ${source2}`;
5387
5383
  this.device.gl.enableVertexAttribArray(location);
5388
5384
  this.device.gl.vertexAttribDivisor(location, divisor || 0);
5389
5385
  this.attributes[location] = buffer;
5386
+ this.device.gl.bindVertexArray(null);
5390
5387
  }
5391
5388
  /** Set a location in vertex attributes array to a constant value, disables the location */
5392
5389
  setConstantWebGL(location, value) {
5393
5390
  this._enable(location, false);
5394
5391
  this.attributes[location] = value;
5395
5392
  }
5396
- init = false;
5397
5393
  bindBeforeRender() {
5398
5394
  this.device.gl.bindVertexArray(this.handle);
5399
- if (!this.init) {
5400
- const webglBuffer = this.indexBuffer;
5401
- this.device.gl.bindBuffer(34963 /* ELEMENT_ARRAY_BUFFER */, webglBuffer?.handle || null);
5402
- this.init = true;
5403
- }
5404
5395
  this._applyConstantAttributes();
5405
5396
  }
5406
5397
  unbindAfterRender() {