@luma.gl/webgl 9.0.0-alpha.40 → 9.0.0-alpha.41
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-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +3 -2
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/dist.dev.js +3 -2
- package/dist/index.cjs +39 -29
- package/dist.min.js +15 -15
- package/package.json +5 -5
- package/src/adapter/resources/webgl-render-pipeline.ts +47 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/webgl",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.41",
|
|
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.
|
|
48
|
-
"@luma.gl/core": "9.0.0-alpha.
|
|
47
|
+
"@luma.gl/constants": "9.0.0-alpha.41",
|
|
48
|
+
"@luma.gl/core": "9.0.0-alpha.41",
|
|
49
49
|
"@probe.gl/env": "^4.0.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@luma.gl/test-utils": "9.0.0-alpha.
|
|
52
|
+
"@luma.gl/test-utils": "9.0.0-alpha.41"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e8a5f47c6890d0b1883979c09114676b8fa90cc6"
|
|
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
|
-
|
|
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(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
firstVertex
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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 (
|
|
418
|
-
|
|
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');
|