@luma.gl/webgl 9.0.0-alpha.40 → 9.0.0-alpha.42

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.0.0-alpha.40",
3
+ "version": "9.0.0-alpha.42",
4
4
  "description": "WebGL2 adapter for the luma.gl API",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,12 +44,12 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@babel/runtime": "^7.0.0",
47
- "@luma.gl/constants": "9.0.0-alpha.40",
48
- "@luma.gl/core": "9.0.0-alpha.40",
47
+ "@luma.gl/constants": "9.0.0-alpha.42",
48
+ "@luma.gl/core": "9.0.0-alpha.42",
49
49
  "@probe.gl/env": "^4.0.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@luma.gl/test-utils": "9.0.0-alpha.40"
52
+ "@luma.gl/test-utils": "9.0.0-alpha.42"
53
53
  },
54
- "gitHead": "5a6f2bc7a4d24a65b74ae905844ad5bfc36c5645"
54
+ "gitHead": "61f38eaaa9cc42fa08d1c00690e370fa85681e30"
55
55
  }
@@ -133,11 +133,16 @@ export class WEBGLRenderPipeline extends RenderPipeline {
133
133
  for (const [name, value] of Object.entries(bindings)) {
134
134
  const binding = this.shaderLayout.bindings.find(binding => binding.name === name);
135
135
  if (!binding) {
136
- log.warn(`Unknown binding ${name} in render pipeline ${this.id}`)();
136
+ const validBindings = this.shaderLayout.bindings
137
+ .map(binding => `"${binding.name}"`)
138
+ .join(', ');
139
+ log.warn(
140
+ `Unknown binding "${name}" in render pipeline "${this.id}", expected one of ${validBindings}`
141
+ )();
137
142
  continue; // eslint-disable-line no-continue
138
143
  }
139
144
  if (!value) {
140
- log.warn(`Unsetting binding ${name} in render pipeline ${this.id}`)();
145
+ log.warn(`Unsetting binding "${name}" in render pipeline "${this.id}"`)();
141
146
  }
142
147
  switch (binding.type) {
143
148
  case 'uniform':
@@ -251,35 +256,40 @@ export class WEBGLRenderPipeline extends RenderPipeline {
251
256
  // }
252
257
  // });
253
258
 
254
- withDeviceAndGLParameters(this.device, this.props.parameters, webglRenderPass.glParameters, () => {
255
- if (isIndexed && isInstanced) {
256
- // ANGLE_instanced_arrays extension
257
- this.device.gl2?.drawElementsInstanced(
258
- glDrawMode,
259
- vertexCount || 0, // indexCount?
260
- glIndexType,
261
- firstVertex,
262
- instanceCount || 0
263
- );
264
- // } else if (isIndexed && this.device.isWebGL2 && !isNaN(start) && !isNaN(end)) {
265
- // this.device.gl2.drawRangeElements(glDrawMode, start, end, vertexCount, glIndexType, offset);
266
- } else if (isIndexed) {
267
- this.device.gl.drawElements(glDrawMode, vertexCount || 0, glIndexType, firstVertex); // indexCount?
268
- } else if (isInstanced) {
269
- this.device.gl2?.drawArraysInstanced(
270
- glDrawMode,
271
- firstVertex,
272
- vertexCount || 0,
273
- instanceCount || 0
274
- );
275
- } else {
276
- this.device.gl.drawArrays(glDrawMode, firstVertex, vertexCount || 0);
277
- }
278
-
279
- if (transformFeedback) {
280
- transformFeedback.end();
259
+ withDeviceAndGLParameters(
260
+ this.device,
261
+ this.props.parameters,
262
+ webglRenderPass.glParameters,
263
+ () => {
264
+ if (isIndexed && isInstanced) {
265
+ // ANGLE_instanced_arrays extension
266
+ this.device.gl2?.drawElementsInstanced(
267
+ glDrawMode,
268
+ vertexCount || 0, // indexCount?
269
+ glIndexType,
270
+ firstVertex,
271
+ instanceCount || 0
272
+ );
273
+ // } else if (isIndexed && this.device.isWebGL2 && !isNaN(start) && !isNaN(end)) {
274
+ // this.device.gl2.drawRangeElements(glDrawMode, start, end, vertexCount, glIndexType, offset);
275
+ } else if (isIndexed) {
276
+ this.device.gl.drawElements(glDrawMode, vertexCount || 0, glIndexType, firstVertex); // indexCount?
277
+ } else if (isInstanced) {
278
+ this.device.gl2?.drawArraysInstanced(
279
+ glDrawMode,
280
+ firstVertex,
281
+ vertexCount || 0,
282
+ instanceCount || 0
283
+ );
284
+ } else {
285
+ this.device.gl.drawArrays(glDrawMode, firstVertex, vertexCount || 0);
286
+ }
287
+
288
+ if (transformFeedback) {
289
+ transformFeedback.end();
290
+ }
281
291
  }
282
- });
292
+ );
283
293
 
284
294
  vertexArray.unbindAfterRender(renderPass);
285
295
 
@@ -414,8 +424,13 @@ export class WEBGLRenderPipeline extends RenderPipeline {
414
424
  let texture: WEBGLTexture;
415
425
  if (value instanceof WEBGLTexture) {
416
426
  texture = value;
417
- } else if (value instanceof WEBGLFramebuffer && value.colorAttachments[0] instanceof WEBGLTexture) {
418
- log.warn('Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead')();
427
+ } else if (
428
+ value instanceof WEBGLFramebuffer &&
429
+ value.colorAttachments[0] instanceof WEBGLTexture
430
+ ) {
431
+ log.warn(
432
+ 'Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead'
433
+ )();
419
434
  texture = value.colorAttachments[0];
420
435
  } else {
421
436
  throw new Error('No texture');