@luma.gl/webgl 9.1.0-alpha.12 → 9.1.0-alpha.13

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.
@@ -15,6 +15,7 @@ export declare class WEBGLFramebuffer extends Framebuffer {
15
15
  constructor(device: WebGLDevice, props: FramebufferProps);
16
16
  /** destroys any auto created resources etc. */
17
17
  destroy(): void;
18
+ protected updateAttachments(): void;
18
19
  /** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */
19
20
  protected createDepthStencilTexture(format: TextureFormat): Texture;
20
21
  /**
@@ -47,8 +48,6 @@ export declare class WEBGLFramebuffer extends Framebuffer {
47
48
  return this;
48
49
  }
49
50
  */
50
- /** Attach one attachment */
51
- protected _attachTexture(attachmentPoint: GL, textureView: WEBGLTextureView): void;
52
51
  /**
53
52
  * @param attachment
54
53
  * @param texture
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAC7C,OAAO,EAAC,gBAAgB,EAAC,gCAA6B;AAGtD,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAEzD,iDAAiD;AACjD,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,EAAE,WAAW,CAAC;IACpB,EAAE,EAAE,sBAAsB,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IAEzB,gBAAgB,EAAE,gBAAgB,EAAE,CAAM;IAC1C,sBAAsB,EAAE,gB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IAAI;IAQxB,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAsCnC,mGAAmG;cAChF,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAW5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6BE;IAEF;;;;;OAKG;IACH,SAAS,CAAC,kBAAkB,CAAC,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,gBAAgB,GAAG,IAAI;CA8BlF"}
@@ -25,29 +25,7 @@ export class WEBGLFramebuffer extends Framebuffer {
25
25
  device.setSpectorMetadata(this.handle, { id: this.props.id, props: this.props });
26
26
  // Auto create textures for attachments if needed
27
27
  this.autoCreateAttachmentTextures();
28
- /** Attach from a map of attachments */
29
- // @ts-expect-error native bindFramebuffer is overridden by our state tracker
30
- const prevHandle = this.gl.bindFramebuffer(36160, this.handle);
31
- // Walk the attachments
32
- for (let i = 0; i < this.colorAttachments.length; ++i) {
33
- const attachment = this.colorAttachments[i];
34
- const attachmentPoint = 36064 + i;
35
- if (attachment) {
36
- this._attachTexture(attachmentPoint, attachment);
37
- }
38
- }
39
- if (this.depthStencilAttachment) {
40
- this._attachTexture(getDepthStencilAttachmentWebGL(this.depthStencilAttachment.props.format), this.depthStencilAttachment);
41
- }
42
- /** Check the status */
43
- // @ts-expect-error
44
- if (props.check !== false) {
45
- const status = this.gl.checkFramebufferStatus(36160);
46
- if (status !== 36053) {
47
- throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);
48
- }
49
- }
50
- this.gl.bindFramebuffer(36160, prevHandle);
28
+ this.updateAttachments();
51
29
  }
52
30
  }
53
31
  /** destroys any auto created resources etc. */
@@ -58,6 +36,32 @@ export class WEBGLFramebuffer extends Framebuffer {
58
36
  // this.handle = null;
59
37
  }
60
38
  }
39
+ updateAttachments() {
40
+ /** Attach from a map of attachments */
41
+ // @ts-expect-error native bindFramebuffer is overridden by our state tracker
42
+ const prevHandle = this.gl.bindFramebuffer(36160, this.handle);
43
+ // Walk the attachments
44
+ for (let i = 0; i < this.colorAttachments.length; ++i) {
45
+ const attachment = this.colorAttachments[i];
46
+ if (attachment) {
47
+ const attachmentPoint = 36064 + i;
48
+ this._attachTextureView(attachmentPoint, attachment);
49
+ }
50
+ }
51
+ if (this.depthStencilAttachment) {
52
+ const attachmentPoint = getDepthStencilAttachmentWebGL(this.depthStencilAttachment.props.format);
53
+ this._attachTextureView(attachmentPoint, this.depthStencilAttachment);
54
+ }
55
+ /** Check the status */
56
+ // @ts-expect-error
57
+ if (this.props.check !== false) {
58
+ const status = this.gl.checkFramebufferStatus(36160);
59
+ if (status !== 36053) {
60
+ throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);
61
+ }
62
+ }
63
+ this.gl.bindFramebuffer(36160, prevHandle);
64
+ }
61
65
  // PRIVATE
