Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/aggregation-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
},
"dependencies": {
"@luma.gl/shadertools": "^9.3.2",
"@luma.gl/shadertools": "^9.3.3",
"@math.gl/core": "^4.1.0",
"@math.gl/web-mercator": "^4.1.0",
"d3-hexbin": "^0.2.1"
},
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@deck.gl/layers": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/engine": "~9.3.2"
"@luma.gl/core": "~9.3.3",
"@luma.gl/engine": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
6 changes: 3 additions & 3 deletions modules/arcgis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"peerDependencies": {
"@arcgis/core": "^4.0.0",
"@deck.gl/core": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/engine": "~9.3.2",
"@luma.gl/webgl": "~9.3.2"
"@luma.gl/core": "~9.3.3",
"@luma.gl/engine": "~9.3.3",
"@luma.gl/webgl": "~9.3.3"
},
"devDependencies": {
"@arcgis/core": "^4.21.0"
Expand Down
20 changes: 18 additions & 2 deletions modules/arcgis/src/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type RenderResources = {
texture: Texture;
model: Model;
fbo: Framebuffer;
_externalFramebuffer?: {handle: WebGLFramebuffer; wrapper: Framebuffer};
};

async function createDeckInstance(gl: WebGL2RenderingContext): Promise<{
Expand Down Expand Up @@ -153,15 +154,29 @@ export function render(
const {model, deck, fbo} = resources;
const device = model.device;
if (device instanceof WebGLDevice) {
// @ts-ignore device.getParametersWebGL should return `any` not `void`?
const screenFbo: Framebuffer = device.getParametersWebGL(GL.FRAMEBUFFER_BINDING);
const {width, height, ...viewState} = viewport;

/* global window */
const dpr = window.devicePixelRatio;
const pixelWidth = Math.round(width * dpr);
const pixelHeight = Math.round(height * dpr);

// Wrap the external framebuffer handle so luma.gl treats it as a proper Framebuffer resource.
const externalFbo = device.getParametersWebGL(GL.FRAMEBUFFER_BINDING);
let screenFbo: Framebuffer | null = null;
if (externalFbo) {
if (resources._externalFramebuffer?.handle !== externalFbo) {
resources._externalFramebuffer?.wrapper.destroy();
const wrapper = device.createFramebuffer({
handle: externalFbo,
width: pixelWidth,
height: pixelHeight
});
resources._externalFramebuffer = {handle: externalFbo, wrapper};
}
screenFbo = resources._externalFramebuffer!.wrapper;
}

fbo.resize({width: pixelWidth, height: pixelHeight});

deck.setProps({viewState});
Expand Down Expand Up @@ -189,4 +204,5 @@ export function finalizeResources(resources: RenderResources) {
resources.model.destroy();
resources.fbo.destroy();
resources.texture.destroy();
resources._externalFramebuffer?.wrapper.destroy();
}
6 changes: 3 additions & 3 deletions modules/carto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@loaders.gl/mvt": "^4.4.1",
"@loaders.gl/schema": "^4.4.1",
"@loaders.gl/tiles": "^4.4.1",
"@luma.gl/core": "^9.3.2",
"@luma.gl/shadertools": "^9.3.2",
"@luma.gl/core": "^9.3.3",
"@luma.gl/shadertools": "^9.3.3",
"@math.gl/web-mercator": "^4.1.0",
"@types/d3-array": "^3.0.2",
"@types/d3-color": "^3.1.3",
Expand All @@ -73,7 +73,7 @@
"@deck.gl/geo-layers": "~9.3.0-alpha.1",
"@deck.gl/layers": "~9.3.0-alpha.1",
"@loaders.gl/core": "^4.4.1",
"@luma.gl/core": "~9.3.2"
"@luma.gl/core": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
8 changes: 4 additions & 4 deletions modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"dependencies": {
"@loaders.gl/core": "^4.4.1",
"@loaders.gl/images": "^4.4.1",
"@luma.gl/core": "^9.3.2",
"@luma.gl/engine": "^9.3.2",
"@luma.gl/shadertools": "^9.3.2",
"@luma.gl/webgl": "^9.3.2",
"@luma.gl/core": "^9.3.3",
"@luma.gl/engine": "^9.3.3",
"@luma.gl/shadertools": "^9.3.3",
"@luma.gl/webgl": "^9.3.3",
"@math.gl/core": "^4.1.0",
"@math.gl/sun": "^4.1.0",
"@math.gl/types": "^4.1.0",
Expand Down
8 changes: 4 additions & 4 deletions modules/extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
},
"dependencies": {
"@luma.gl/shadertools": "^9.3.2",
"@luma.gl/webgl": "^9.3.2",
"@luma.gl/shadertools": "^9.3.3",
"@luma.gl/webgl": "^9.3.3",
"@math.gl/core": "^4.1.0"
},
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/engine": "~9.3.2"
"@luma.gl/core": "~9.3.3",
"@luma.gl/engine": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
8 changes: 4 additions & 4 deletions modules/geo-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@loaders.gl/terrain": "^4.4.1",
"@loaders.gl/tiles": "^4.4.1",
"@loaders.gl/wms": "^4.4.1",
"@luma.gl/gltf": "^9.3.2",
"@luma.gl/shadertools": "^9.3.2",
"@luma.gl/gltf": "^9.3.3",
"@luma.gl/shadertools": "^9.3.3",
"@math.gl/core": "^4.1.0",
"@math.gl/culling": "^4.1.0",
"@math.gl/web-mercator": "^4.1.0",
Expand All @@ -62,8 +62,8 @@
"@deck.gl/layers": "~9.3.0-alpha.1",
"@deck.gl/mesh-layers": "~9.3.0-alpha.1",
"@loaders.gl/core": "^4.4.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/engine": "~9.3.2"
"@luma.gl/core": "~9.3.3",
"@luma.gl/engine": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
6 changes: 3 additions & 3 deletions modules/google-maps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
},
"dependencies": {
"@luma.gl/webgl": "^9.3.2",
"@luma.gl/webgl": "^9.3.3",
"@math.gl/core": "^4.1.0",
"@types/google.maps": "^3.48.6"
},
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/webgl": "~9.3.2"
"@luma.gl/core": "~9.3.3",
"@luma.gl/webgl": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
24 changes: 21 additions & 3 deletions modules/google-maps/src/google-maps-overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import {Deck} from '@deck.gl/core';

import type {DeckProps, MapViewState} from '@deck.gl/core';
import type {Device} from '@luma.gl/core';
import type {Device, Framebuffer} from '@luma.gl/core';
const HIDE_ALL_LAYERS = () => false;
const GL_STATE: GLParameters = {
depthMask: true,
Expand Down Expand Up @@ -55,6 +55,10 @@ export default class GoogleMapsOverlay {
private _deck: Deck | null = null;
private _overlay: google.maps.WebGLOverlayView | google.maps.OverlayView | null = null;
private _positioningOverlay: google.maps.OverlayView | null = null;
private _externalFramebuffer: {
handle: WebGLFramebuffer;
wrapper: import('@luma.gl/core').Framebuffer;
} | null = null;

constructor(props: GoogleMapsOverlayProps) {
this.setProps({...defaultProps, ...props});
Expand Down Expand Up @@ -320,9 +324,23 @@ export default class GoogleMapsOverlay {
const device: Device = deck.device;

// As an optimization, some renders are to an separate framebuffer
// which we need to pass onto deck
// which we need to pass onto deck. Wrap external handle so luma.gl
// treats it as a proper Framebuffer resource.
if (device instanceof WebGLDevice) {
const _framebuffer = device.getParametersWebGL(GL.FRAMEBUFFER_BINDING);
const externalFbo = device.getParametersWebGL(GL.FRAMEBUFFER_BINDING);
let _framebuffer: Framebuffer | null = null;
if (externalFbo) {
if (this._externalFramebuffer?.handle !== externalFbo) {
this._externalFramebuffer?.wrapper.destroy();
const wrapper = device.createFramebuffer({
handle: externalFbo,
width: gl.canvas.width,
height: gl.canvas.height
});
this._externalFramebuffer = {handle: externalFbo, wrapper};
}
_framebuffer = this._externalFramebuffer!.wrapper;
}
deck.setProps({_framebuffer});
}

Expand Down
4 changes: 2 additions & 2 deletions modules/jupyter-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@loaders.gl/3d-tiles": "^4.4.1",
"@loaders.gl/core": "^4.4.1",
"@loaders.gl/csv": "^4.4.1",
"@luma.gl/core": "^9.3.2",
"@luma.gl/webgl": "^9.3.2",
"@luma.gl/core": "^9.3.3",
"@luma.gl/webgl": "^9.3.3",
"d3-dsv": "^1.0.8",
"mapbox-gl": "^1.13.2",
"maplibre-gl": "^5.14.0"
Expand Down
6 changes: 3 additions & 3 deletions modules/layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"@loaders.gl/images": "^4.4.1",
"@loaders.gl/schema": "^4.4.1",
"@luma.gl/shadertools": "^9.3.2",
"@luma.gl/shadertools": "^9.3.3",
"@mapbox/tiny-sdf": "^2.0.5",
"@math.gl/core": "^4.1.0",
"@math.gl/polygon": "^4.1.0",
Expand All @@ -49,8 +49,8 @@
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@loaders.gl/core": "^4.4.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/engine": "~9.3.2"
"@luma.gl/core": "~9.3.3",
"@luma.gl/engine": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
4 changes: 2 additions & 2 deletions modules/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"@deck.gl/react": "9.3.0-beta.2",
"@deck.gl/widgets": "9.3.0-beta.2",
"@loaders.gl/core": "^4.4.1",
"@luma.gl/core": "^9.3.2",
"@luma.gl/engine": "^9.3.2"
"@luma.gl/core": "^9.3.3",
"@luma.gl/engine": "^9.3.3"
},
"peerDependencies": {
"@arcgis/core": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/mapbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/core": "~9.3.3",
"@math.gl/web-mercator": "^4.1.0"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
Expand Down
12 changes: 6 additions & 6 deletions modules/mesh-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
"dependencies": {
"@loaders.gl/gltf": "^4.4.1",
"@loaders.gl/schema": "^4.4.1",
"@luma.gl/gltf": "^9.3.2",
"@luma.gl/shadertools": "^9.3.2"
"@luma.gl/gltf": "^9.3.3",
"@luma.gl/shadertools": "^9.3.3"
},
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/engine": "~9.3.2",
"@luma.gl/gltf": "~9.3.2",
"@luma.gl/shadertools": "~9.3.2"
"@luma.gl/core": "~9.3.3",
"@luma.gl/engine": "~9.3.3",
"@luma.gl/gltf": "~9.3.3",
"@luma.gl/shadertools": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
8 changes: 4 additions & 4 deletions modules/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"src"
],
"dependencies": {
"@luma.gl/test-utils": "^9.3.2",
"@luma.gl/webgl": "^9.3.2"
"@luma.gl/test-utils": "^9.3.3",
"@luma.gl/webgl": "^9.3.3"
},
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2",
"@luma.gl/engine": "~9.3.2",
"@luma.gl/core": "~9.3.3",
"@luma.gl/engine": "~9.3.3",
"@probe.gl/test-utils": "^4.1.1",
"vitest": "^4.0.18"
},
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
"peerDependencies": {
"@deck.gl/core": "~9.3.0-alpha.1",
"@luma.gl/core": "~9.3.2"
"@luma.gl/core": "~9.3.3"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"@floating-ui/dom": "^1.7.5",
"@loaders.gl/csv": "^4.4.1",
"@loaders.gl/polyfills": "^4.4.1",
"@luma.gl/core": "^9.3.2",
"@luma.gl/effects": "^9.3.2",
"@luma.gl/webgl": "^9.3.2",
"@luma.gl/webgpu": "^9.3.2",
"@luma.gl/core": "^9.3.3",
"@luma.gl/effects": "^9.3.3",
"@luma.gl/webgl": "^9.3.3",
"@luma.gl/webgpu": "^9.3.3",
"@math.gl/proj4": "^4.1.0",
"@probe.gl/bench": "^4.1.1",
"@probe.gl/test-utils": "^4.1.1",
Expand Down
20 changes: 13 additions & 7 deletions test/modules/react/deckgl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,12 @@ test('DeckGL#uncontrolled view state', async () => {
})
);
});
await vi.waitFor(() => {
expect(onTransitionEnd).toHaveBeenCalled();
});
await vi.waitFor(
() => {
expect(onTransitionEnd).toHaveBeenCalled();
},
{timeout: 5000}
);

expect(onViewStateChange.mock.lastCall?.[0]?.viewState.longitude).toBeCloseTo(0);
expect(onViewStateChange.mock.lastCall?.[0]?.viewState.latitude).toBeCloseTo(0);
Expand All @@ -227,7 +230,7 @@ test('DeckGL#uncontrolled view state', async () => {
container.remove();
});

test('DeckGL#uncontrolled view state', async () => {
test('DeckGL#controlled view state', async () => {
const ref = createRef<DeckGLRef>();
const container = document.createElement('div');
document.body.append(container);
Expand Down Expand Up @@ -271,9 +274,12 @@ test('DeckGL#uncontrolled view state', async () => {
);
});

await vi.waitFor(() => {
expect(onTransitionEnd).toHaveBeenCalled();
});
await vi.waitFor(
() => {
expect(onTransitionEnd).toHaveBeenCalled();
},
{timeout: 5000}
);

expect(onViewStateChange.mock.lastCall?.[0]?.viewState.longitude).toBeCloseTo(0);
expect(onViewStateChange.mock.lastCall?.[0]?.viewState.latitude).toBeCloseTo(0);
Expand Down
Loading
Loading