@luma.gl/webgl 9.1.0-alpha.13 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/webgl",
3
- "version": "9.1.0-alpha.13",
3
+ "version": "9.1.0-alpha.14",
4
4
  "description": "WebGL2 adapter for the luma.gl core API",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,9 +43,9 @@
43
43
  "@luma.gl/core": "9.1.0-alpha.10"
44
44
  },
45
45
  "dependencies": {
46
- "@luma.gl/constants": "9.1.0-alpha.13",
46
+ "@luma.gl/constants": "9.1.0-alpha.14",
47
47
  "@math.gl/types": "4.1.0-alpha.3",
48
48
  "@probe.gl/env": "^4.0.8"
49
49
  },
50
- "gitHead": "c2c641d67a5aec97467de13b0e3d8f9307ba03c2"
50
+ "gitHead": "e6e014efa323dbcd7d3774e982e442b1bf2c93be"
51
51
  }
@@ -102,37 +102,6 @@ export class WEBGLFramebuffer extends Framebuffer {
102
102
  });
103
103
  }
104
104
 
105
- /**
106
- * Attachment resize is expected to be a noop if size is same
107
- *
108
- protected override resizeAttachments(width: number, height: number): this {
109
- // for default framebuffer, just update the stored size
110
- if (this.handle === null) {
111
- // assert(width === undefined && height === undefined);
112
- this.width = this.gl.drawingBufferWidth;
113
- this.height = this.gl.drawingBufferHeight;
114
- return this;
115
- }
116
-
117
- if (width === undefined) {
118
- width = this.gl.drawingBufferWidth;
119
- }
120
- if (height === undefined) {
121
- height = this.gl.drawingBufferHeight;
122
- }
123
-
124
- // TODO Not clear that this is better than default destroy/create implementation
125
-
126
- for (const colorAttachment of this.colorAttachments) {
127
- colorAttachment.texture.clone({width, height});
128
- }
129
- if (this.depthStencilAttachment) {
130
- this.depthStencilAttachment.texture.resize({width, height});
131
- }
132
- return this;
133
- }
134
- */
135
-
136
105
  /**
137
106
  * @param attachment
138
107
  * @param texture
@@ -205,3 +174,34 @@ function _getFrameBufferStatus(status: GL) {
205
174
  return `${status}`;
206
175
  }
207
176
  }
177
+
178
+ /**
179
+ * Attachment resize is expected to be a noop if size is same
180
+ *
181
+ protected override resizeAttachments(width: number, height: number): this {
182
+ // for default framebuffer, just update the stored size
183
+ if (this.handle === null) {
184
+ // assert(width === undefined && height === undefined);
185
+ this.width = this.gl.drawingBufferWidth;
186
+ this.height = this.gl.drawingBufferHeight;
187
+ return this;
188
+ }
189
+
190
+ if (width === undefined) {
191
+ width = this.gl.drawingBufferWidth;
192
+ }
193
+ if (height === undefined) {
194
+ height = this.gl.drawingBufferHeight;
195
+ }
196
+
197
+ // TODO Not clear that this is better than default destroy/create implementation
198
+
199
+ for (const colorAttachment of this.colorAttachments) {
200
+ colorAttachment.texture.clone({width, height});
201
+ }
202
+ if (this.depthStencilAttachment) {
203
+ this.depthStencilAttachment.texture.resize({width, height});
204
+ }
205
+ return this;
206
+ }
207
+ */
@@ -143,6 +143,8 @@ export class WEBGLTexture extends Texture {
143
143
  } | null = null;
144
144
 
145
145
  constructor(device: Device, props: TextureProps) {
146
+ props = Texture._fixProps(props);
147
+
146
148
  // Note: Clear out `props.data` so that we don't hold a reference to any big memory chunks
147
149
  super(device, {...Texture.defaultProps, ...props, data: undefined!});
148
150
 
@@ -216,8 +216,7 @@ export class WebGLDevice extends Device {
216
216
  return new WEBGLBuffer(this, newProps);
217
217
  }
218
218
 
219
- // _createTexture(props: TextureProps): WEBGLTexture {
220
- _createTexture(props: TextureProps): Texture {
219
+ createTexture(props: TextureProps): WEBGLTexture {
221
220
  return new WEBGLTexture(this, props);
222
221
  }
223
222