62
66
  /** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */
63
67
  createDepthStencilTexture(format) {
@@ -100,14 +104,6 @@ export class WEBGLFramebuffer extends Framebuffer {
100
104
  return this;
101
105
  }
102
106
  */
103
- /** Attach one attachment */
104
- _attachTexture(attachmentPoint, textureView) {
105
- // if (attachment instanceof WEBGLRenderbuffer) {
106
- // this._attachWEBGLRenderbuffer(attachmentPoint, attachment);
107
- // return attachment;
108
- // }
109
- this._attachTextureView(attachmentPoint, textureView);
110
- }
111
107
  /**
112
108
  * @param attachment
113
109
  * @param texture
package/dist/dist.dev.js CHANGED
@@ -3327,30 +3327,7 @@ var __exports__ = (() => {
3327
3327
  if (!isDefaultFramebuffer) {
3328
3328
  device.setSpectorMetadata(this.handle, { id: this.props.id, props: this.props });
3329
3329
  this.autoCreateAttachmentTextures();
3330
- const prevHandle = this.gl.bindFramebuffer(
3331
- 36160 /* FRAMEBUFFER */,
3332
- this.handle
3333
- );
3334
- for (let i = 0; i < this.colorAttachments.length; ++i) {
3335
- const attachment = this.colorAttachments[i];
3336
- const attachmentPoint = 36064 /* COLOR_ATTACHMENT0 */ + i;
3337
- if (attachment) {
3338
- this._attachTexture(attachmentPoint, attachment);
3339
- }
3340
- }
3341
- if (this.depthStencilAttachment) {
3342
- this._attachTexture(
3343
- getDepthStencilAttachmentWebGL(this.depthStencilAttachment.props.format),
3344
- this.depthStencilAttachment
3345
- );
3346
- }
3347
- if (props.check !== false) {
3348
- const status = this.gl.checkFramebufferStatus(36160 /* FRAMEBUFFER */);
3349
- if (status !== 36053 /* FRAMEBUFFER_COMPLETE */) {
3350
- throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);
3351
- }
3352
- }
3353
- this.gl.bindFramebuffer(36160 /* FRAMEBUFFER */, prevHandle);
3330
+ this.updateAttachments();
3354
3331
  }
3355
3332
  }
3356
3333
  /** destroys any auto created resources etc. */
@@ -3360,6 +3337,32 @@ var __exports__ = (() => {
3360
3337
  this.gl.deleteFramebuffer(this.handle);
3361
3338
  }
3362
3339
  }
3340
+ updateAttachments() {
3341
+ const prevHandle = this.gl.bindFramebuffer(
3342
+ 36160 /* FRAMEBUFFER */,
3343
+ this.handle
3344
+ );
3345
+ for (let i = 0; i < this.colorAttachments.length; ++i) {
3346
+ const attachment = this.colorAttachments[i];
3347
+ if (attachment) {
3348
+ const attachmentPoint = 36064 /* COLOR_ATTACHMENT0 */ + i;
3349
+ this._attachTextureView(attachmentPoint, attachment);
3350
+ }
3351
+ }
3352
+ if (this.depthStencilAttachment) {
3353
+ const attachmentPoint = getDepthStencilAttachmentWebGL(
3354
+ this.depthStencilAttachment.props.format
3355
+ );
3356
+ this._attachTextureView(attachmentPoint, this.depthStencilAttachment);
3357
+ }
3358
+ if (this.props.check !== false) {
3359
+ const status = this.gl.checkFramebufferStatus(36160 /* FRAMEBUFFER */);
3360
+ if (status !== 36053 /* FRAMEBUFFER_COMPLETE */) {
3361
+ throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);
3362
+ }
3363
+ }
3364
+ this.gl.bindFramebuffer(36160 /* FRAMEBUFFER */, prevHandle);
3365
+ }
3363
3366
  // PRIVATE
3364
3367
  /** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */
3365
3368
  createDepthStencilTexture(format) {
@@ -3401,10 +3404,6 @@ var __exports__ = (() => {
3401
3404
  return this;
3402
3405
  }
3403
3406
  */
3404
- /** Attach one attachment */
3405
- _attachTexture(attachmentPoint, textureView) {
3406
- this._attachTextureView(attachmentPoint, textureView);
3407
- }
3408
3407
  /**
3409
3408
  * @param attachment
3410
3409
  * @param texture