Skip to content

Commit 7baee18

Browse files
author
Don McCurdy
committed
chore(luma): Upgrade to luma.gl v9 alpha-50
1 parent 97334a8 commit 7baee18

File tree

20 files changed

+141
-140
lines changed

20 files changed

+141
-140
lines changed

modules/aggregation-layers/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
},
3333
"dependencies": {
3434
"@babel/runtime": "^7.0.0",
35-
"@luma.gl/constants": "9.0.0-alpha.42",
36-
"@luma.gl/core": "9.0.0-alpha.42",
37-
"@luma.gl/shadertools": "9.0.0-alpha.42",
35+
"@luma.gl/constants": "9.0.0-alpha.50",
36+
"@luma.gl/core": "9.0.0-alpha.50",
37+
"@luma.gl/shadertools": "9.0.0-alpha.50",
3838
"@math.gl/web-mercator": "^4.0.0",
3939
"d3-hexbin": "^0.2.1"
4040
},
4141
"peerDependencies": {
4242
"@deck.gl/core": "^9.0.0-alpha",
4343
"@deck.gl/layers": "^9.0.0-alpha",
44-
"@luma.gl/core": "9.0.0-alpha.42",
45-
"@luma.gl/engine": "9.0.0-alpha.42"
44+
"@luma.gl/core": "9.0.0-alpha.50",
45+
"@luma.gl/engine": "9.0.0-alpha.50"
4646
},
4747
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
4848
}

