@luma.gl/webgl 9.1.0-alpha.12 → 9.1.0-alpha.14
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 +31 -32
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +57 -61
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +1 -0
- package/dist/adapter/webgl-device.d.ts +2 -1
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +1 -2
- package/dist/dist.dev.js +29 -60
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +24 -54
- package/dist/index.cjs.map +2 -2
- package/package.json +3 -3
- package/src/adapter/resources/webgl-framebuffer.ts +68 -73
- package/src/adapter/resources/webgl-texture.ts +2 -0
- package/src/adapter/webgl-device.ts +1 -2
package/dist/index.cjs
CHANGED
|
@@ -2136,6 +2136,7 @@ var WEBGLTexture = class extends import_core8.Texture {
|
|
|
2136
2136
|
/** For automatically updating video */
|
|
2137
2137
|
_video = null;
|
|
2138
2138
|
constructor(device, props) {
|
|
2139
|
+
props = import_core8.Texture._fixProps(props);
|
|
2139
2140
|
super(device, { ...import_core8.Texture.defaultProps, ...props, data: void 0 });
|
|
2140
2141
|
this.device = device;
|
|
2141
2142
|
this.gl = this.device.gl;
|
|
@@ -2560,24 +2561,7 @@ var WEBGLFramebuffer = class extends import_core9.Framebuffer {
|
|
|
2560
2561
|
if (!isDefaultFramebuffer) {
|
|
2561
2562
|
device.setSpectorMetadata(this.handle, { id: this.props.id, props: this.props });
|
|
2562
2563
|
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);
|
|
2564
|
+
this.updateAttachments();
|
|
2581
2565
|
}
|
|
2582
2566
|
}
|
|
2583
2567
|
/** destroys any auto created resources etc. */
|
|
@@ -2587,6 +2571,27 @@ var WEBGLFramebuffer = class extends import_core9.Framebuffer {
|
|
|
2587
2571
|
this.gl.deleteFramebuffer(this.handle);
|
|
2588
2572
|
}
|
|
2589
2573
|
}
|
|
2574
|
+
updateAttachments() {
|
|
2575
|
+
const prevHandle = this.gl.bindFramebuffer(36160, this.handle);
|
|
2576
|
+
for (let i = 0; i < this.colorAttachments.length; ++i) {
|
|
2577
|
+
const attachment = this.colorAttachments[i];
|
|
2578
|
+
if (attachment) {
|
|
2579
|
+
const attachmentPoint = 36064 + i;
|
|
2580
|
+
this._attachTextureView(attachmentPoint, attachment);
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
if (this.depthStencilAttachment) {
|
|
2584
|
+
const attachmentPoint = getDepthStencilAttachmentWebGL(this.depthStencilAttachment.props.format);
|
|
2585
|
+
this._attachTextureView(attachmentPoint, this.depthStencilAttachment);
|
|
2586
|
+
}
|
|
2587
|
+
if (this.props.check !== false) {
|
|
2588
|
+
const status = this.gl.checkFramebufferStatus(36160);
|
|
2589
|
+
if (status !== 36053) {
|
|
2590
|
+
throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
this.gl.bindFramebuffer(36160, prevHandle);
|
|
2594
|
+
}
|
|
2590
2595
|
// PRIVATE
|
|
2591
2596
|
/** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */
|
|
2592
2597
|
createDepthStencilTexture(format) {
|
|
@@ -2598,40 +2603,6 @@ var WEBGLFramebuffer = class extends import_core9.Framebuffer {
|
|
|
2598
2603
|
mipmaps: false
|
|
2599
2604
|
});
|
|
2600
2605
|
}
|
|
2601
|
-
/**
|
|
2602
|
-
* Attachment resize is expected to be a noop if size is same
|
|
2603
|
-
*
|
|
2604
|
-
protected override resizeAttachments(width: number, height: number): this {
|
|
2605
|
-
// for default framebuffer, just update the stored size
|
|
2606
|
-
if (this.handle === null) {
|
|
2607
|
-
// assert(width === undefined && height === undefined);
|
|
2608
|
-
this.width = this.gl.drawingBufferWidth;
|
|
2609
|
-
this.height = this.gl.drawingBufferHeight;
|
|
2610
|
-
return this;
|
|
2611
|
-
}
|
|
2612
|
-
|
|
2613
|
-
if (width === undefined) {
|
|
2614
|
-
width = this.gl.drawingBufferWidth;
|
|
2615
|
-
}
|
|
2616
|
-
if (height === undefined) {
|
|
2617
|
-
height = this.gl.drawingBufferHeight;
|
|
2618
|
-
}
|
|
2619
|
-
|
|
2620
|
-
// TODO Not clear that this is better than default destroy/create implementation
|
|
2621
|
-
|
|
2622
|
-
for (const colorAttachment of this.colorAttachments) {
|
|
2623
|
-
colorAttachment.texture.clone({width, height});
|
|
2624
|
-
}
|
|
2625
|
-
if (this.depthStencilAttachment) {
|
|
2626
|
-
this.depthStencilAttachment.texture.resize({width, height});
|
|
2627
|
-
}
|
|
2628
|
-
return this;
|
|
2629
|
-
}
|
|
2630
|
-
*/
|
|
2631
|
-
/** Attach one attachment */
|
|
2632
|
-
_attachTexture(attachmentPoint, textureView) {
|
|
2633
|
-
this._attachTextureView(attachmentPoint, textureView);
|
|
2634
|
-
}
|
|
2635
2606
|
/**
|
|
2636
2607
|
* @param attachment
|
|
2637
2608
|
* @param texture
|
|
@@ -4963,8 +4934,7 @@ var WebGLDevice = class extends import_core23.Device {
|
|
|
4963
4934
|
const newProps = this._getBufferProps(props);
|
|
4964
4935
|
return new WEBGLBuffer(this, newProps);
|
|
4965
4936
|
}
|
|
4966
|
-
|
|
4967
|
-
_createTexture(props) {
|
|
4937
|
+
createTexture(props) {
|
|
4968
4938
|
return new WEBGLTexture(this, props);
|
|
4969
4939
|
}
|
|
4970
4940
|
createExternalTexture(props) {
|