@antv/l7-renderer 2.21.10 → 2.21.11-beta.0

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.
@@ -45,7 +45,7 @@ import {
45
45
  stencilFuncMap,
46
46
  stencilOpMap
47
47
  } from "./constants";
48
- var { isPlainObject, isTypedArray } = lodashUtil;
48
+ var { isPlainObject, isTypedArray, isNil } = lodashUtil;
49
49
  var DeviceModel = class {
50
50
  constructor(device, options, service) {
51
51
  this.device = device;
@@ -113,6 +113,7 @@ var DeviceModel = class {
113
113
  this.pipeline = this.createPipeline(options);
114
114
  }
115
115
  createPipeline(options, pick) {
116
+ var _a;
116
117
  const { primitive = gl.TRIANGLES, depth, cull, blend, stencil } = options;
117
118
  const depthParams = this.initDepthDrawParams({ depth });
118
119
  const depthEnabled = !!(depthParams && depthParams.enable);
@@ -122,7 +123,7 @@ var DeviceModel = class {
122
123
  const blendEnabled = !!(blendParams && blendParams.enable);
123
124
  const stencilParams = this.getStencilDrawParams({ stencil });
124
125
  const stencilEnabled = !!(stencilParams && stencilParams.enable);
125
- return this.device.createRenderPipeline({
126
+ const pipeline = this.device.createRenderPipeline({
126
127
  // return this.service.renderCache.createRenderPipeline({
127
128
  inputLayout: this.inputLayout,
128
129
  program: this.program,
@@ -178,6 +179,10 @@ var DeviceModel = class {
178
179
  }
179
180
  }
180
181
  });
182
+ if (stencilEnabled && !isNil((_a = stencil == null ? void 0 : stencil.func) == null ? void 0 : _a.ref)) {
183
+ pipeline.stencilFuncReference = stencil.func.ref;
184
+ }
185
+ return pipeline;
181
186
  }
182
187
  updateAttributesAndElements() {
183
188
  }
@@ -221,7 +226,9 @@ var DeviceModel = class {
221
226
  );
222
227
  device["swapChainHeight"] = tmpHeight;
223
228
  renderPass.setPipeline(this.pipeline);
224
- renderPass.setStencilReference(1);
229
+ if (!isNil(this.pipeline.stencilFuncReference)) {
230
+ renderPass.setStencilReference(this.pipeline.stencilFuncReference);
231
+ }
225
232
  renderPass.setVertexInput(
226
233
  this.inputLayout,
227
234
  this.vertexBuffers.map((buffer) => ({
package/es/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- /**
2
- *
3
- */
4
1
  import DeviceRendererService from './device';
5
2
  import ReglRendererService from './regl';
6
3
  export { DeviceRendererService, ReglRendererService };
@@ -55,7 +55,7 @@ var import_l7_utils = require("@antv/l7-utils");
55
55
  var import_DeviceFramebuffer = __toESM(require("./DeviceFramebuffer"));
56
56
  var import_DeviceTexture2D = __toESM(require("./DeviceTexture2D"));
57
57
  var import_constants = require("./constants");
58
- var { isPlainObject, isTypedArray } = import_l7_utils.lodashUtil;
58
+ var { isPlainObject, isTypedArray, isNil } = import_l7_utils.lodashUtil;
59
59
  var DeviceModel = class {
60
60
  constructor(device, options, service) {
61
61
  this.device = device;
@@ -123,6 +123,7 @@ var DeviceModel = class {
123
123
  this.pipeline = this.createPipeline(options);
124
124
  }
125
125
  createPipeline(options, pick) {
126
+ var _a;
126
127
  const { primitive = import_l7_core.gl.TRIANGLES, depth, cull, blend, stencil } = options;
127
128
  const depthParams = this.initDepthDrawParams({ depth });
128
129
  const depthEnabled = !!(depthParams && depthParams.enable);
@@ -132,7 +133,7 @@ var DeviceModel = class {
132
133
  const blendEnabled = !!(blendParams && blendParams.enable);
133
134
  const stencilParams = this.getStencilDrawParams({ stencil });
134
135
  const stencilEnabled = !!(stencilParams && stencilParams.enable);
135
- return this.device.createRenderPipeline({
136
+ const pipeline = this.device.createRenderPipeline({
136
137
  // return this.service.renderCache.createRenderPipeline({
137
138
  inputLayout: this.inputLayout,
138
139
  program: this.program,
@@ -188,6 +189,10 @@ var DeviceModel = class {
188
189
  }
189
190
  }
190
191
  });
192
+ if (stencilEnabled && !isNil((_a = stencil == null ? void 0 : stencil.func) == null ? void 0 : _a.ref)) {
193
+ pipeline.stencilFuncReference = stencil.func.ref;
194
+ }
195
+ return pipeline;
191
196
  }
192
197
  updateAttributesAndElements() {
193
198
  }
@@ -231,7 +236,9 @@ var DeviceModel = class {
231
236
  );
232
237
  device["swapChainHeight"] = tmpHeight;
233
238
  renderPass.setPipeline(this.pipeline);
234
- renderPass.setStencilReference(1);
239
+ if (!isNil(this.pipeline.stencilFuncReference)) {
240
+ renderPass.setStencilReference(this.pipeline.stencilFuncReference);
241
+ }
235
242
  renderPass.setVertexInput(
236
243
  this.inputLayout,
237
244
  this.vertexBuffers.map((buffer) => ({
package/lib/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- /**
2
- *
3
- */
4
1
  import DeviceRendererService from './device';
5
2
  import ReglRendererService from './regl';
6
3
  export { DeviceRendererService, ReglRendererService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-renderer",
3
- "version": "2.21.10",
3
+ "version": "2.21.11-beta.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "https://github.com/orgs/antvis/people",
@@ -16,11 +16,11 @@
16
16
  "@antv/g-device-api": "^1.6.4",
17
17
  "@babel/runtime": "^7.7.7",
18
18
  "regl": "1.6.1",
19
- "@antv/l7-core": "2.21.10",
20
- "@antv/l7-utils": "2.21.10"
19
+ "@antv/l7-core": "2.21.11-beta.0",
20
+ "@antv/l7-utils": "2.21.11-beta.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@antv/l7-test-utils": "^2.21.10"
23
+ "@antv/l7-test-utils": "^2.21.11-beta.0"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public",