@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.
- package/dist/adapter/resources/webgl-framebuffer.d.ts +1 -2
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +27 -31
- package/dist/dist.dev.js +27 -28
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +22 -22
- package/dist/index.cjs.map +2 -2
- package/package.json +3 -3
- package/src/adapter/resources/webgl-framebuffer.ts +37 -42
package/dist/index.cjs
CHANGED
|
@@ -2560,24 +2560,7 @@ var WEBGLFramebuffer = class extends import_core9.Framebuffer {
|
|
|
2560
2560
|
if (!isDefaultFramebuffer) {
|
|
2561
2561
|
device.setSpectorMetadata(this.handle, { id: this.props.id, props: this.props });
|
|
2562
2562
|
this.autoCreateAttachmentTextures();
|
|
2563
|
-
|
|
2564
|
-
for (let i = 0; i < this.colorAttachments.length; ++i) {
|
|
2565
|
-
const attachment = this.colorAttachments[i];
|
|
2566
|
-
const attachmentPoint = 36064 + i;
|
|
2567
|
-
if (attachment) {
|
|
2568
|
-
this._attachTexture(attachmentPoint, attachment);
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
if (this.depthStencilAttachment) {
|
|
2572
|
-
this._attachTexture(getDepthStencilAttachmentWebGL(this.depthStencilAttachment.props.format), this.depthStencilAttachment);
|
|
2573
|
-
}
|
|
2574
|
-
if (props.check !== false) {
|
|
2575
|
-
const status = this.gl.checkFramebufferStatus(36160);
|
|
2576
|
-
if (status !== 36053) {
|
|
2577
|
-
throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
this.gl.bindFramebuffer(36160, prevHandle);
|
|
2563
|
+
this.updateAttachments();
|
|
2581
2564
|
}
|
|
2582
2565
|
}
|
|
2583
2566
|
/** destroys any auto created resources etc. */
|
|
@@ -2587,6 +2570,27 @@ var WEBGLFramebuffer = class extends import_core9.Framebuffer {
|
|
|
2587
2570
|
this.gl.deleteFramebuffer(this.handle);
|
|
2588
2571
|
}
|
|
2589
2572
|
}
|
|
2573
|
+
updateAttachments() {
|
|
2574
|
+
const prevHandle = this.gl.bindFramebuffer(36160, this.handle);
|
|
2575
|
+
for (let i = 0; i < this.colorAttachments.length; ++i) {
|
|
2576
|
+
const attachment = this.colorAttachments[i];
|
|
2577
|
+
if (attachment) {
|
|
2578
|
+
const attachmentPoint = 36064 + i;
|
|
2579
|
+
this._attachTextureView(attachmentPoint, attachment);
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
if (this.depthStencilAttachment) {
|
|
2583
|
+
const attachmentPoint = getDepthStencilAttachmentWebGL(this.depthStencilAttachment.props.format);
|
|
2584
|
+
this._attachTextureView(attachmentPoint, this.depthStencilAttachment);
|
|
2585
|
+
}
|
|
2586
|
+
if (this.props.check !== false) {
|
|
2587
|
+
const status = this.gl.checkFramebufferStatus(36160);
|
|
2588
|
+
if (status !== 36053) {
|
|
2589
|
+
throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
this.gl.bindFramebuffer(36160, prevHandle);
|
|
2593
|
+
}
|
|
2590
2594
|
// PRIVATE
|
|
2591
2595
|
/** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */
|
|
2592
2596
|
createDepthStencilTexture(format) {
|
|
@@ -2628,10 +2632,6 @@ var WEBGLFramebuffer = class extends import_core9.Framebuffer {
|
|
|
2628
2632
|
return this;
|
|
2629
2633
|
}
|
|
2630
2634
|
*/
|
|
2631
|
-
/** Attach one attachment */
|
|
2632
|
-
_attachTexture(attachmentPoint, textureView) {
|
|
2633
|
-
this._attachTextureView(attachmentPoint, textureView);
|
|
2634
|
-
}
|
|
2635
2635
|
/**
|
|
2636
2636
|
* @param attachment
|
|
2637
2637
|
* @param texture
|