modules/aggregation-layers/src/heatmap-layer/heatmap-layer.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
} from './heatmap-layer-utils';
3030
import {Buffer, DeviceFeature, Texture, TextureProps, TextureFormat} from '@luma.gl/core';
3131
import {GL} from '@luma.gl/constants';
32-
import {Transform} from '@luma.gl/engine';
32+
import {TextureTransform, TextureTransformProps} from '@luma.gl/engine';
3333
import {withGLParameters} from '@luma.gl/webgl';
3434
import {
3535
Accessor,
@@ -201,8 +201,8 @@ export default class HeatmapLayer<
201201
updateTimer?: any;
202202
triPositionBuffer?: Buffer;
203203
triTexCoordBuffer?: Buffer;
204-
weightsTransform?: Transform;
205-
maxWeightTransform?: Transform;
204+
weightsTransform?: TextureTransform;
205+
maxWeightTransform?: TextureTransform;
206206
textureSize: number;
207207
format: TextureFormat;
208208
type: GL;
@@ -424,16 +424,15 @@ export default class HeatmapLayer<
424424

425425
_createWeightsTransform(shaders = {}) {
426426
let {weightsTransform} = this.state;
427-
const {weightsTexture} = this.state;
428427
weightsTransform?.delete();
429428

430-
weightsTransform = new Transform(this.context.device, {
429+
weightsTransform = new TextureTransform(this.context.device, {
431430
id: `${this.id}-weights-transform`,
432-
elementCount: 1,
433-
_targetTexture: weightsTexture,
434-
_targetTextureVarying: 'weightsTexture',
431+
vertexCount: 1,
432+
targetTexture: this.state.weightsTexture!,
433+
targetTextureVarying: 'weightsTexture',
435434
...shaders
436-
});
435+
} as TextureTransformProps);
437436
this.setState({weightsTransform});
438437
}
439438

@@ -445,7 +444,7 @@ export default class HeatmapLayer<
445444
this._createWeightsTransform(weightsTransformShaders);
446445

447446
const maxWeightsTransformShaders = this.getShaders('max-weights-transform');
448-
const maxWeightTransform = new Transform(this.context.device, {
447+
const maxWeightTransform = new TextureTransform(this.context.device, {
449448
id: `${this.id}-max-weights-transform`,
450449
_sourceTextures: {
451450
inTexture: weightsTexture
@@ -484,6 +483,7 @@ export default class HeatmapLayer<
484483
const {maxWeightTransform} = this.state;
485484
maxWeightTransform!.run({
486485
parameters: {
486+
// @ts-expect-error TODO(v9): Resolve errors.
487487
blend: true,
488488
depthTest: false,
489489
blendFunc: [GL.ONE, GL.ONE],
@@ -618,13 +618,13 @@ export default class HeatmapLayer<
618618
weightsTransform.run({
619619
uniforms,
620620
parameters: {
621+
// @ts-expect-error TODO(v9): Resolve errors.
621622
blend: true,
622623
depthTest: false,
623624
blendFunc: [GL.ONE, GL.ONE],
624625
blendEquation: GL.FUNC_ADD
625626
},
626627
clearRenderTarget: true,
627-
// @ts-expect-error TODO - no longer supported in v9?
628628
attributes: this.getAttributes(),
629629
moduleSettings: this.getModuleSettings()
630630
});

modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// THE SOFTWARE.
2020

2121
import type {Device, DeviceFeature} from '@luma.gl/core';
22-
import {Model, Transform} from '@luma.gl/engine';
22+
import {Model, TextureTransform} from '@luma.gl/engine';
2323
import {fp64arithmetic} from '@luma.gl/shadertools';
2424
import {readPixelsToBuffer, withGLParameters, clear} from '@luma.gl/webgl';
2525
import {GL} from '@luma.gl/constants';
@@ -696,7 +696,7 @@ function getAllAggregationModel(device: Device, instanceCount: number): Model {
696696
}
697697

698698
function getMeanTransform(device: Device, opts) {
699-
return new Transform(device, {
699+
return new TextureTransform(device, {
700700
vs: TRANSFORM_MEAN_VS,
701701
_targetTextureVarying: 'meanValues',
702702
...opts

modules/arcgis/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"peerDependencies": {
3333
"@arcgis/core": "^4.0.0",
3434
"@deck.gl/core": "^9.0.0-alpha",
35-
"@luma.gl/core": "9.0.0-alpha.42",
36-
"@luma.gl/engine": "9.0.0-alpha.42"
35+
"@luma.gl/core": "9.0.0-alpha.50",
36+
"@luma.gl/engine": "9.0.0-alpha.50"
3737
},
3838
"dependencies": {
3939
"@babel/runtime": "^7.0.0",

modules/carto/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"@loaders.gl/loader-utils": "4.0.3",
4141
"@loaders.gl/mvt": "4.0.3",
4242
"@loaders.gl/tiles": "4.0.3",
43-
"@luma.gl/constants": "9.0.0-alpha.42",
44-
"@luma.gl/core": "9.0.0-alpha.42",
43+
"@luma.gl/constants": "9.0.0-alpha.50",
44+
"@luma.gl/core": "9.0.0-alpha.50",
4545
"@math.gl/web-mercator": "^4.0.0",
4646
"cartocolor": "^4.0.2",
4747
"d3-array": "^3.2.0",

modules/core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"@babel/runtime": "^7.0.0",
3737
"@loaders.gl/core": "4.0.3",
3838
"@loaders.gl/images": "4.0.3",
39-
"@luma.gl/constants": "9.0.0-alpha.42",
40-
"@luma.gl/core": "9.0.0-alpha.42",
41-
"@luma.gl/engine": "9.0.0-alpha.42",
42-
"@luma.gl/shadertools": "9.0.0-alpha.42",
43-
"@luma.gl/webgl": "9.0.0-alpha.42",
39+
"@luma.gl/constants": "9.0.0-alpha.50",
40+
"@luma.gl/core": "9.0.0-alpha.50",
41+
"@luma.gl/engine": "9.0.0-alpha.50",
42+
"@luma.gl/shadertools": "9.0.0-alpha.50",
43+
"@luma.gl/webgl": "9.0.0-alpha.50",
4444
"@math.gl/core": "^4.0.0",
4545
"@math.gl/sun": "^4.0.0",
4646
"@math.gl/web-mercator": "^4.0.0",

modules/core/src/lib/attribute/attribute-transition-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// deck.gl, MIT license
22

33
import type {Device} from '@luma.gl/core';
4-
import {Transform} from '@luma.gl/engine';
4+
import {BufferTransform} from '@luma.gl/engine';
55
import GPUInterpolationTransition from '../../transitions/gpu-interpolation-transition';
66
import GPUSpringTransition from '../../transitions/gpu-spring-transition';
77
import log from '../../utils/log';
@@ -45,7 +45,7 @@ export default class AttributeTransitionManager {
4545
this.transitions = {};
4646
this.needsRedraw = false;
4747
this.numInstances = 1;
48-
this.isSupported = Transform.isSupported(device);
48+
this.isSupported = device.features.has('transform-feedback-webgl2');
4949
}
5050

5151
finalize(): void {

modules/core/src/passes/screen-pass.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default class ScreenPass extends Pass {
6262
protected _renderPass(device: Device, options: ScreenPassRenderOptions) {
6363
const {inputBuffer} = options;
6464
clear(this.device, {color: true});
65+
// @ts-expect-error TODO(v9): Resolve errors.
6566
this.model.setShaderModuleProps(options.moduleSettings);
6667
this.model.setBindings({
6768
texture: inputBuffer.colorAttachments[0]

modules/core/src/scripting/lumagl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export {
1616
TruncatedConeGeometry
1717
} from '@luma.gl/engine';
1818

19-
export {Model, Transform, PipelineFactory} from '@luma.gl/engine';
19+
export {Model, BufferTransform, TextureTransform, PipelineFactory} from '@luma.gl/engine';
2020

2121
/*
2222
export {

modules/core/src/transitions/gpu-interpolation-transition.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {Device} from '@luma.gl/core';
2-
import {Timeline, Transform} from '@luma.gl/engine';
2+
import {Timeline, BufferTransform} from '@luma.gl/engine';
33
import {Buffer} from '@luma.gl/core';
44
import {GL} from '@luma.gl/constants';
55
import Attribute from '../lib/attribute/attribute';
@@ -26,7 +26,7 @@ export default class GPUInterpolationTransition implements GPUTransition {
2626
private transition: Transition;
2727
private currentStartIndices: NumericArray | null;
2828
private currentLength: number;
29-
private transform: Transform;
29+
private transform: BufferTransform;
3030
private buffers: Buffer[];
3131

3232
constructor({
@@ -111,7 +111,6 @@ export default class GPUInterpolationTransition implements GPUTransition {
111111
elementCount: Math.floor(this.currentLength / attribute.size),
112112
sourceBuffers: {
113113
aFrom: buffers[0],
114-
// @ts-expect-error TODO - this looks like a real type mismatch!!!
115114
aTo: getSourceBufferAttribute(device, attribute)
116115
},
117116
feedbackBuffers: {
@@ -129,9 +128,8 @@ export default class GPUInterpolationTransition implements GPUTransition {
129128
if (easing) {
130129
t = easing(t);
131130
}
132-
this.transform.run({
133-
uniforms: {time: t}
134-
});
131+
this.transform.model.setUniforms({time: t});
132+
this.transform.run();
135133
}
136134
return updated;
137135
}
@@ -161,9 +159,9 @@ void main(void) {
161159
}
162160
`;
163161

164-
function getTransform(device: Device, attribute: Attribute): Transform {
162+
function getTransform(device: Device, attribute: Attribute): BufferTransform {
165163
const attributeType = getAttributeTypeFromSize(attribute.size);
166-
return new Transform(device, {
164+
return new BufferTransform(device, {
167165
vs,
168166
defines: {
169167
ATTRIBUTE_TYPE: attributeType

0 commit comments

Comments
 (0)