Skip to content

Commit 1c81a7b

Browse files
authored
chore: WebGPU plumbing #1 (#9476)
1 parent 9f4f46e commit 1c81a7b

File tree

17 files changed

+108
-131
lines changed

17 files changed

+108
-131
lines changed

modules/aggregation-layers/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@
3838
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
3939
},
4040
"dependencies": {
41-
"@luma.gl/constants": "^9.1.2",
42-
"@luma.gl/shadertools": "^9.1.2",
41+
"@luma.gl/constants": "^9.1.3",
42+
"@luma.gl/shadertools": "^9.1.3",
4343
"@math.gl/core": "^4.1.0",
4444
"@math.gl/web-mercator": "^4.1.0",
4545
"d3-hexbin": "^0.2.1"
4646
},
4747
"peerDependencies": {
4848
"@deck.gl/core": "^9.1.0",
4949
"@deck.gl/layers": "^9.1.0",
50-
"@luma.gl/core": "^9.1.0",
51-
"@luma.gl/engine": "^9.1.0"
50+
"@luma.gl/core": "^9.1.3",
51+
"@luma.gl/engine": "^9.1.3"
5252
},
5353
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
5454
}

modules/arcgis/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@
3636
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
3737
},
3838
"dependencies": {
39-
"@luma.gl/constants": "^9.1.2",
39+
"@luma.gl/constants": "^9.1.3",
4040
"esri-loader": "^3.7.0"
4141
},
4242
"peerDependencies": {
4343
"@arcgis/core": "^4.0.0",
4444
"@deck.gl/core": "^9.1.0",
45-
"@luma.gl/core": "^9.1.0",
46-
"@luma.gl/engine": "^9.1.0",
47-
"@luma.gl/webgl": "^9.1.0"
45+
"@luma.gl/core": "^9.1.3",
46+
"@luma.gl/engine": "^9.1.3",
47+
"@luma.gl/webgl": "^9.1.3"
4848
},
4949
"devDependencies": {
5050
"@arcgis/core": "^4.21.0"

modules/carto/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"@loaders.gl/mvt": "^4.2.0",
5050
"@loaders.gl/schema": "^4.2.0",
5151
"@loaders.gl/tiles": "^4.2.0",
52-
"@luma.gl/core": "^9.1.2",
53-
"@luma.gl/shadertools": "^9.1.2",
52+
"@luma.gl/core": "^9.1.3",
53+
"@luma.gl/shadertools": "^9.1.3",
5454
"@math.gl/web-mercator": "^4.1.0",
5555
"@types/d3-array": "^3.0.2",
5656
"@types/d3-color": "^1.4.2",
@@ -73,7 +73,7 @@
7373
"@deck.gl/geo-layers": "^9.1.0",
7474
"@deck.gl/layers": "^9.1.0",
7575
"@loaders.gl/core": "^4.2.0",
76-
"@luma.gl/core": "^9.1.0"
76+
"@luma.gl/core": "^9.1.3"
7777
},
7878
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
7979
}

modules/core/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
"dependencies": {
4343
"@loaders.gl/core": "^4.2.0",
4444
"@loaders.gl/images": "^4.2.0",
45-
"@luma.gl/constants": "^9.1.2",
46-
"@luma.gl/core": "^9.1.2",
47-
"@luma.gl/engine": "^9.1.2",
48-
"@luma.gl/shadertools": "^9.1.2",
49-
"@luma.gl/webgl": "^9.1.2",
45+
"@luma.gl/constants": "^9.1.3",
46+
"@luma.gl/core": "^9.1.3",
47+
"@luma.gl/engine": "^9.1.3",
48+
"@luma.gl/shadertools": "^9.1.3",
49+
"@luma.gl/webgl": "^9.1.3",
5050
"@math.gl/core": "^4.1.0",
5151
"@math.gl/sun": "^4.1.0",
5252
"@math.gl/types": "^4.1.0",

modules/extensions/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
3939
},
4040
"dependencies": {
41-
"@luma.gl/constants": "^9.1.2",
42-
"@luma.gl/shadertools": "^9.1.2",
41+
"@luma.gl/constants": "^9.1.3",
42+
"@luma.gl/shadertools": "^9.1.3",
4343
"@math.gl/core": "^4.1.0"
4444
},
4545
"peerDependencies": {
4646
"@deck.gl/core": "^9.1.0",
47-
"@luma.gl/core": "^9.1.0",
48-
"@luma.gl/engine": "^9.1.0"
47+
"@luma.gl/core": "^9.1.3",
48+
"@luma.gl/engine": "^9.1.3"
4949
},
5050
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
5151
}

