@luma.gl/webgl 9.0.8 → 9.0.10
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/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +1 -0
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +1 -4
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +1 -0
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +3 -3
- package/dist/dist.dev.js +4 -6
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +4 -6
- package/dist/index.cjs.map +2 -2
- package/package.json +3 -3
- package/src/adapter/converters/device-parameters.ts +1 -0
- package/src/adapter/resources/webgl-render-pass.ts +1 -4
- package/src/adapter/resources/webgl-render-pipeline.ts +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-parameters.d.ts","sourceRoot":"","sources":["../../../src/adapter/converters/device-parameters.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAgD,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,MAAM,EAAsB,UAAU,EAA+B,MAAM,eAAe,CAAC;AAEnG,OAAO,KAAK,EAGV,UAAU,EACV,YAAY,EAIb,MAAM,oBAAoB,CAAC;AAO5B;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,GAAG,OAAO,EACnD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAgBH;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,YAAY,EACxB,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAeH;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,OAAO,EAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAgBH;AAED,kCAAkC;AAClC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"device-parameters.d.ts","sourceRoot":"","sources":["../../../src/adapter/converters/device-parameters.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAgD,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,MAAM,EAAsB,UAAU,EAA+B,MAAM,eAAe,CAAC;AAEnG,OAAO,KAAK,EAGV,UAAU,EACV,YAAY,EAIb,MAAM,oBAAoB,CAAC;AAO5B;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,GAAG,OAAO,EACnD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAgBH;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,YAAY,EACxB,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAeH;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,OAAO,EAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAgBH;AAED,kCAAkC;AAClC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,QAwMzE;AAyBD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,UAAU,CAW5F;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,eAAe,CAW9F"}
|
|
@@ -114,6 +114,7 @@ export function setDeviceParameters(device, parameters) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
if (parameters.depthBias !== undefined) {
|
|
117
|
+
gl.enable(32823);
|
|
117
118
|
gl.polygonOffset(parameters.depthBias, parameters.depthBiasSlopeScale || 0);
|
|
118
119
|
}
|
|
119
120
|
// depthBiasSlopeScale: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-render-pass.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-render-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAK,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAcpD,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B,8DAA8D;IAC9D,YAAY,EAAE,YAAY,CAAC;gBAEf,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe;IAYvD,GAAG,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"webgl-render-pass.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-render-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAK,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAcpD,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B,8DAA8D;IAC9D,YAAY,EAAE,YAAY,CAAC;gBAEf,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe;IAYvD,GAAG,IAAI,IAAI;IAKX,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACxC,aAAa,IAAI,IAAI;IACrB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAO5C;;OAEG;IACH,aAAa,CAAC,UAAU,GAAE,oBAAyB,GAAG,IAAI;IAqD1D,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAKpC,iBAAiB,IAAI,IAAI;IAOlC;;OAEG;IACH,SAAS,CAAC,KAAK,IAAI,IAAI;IA+BvB;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,UAAU,GAAE,MAAU,EAAE,KAAK,GAAE,WAA0B;CAwCrF"}
|
|
@@ -27,9 +27,6 @@ export class WEBGLRenderPass extends RenderPass {
|
|
|
27
27
|
}
|
|
28
28
|
end() {
|
|
29
29
|
popContextState(this.device.gl);
|
|
30
|
-
if (this.props.framebuffer) {
|
|
31
|
-
setGLParameters(this.device.gl, { framebuffer: null });
|
|
32
|
-
}
|
|
33
30
|
// should add commands to CommandEncoder.
|
|
34
31
|
}
|
|
35
32
|
pushDebugGroup(groupLabel) { }
|
|
@@ -42,7 +39,7 @@ export class WEBGLRenderPass extends RenderPass {
|
|
|
42
39
|
* Maps RenderPass parameters to GL parameters
|
|
43
40
|
*/
|
|
44
41
|
setParameters(parameters = {}) {
|
|
45
|
-
const glParameters = {};
|
|
42
|
+
const glParameters = { ...this.glParameters };
|
|
46
43
|
// Framebuffers are specified using parameters in WebGL
|
|
47
44
|
if (this.props.framebuffer) {
|
|
48
45
|
glParameters.framebuffer = this.props.framebuffer;
|
|
@@ -43,6 +43,7 @@ export declare class WEBGLRenderPipeline extends RenderPipeline {
|
|
|
43
43
|
parameters?: RenderPipelineParameters;
|
|
44
44
|
topology?: PrimitiveTopology;
|
|
45
45
|
vertexArray: VertexArray;
|
|
46
|
+
isInstanced?: boolean;
|
|
46
47
|
vertexCount?: number;
|
|
47
48
|
indexCount?: number;
|
|
48
49
|
instanceCount?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-render-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-render-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAE,wBAAwB,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACpG,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAsC,MAAM,eAAe,CAAC;AAUlF,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAK3C,OAAO,EAAC,sBAAsB,EAAC,sCAAmC;AAKlE,oCAAoC;AACpC,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,yDAAyD;IACzD,MAAM,EAAE,WAAW,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,YAAY,CAAC;IACrB,oBAAoB;IACpB,EAAE,EAAE,WAAW,CAAC;IAChB,sBAAsB;IACtB,EAAE,EAAE,WAAW,CAAC;IAChB,mEAAmE;IACnE,kBAAkB,EAAE,YAAY,CAAC;IAEjC,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAM;IAC5C,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACvC,qBAAqB;IACrB,QAA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ACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;KAC5C,GAAG,OAAO;IA8FF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;cAkBhD,YAAY;IA2B5B,wFAAwF;IACxF,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY;IAmB9D;;;;OAIG;IACH,cAAc,IAAI,SAAS,GAAG,SAAS,GAAG,YAAY;IAmBtD,6DAA6D;IACvD,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB3C;;;;OAIG;IACH,sBAAsB;IAatB,iDAAiD;IACjD,cAAc;IAyFd;;;OAGG;IACH,cAAc;CASf"}
|
|
@@ -130,7 +130,7 @@ export class WEBGLRenderPipeline extends RenderPipeline {
|
|
|
130
130
|
draw(options) {
|
|
131
131
|
const { renderPass, parameters = this.props.parameters, topology = this.props.topology, vertexArray, vertexCount,
|
|
132
132
|
// indexCount,
|
|
133
|
-
instanceCount, firstVertex = 0,
|
|
133
|
+
instanceCount, isInstanced = false, firstVertex = 0,
|
|
134
134
|
// firstIndex,
|
|
135
135
|
// firstInstance,
|
|
136
136
|
// baseVertex,
|
|
@@ -138,7 +138,7 @@ export class WEBGLRenderPipeline extends RenderPipeline {
|
|
|
138
138
|
const glDrawMode = getGLDrawMode(topology);
|
|
139
139
|
const isIndexed = Boolean(vertexArray.indexBuffer);
|
|
140
140
|
const glIndexType = vertexArray.indexBuffer?.glIndexType;
|
|
141
|
-
|
|
141
|
+
// Note that we sometimes get called with 0 instances
|
|
142
142
|
// If we are using async linking, we need to wait until linking completes
|
|
143
143
|
if (this.linkStatus !== 'success') {
|
|
144
144
|
log.info(2, `RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)();
|
|
@@ -237,7 +237,7 @@ export class WEBGLRenderPipeline extends RenderPipeline {
|
|
|
237
237
|
throw new Error(`Error during compilation of shader ${this.vs.id}`);
|
|
238
238
|
}
|
|
239
239
|
if (this.fs?.compilationStatus === 'error') {
|
|
240
|
-
this.
|
|
240
|
+
this.fs.debugShader();
|
|
241
241
|
throw new Error(`Error during compilation of shader ${this.fs.id}`);
|
|
242
242
|
}
|
|
243
243
|
throw new Error(`Error during ${status}: ${this.device.gl.getProgramInfoLog(this.handle)}`);
|
package/dist/dist.dev.js
CHANGED
|
@@ -2309,6 +2309,7 @@ var __exports__ = (() => {
|
|
|
2309
2309
|
}
|
|
2310
2310
|
}
|
|
2311
2311
|
if (parameters.depthBias !== void 0) {
|
|
2312
|
+
gl.enable(32823 /* POLYGON_OFFSET_FILL */);
|
|
2312
2313
|
gl.polygonOffset(parameters.depthBias, parameters.depthBiasSlopeScale || 0);
|
|
2313
2314
|
}
|
|
2314
2315
|
if (parameters.provokingVertex) {
|
|
@@ -4032,9 +4033,6 @@ ${source2}`;
|
|
|
4032
4033
|
}
|
|
4033
4034
|
end() {
|
|
4034
4035
|
popContextState(this.device.gl);
|
|
4035
|
-
if (this.props.framebuffer) {
|
|
4036
|
-
setGLParameters(this.device.gl, { framebuffer: null });
|
|
4037
|
-
}
|
|
4038
4036
|
}
|
|
4039
4037
|
pushDebugGroup(groupLabel) {
|
|
4040
4038
|
}
|
|
@@ -4049,7 +4047,7 @@ ${source2}`;
|
|
|
4049
4047
|
* Maps RenderPass parameters to GL parameters
|
|
4050
4048
|
*/
|
|
4051
4049
|
setParameters(parameters = {}) {
|
|
4052
|
-
const glParameters = {};
|
|
4050
|
+
const glParameters = { ...this.glParameters };
|
|
4053
4051
|
if (this.props.framebuffer) {
|
|
4054
4052
|
glParameters.framebuffer = this.props.framebuffer;
|
|
4055
4053
|
}
|
|
@@ -4866,6 +4864,7 @@ ${source2}`;
|
|
|
4866
4864
|
vertexCount,
|
|
4867
4865
|
// indexCount,
|
|
4868
4866
|
instanceCount,
|
|
4867
|
+
isInstanced = false,
|
|
4869
4868
|
firstVertex = 0,
|
|
4870
4869
|
// firstIndex,
|
|
4871
4870
|
// firstInstance,
|
|
@@ -4875,7 +4874,6 @@ ${source2}`;
|
|
|
4875
4874
|
const glDrawMode = getGLDrawMode(topology);
|
|
4876
4875
|
const isIndexed = Boolean(vertexArray.indexBuffer);
|
|
4877
4876
|
const glIndexType = vertexArray.indexBuffer?.glIndexType;
|
|
4878
|
-
const isInstanced = Number(instanceCount) > 0;
|
|
4879
4877
|
if (this.linkStatus !== "success") {
|
|
4880
4878
|
import_core17.log.info(2, `RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)();
|
|
4881
4879
|
return false;
|
|
@@ -4971,7 +4969,7 @@ ${source2}`;
|
|
|
4971
4969
|
throw new Error(`Error during compilation of shader ${this.vs.id}`);
|
|
4972
4970
|
}
|
|
4973
4971
|
if (this.fs?.compilationStatus === "error") {
|
|
4974
|
-
this.
|
|
4972
|
+
this.fs.debugShader();
|
|
4975
4973
|
throw new Error(`Error during compilation of shader ${this.fs.id}`);
|
|
4976
4974
|
}
|
|
4977
4975
|
throw new Error(`Error during ${status}: ${this.device.gl.getProgramInfoLog(this.handle)}`);
|