@luma.gl/webgl 9.3.2 → 9.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2461,14 +2461,16 @@ var init_webgl_framebuffer = __esm({
2461
2461
  this.handle = this.props.handle || isDefaultFramebuffer ? this.props.handle : this.gl.createFramebuffer();
2462
2462
  if (!isDefaultFramebuffer) {
2463
2463
  device._setWebGLDebugMetadata(this.handle, this, { spector: this.props });
2464
- this.autoCreateAttachmentTextures();
2465
- this.updateAttachments();
2464
+ if (!props.handle) {
2465
+ this.autoCreateAttachmentTextures();
2466
+ this.updateAttachments();
2467
+ }
2466
2468
  }
2467
2469
  }
2468
2470
  /** destroys any auto created resources etc. */
2469
2471
  destroy() {
2470
2472
  super.destroy();
2471
- if (!this.destroyed && this.handle !== null) {
2473
+ if (!this.destroyed && this.handle !== null && !this.props.handle) {
2472
2474
  this.gl.deleteFramebuffer(this.handle);
2473
2475
  }
2474
2476
  }
@@ -4996,7 +4998,7 @@ var init_webgl_render_pass = __esm({
4996
4998
  }
4997
4999
  let viewport;
4998
5000
  if (!((_a = props == null ? void 0 : props.parameters) == null ? void 0 : _a.viewport)) {
4999
- if (!isDefaultFramebuffer) {
5001
+ if (!isDefaultFramebuffer && webglFramebuffer) {
5000
5002
  const { width, height } = webglFramebuffer;
5001
5003
  viewport = [0, 0, width, height];
5002
5004
  } else {
@@ -5006,10 +5008,10 @@ var init_webgl_render_pass = __esm({
5006
5008
  }
5007
5009
  this.device.pushState();
5008
5010
  this.setParameters({ viewport, ...this.props.parameters });
5009
- if (!isDefaultFramebuffer) {
5011
+ if (!isDefaultFramebuffer && (webglFramebuffer == null ? void 0 : webglFramebuffer.colorAttachments.length)) {
5010
5012
  const drawBuffers = webglFramebuffer.colorAttachments.map((_, i) => 36064 + i);
5011
5013
  this.device.gl.drawBuffers(drawBuffers);
5012
- } else {
5014
+ } else if (isDefaultFramebuffer) {
5013
5015
  this.device.gl.drawBuffers([1029]);
5014
5016
  }
5015
5017
  this.clear();