modules/geo-layers/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"@loaders.gl/terrain": "^4.2.0",
4747
"@loaders.gl/tiles": "^4.2.0",
4848
"@loaders.gl/wms": "^4.2.0",
49-
"@luma.gl/gltf": "^9.1.2",
50-
"@luma.gl/shadertools": "^9.1.2",
49+
"@luma.gl/gltf": "^9.1.3",
50+
"@luma.gl/shadertools": "^9.1.3",
5151
"@math.gl/core": "^4.1.0",
5252
"@math.gl/culling": "^4.1.0",
5353
"@math.gl/web-mercator": "^4.1.0",
@@ -61,8 +61,8 @@
6161
"@deck.gl/layers": "^9.1.0",
6262
"@deck.gl/mesh-layers": "^9.1.0",
6363
"@loaders.gl/core": "^4.2.0",
64-
"@luma.gl/core": "^9.1.0",
65-
"@luma.gl/engine": "^9.1.0"
64+
"@luma.gl/core": "^9.1.3",
65+
"@luma.gl/engine": "^9.1.3"
6666
},
6767
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
6868
}

modules/google-maps/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
3939
},
4040
"dependencies": {
41-
"@luma.gl/constants": "^9.1.2",
41+
"@luma.gl/constants": "^9.1.3",
4242
"@math.gl/core": "^4.1.0",
4343
"@types/google.maps": "^3.48.6"
4444
},
4545
"peerDependencies": {
4646
"@deck.gl/core": "^9.1.0",
47-
"@luma.gl/core": "^9.1.0",
48-
"@luma.gl/webgl": "^9.1.0"
47+
"@luma.gl/core": "^9.1.3",
48+
"@luma.gl/webgl": "^9.1.3"
4949
},
5050
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
5151
}

modules/jupyter-widget/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"@loaders.gl/3d-tiles": "^4.2.0",
4242
"@loaders.gl/core": "^4.2.0",
4343
"@loaders.gl/csv": "^4.2.0",
44-
"@luma.gl/core": "^9.1.2",
45-
"@luma.gl/webgl": "^9.1.2",
46-
"@luma.gl/constants": "^9.1.2",
44+
"@luma.gl/constants": "^9.1.3",
45+
"@luma.gl/core": "^9.1.3",
46+
"@luma.gl/webgl": "^9.1.3",
4747
"d3-dsv": "^1.0.8",
4848
"mapbox-gl": "^1.13.2"
4949
},

modules/layers/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"dependencies": {
4040
"@loaders.gl/images": "^4.2.0",
4141
"@loaders.gl/schema": "^4.2.0",
42-
"@luma.gl/shadertools": "^9.1.2",
42+
"@luma.gl/shadertools": "^9.1.3",
4343
"@mapbox/tiny-sdf": "^2.0.5",
4444
"@math.gl/core": "^4.1.0",
4545
"@math.gl/polygon": "^4.1.0",
@@ -49,8 +49,8 @@
4949
"peerDependencies": {
5050
"@deck.gl/core": "^9.1.0",
5151
"@loaders.gl/core": "^4.2.0",
52-
"@luma.gl/core": "^9.1.0",
53-
"@luma.gl/engine": "^9.1.0"
52+
"@luma.gl/core": "^9.1.3",
53+
"@luma.gl/engine": "^9.1.3"
5454
},
5555
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
5656
}

modules/main/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
"@deck.gl/react": "9.1.0-beta.3",
5454
"@deck.gl/widgets": "9.1.0-beta.3",
5555
"@loaders.gl/core": "^4.2.0",
56-
"@luma.gl/core": "^9.1.2",
57-
"@luma.gl/engine": "^9.1.2"
56+
"@luma.gl/core": "^9.1.3",
57+
"@luma.gl/engine": "^9.1.3"
5858
},
5959
"peerDependencies": {
6060
"@arcgis/core": "^4.0.0",

modules/mapbox/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
3939
},
4040
"dependencies": {
41-
"@luma.gl/constants": "^9.1.2",
41+
"@luma.gl/constants": "^9.1.3",
4242
"@math.gl/web-mercator": "^4.1.0"
4343
},
4444
"peerDependencies": {
4545
"@deck.gl/core": "^9.1.0",
46-
"@luma.gl/core": "^9.1.0"
46+
"@luma.gl/core": "^9.1.3"
4747
},
4848
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
4949
}

