@deck.gl/extensions 9.4.0-alpha.1 → 9.4.0-beta.1

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
@@ -3,7 +3,7 @@
3
3
  "description": "Plug-and-play functionalities for deck.gl layers",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.4.0-alpha.1",
6
+ "version": "9.4.0-beta.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -17,6 +17,10 @@
17
17
  "type": "git",
18
18
  "url": "https://github.com/visgl/deck.gl.git"
19
19
  },
20
+ "bugs": {
21
+ "url": "https://github.com/visgl/deck.gl/issues"
22
+ },
23
+ "homepage": "https://deck.gl",
20
24
  "types": "dist/index.d.ts",
21
25
  "main": "dist/index.cjs",
22
26
  "module": "dist/index.js",
@@ -38,14 +42,14 @@
38
42
  "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
39
43
  },
40
44
  "dependencies": {
41
- "@luma.gl/shadertools": "^9.3.3",
42
- "@luma.gl/webgl": "^9.3.3",
45
+ "@luma.gl/shadertools": "^9.4.0-beta.3",
46
+ "@luma.gl/webgl": "^9.4.0-beta.3",
43
47
  "@math.gl/core": "^4.1.0"
44
48
  },
45
49
  "peerDependencies": {
46
50
  "@deck.gl/core": "~9.3.0-beta.2",
47
- "@luma.gl/core": "~9.3.3",
48
- "@luma.gl/engine": "~9.3.3"
51
+ "@luma.gl/core": "~9.4.0-beta.3",
52
+ "@luma.gl/engine": "~9.4.0-beta.3"
49
53
  },
50
- "gitHead": "a30177af4ec82fd612d116d1528deac09f1800b4"
54
+ "gitHead": "5b00a0ced09284c2a642c8ffc56748629f5e796b"
51
55
  }
@@ -38,6 +38,11 @@ export type ClipModuleProps = {
38
38
  bounds: Readonly<[number, number, number, number]>;
39
39
  };
40
40
 
41
+ type WebGPUClipModuleProps = ClipModuleProps & {
42
+ enabled?: boolean;
43
+ mode?: 'instance' | 'geometry';
44
+ };
45
+
41
46
  /*
42
47
  * The vertex-shader version clips geometries by their anchor position
43
48
  * e.g. ScatterplotLayer - show if the center of a circle is within bounds
@@ -109,6 +114,10 @@ export default class ClipExtension extends LayerExtension {
109
114
  }
110
115
  this.state.clipByInstance = clipByInstance;
111
116
 
117
+ if (this.context.device.type === 'webgpu') {
118
+ return {};
119
+ }
120
+
112
121
  return clipByInstance
113
122
  ? {
114
123
  modules: [shaderModuleVs],
@@ -123,7 +132,7 @@ export default class ClipExtension extends LayerExtension {
123
132
  /* eslint-disable camelcase */
124
133
  draw(this: Layer<Required<ClipExtensionProps>>): void {
125
134
  const {clipBounds} = this.props;
126
- const clipProps = {} as ClipModuleProps;
135
+ const clipProps = {} as WebGPUClipModuleProps;
127
136
  if (this.state.clipByInstance) {
128
137
  clipProps.bounds = clipBounds;
129
138
  } else {
@@ -138,6 +147,11 @@ export default class ClipExtension extends LayerExtension {
138
147
  ];
139
148
  }
140
149
 
150
+ if (this.context.device.type === 'webgpu') {
151
+ clipProps.enabled = true;
152
+ clipProps.mode = this.state.clipByInstance ? 'instance' : 'geometry';
153
+ }
154
+
141
155
  this.setShaderModuleProps({clip: clipProps});
142
156
  }
143
157
  }