modules/mesh-layers/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
},
4040
"dependencies": {
4141
"@loaders.gl/gltf": "^4.2.0",
42-
"@luma.gl/gltf": "^9.1.2",
43-
"@luma.gl/shadertools": "^9.1.2"
42+
"@luma.gl/gltf": "^9.1.3",
43+
"@luma.gl/shadertools": "^9.1.3"
4444
},
4545
"peerDependencies": {
4646
"@deck.gl/core": "^9.1.0",
47-
"@luma.gl/core": "^9.1.0",
48-
"@luma.gl/engine": "^9.1.0"
47+
"@luma.gl/core": "^9.1.3",
48+
"@luma.gl/engine": "^9.1.3"
4949
},
5050
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
5151
}

modules/react/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"src"
3333
],
3434
"sideEffects": false,
35-
"scripts": {},
3635
"peerDependencies": {
3736
"@deck.gl/core": "^9.1.0",
3837
"@deck.gl/widgets": "^9.1.0",

modules/react/src/deckgl.ts

+20-16
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,26 @@ function createDeckInstance<ViewsT extends ViewOrViews>(
8282
// The Deck's animation loop is independent from React's render cycle, causing potential
8383
// synchronization issues. We provide this custom render function to make sure that React
8484
// and Deck update on the same schedule.
85-
_customRender: redrawReason => {
86-
// Save the dirty flag for later
87-
thisRef.redrawReason = redrawReason;
88-
89-
// Viewport/view state is passed to child components as props.
90-
// If they have changed, we need to trigger a React rerender to update children props.
91-
const viewports = deck.getViewports();
92-
if (thisRef.lastRenderedViewports !== viewports) {
93-
// Viewports have changed, update children props first.
94-
// This will delay the Deck canvas redraw till after React update (in useLayoutEffect)
95-
// so that the canvas does not get rendered before the child components update.
96-
thisRef.forceUpdate();
97-
} else {
98-
redrawDeck(thisRef);
99-
}
100-
}
85+
// TODO(ibgreen) - Hack to enable WebGPU as it needs to render quickly to avoid CanvasContext texture from going stale
86+
_customRender:
87+
props.deviceProps?.adapters?.[0]?.type === 'webgpu'
88+
? undefined
89+
: redrawReason => {
90+
// Save the dirty flag for later
91+
thisRef.redrawReason = redrawReason;
92+
93+
// Viewport/view state is passed to child components as props.
94+
// If they have changed, we need to trigger a React rerender to update children props.
95+
const viewports = deck.getViewports();
96+
if (thisRef.lastRenderedViewports !== viewports) {
97+
// Viewports have changed, update children props first.
98+
// This will delay the Deck canvas redraw till after React update (in useLayoutEffect)
99+
// so that the canvas does not get rendered before the child components update.
100+
thisRef.forceUpdate();
101+
} else {
102+
redrawDeck(thisRef);
103+
}
104+
}
101105
});
102106
return deck;
103107
}

modules/test-utils/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,13 @@
3232
"src"
3333
],
3434
"dependencies": {
35-
"@luma.gl/test-utils": "^9.1.2"
35+
"@luma.gl/test-utils": "^9.1.3"
3636
},
3737
"peerDependencies": {
3838
"@deck.gl/core": "^9.1.0",
39-
"@luma.gl/core": "^9.1.0",
40-
"@luma.gl/engine": "^9.1.0",
39+
"@luma.gl/core": "^9.1.3",
40+
"@luma.gl/engine": "^9.1.3",
4141
"@probe.gl/test-utils": "^4.1.0-alpha.2"
4242
},
43-
"scripts": {},
4443
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
4544
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@
4040
"devDependencies": {
4141
"@loaders.gl/csv": "^4.2.0",
4242
"@loaders.gl/polyfills": "^4.2.0",
43-
"@luma.gl/webgpu": "^9.1.2",
44-
"@luma.gl/effects": "^9.1.2",
43+
"@luma.gl/core": "^9.1.4",
44+
"@luma.gl/effects": "^9.1.4",
45+
"@luma.gl/webgpu": "^9.1.4",
4546
"@math.gl/proj4": "^4.1.0",
4647
"@probe.gl/bench": "^4.1.0",
47-
"jsdom": "^20.0.0",
4848
"@vis.gl/dev-tools": "1.0.0-alpha.21",
4949
"@vis.gl/ts-plugins": "1.0.0-alpha.21",
50+
"jsdom": "^20.0.0",
5051
"pre-commit": "^1.2.2",
5152
"puppeteer": "^22.4.0",
5253
"s2-geometry": "^1.2.10",
@@ -60,7 +61,6 @@
6061
"engines": {
6162
"node": ">=14"
6263
},
63-
"dependencies": {},
6464
"volta": {
6565
"node": "18.19.0",
6666
"yarn": "1.22.19"

0 commit comments

Comments
 (0)