Skip to content

Commit

Permalink
Remove WebGL-only triangle-fan topology (#8860)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed May 6, 2024
1 parent 05e1b01 commit fd3aa4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/aggregation-layers/src/heatmap-layer/heatmap-layer.ts
Expand Up @@ -486,8 +486,8 @@ export default class HeatmapLayer<
const viewportCorners = [
viewport.unproject([0, 0]),
viewport.unproject([viewport.width, 0]),
viewport.unproject([viewport.width, viewport.height]),
viewport.unproject([0, viewport.height])
viewport.unproject([0, viewport.height]),
viewport.unproject([viewport.width, viewport.height])
].map(p => p.map(Math.fround));

// #1: get world bounds for current viewport extends
Expand Down
Expand Up @@ -65,7 +65,7 @@ export default class TriangleLayer extends Layer<_TriangleLayerProps> {
{name: 'positions', format: 'float32x3'},
{name: 'texCoords', format: 'float32x2'}
],
topology: 'triangle-fan-webgl',
topology: 'triangle-strip',
vertexCount
});
}
Expand Down
Expand Up @@ -159,14 +159,14 @@ export default class TextBackgroundLayer<DataT = any, ExtraPropsT extends {} = {

protected _getModel(): Model {
// a square that minimally cover the unit circle
const positions = [0, 0, 1, 0, 1, 1, 0, 1];
const positions = [0, 0, 1, 0, 0, 1, 1, 1];

return new Model(this.context.device, {
...this.getShaders(),
id: this.props.id,
bufferLayout: this.getAttributeManager()!.getBufferLayouts(),
geometry: new Geometry({
topology: 'triangle-fan-webgl',
topology: 'triangle-strip',
vertexCount: 4,
attributes: {
positions: {size: 2, value: new Float32Array(positions)}
Expand Down

0 comments on commit fd3aa4c

Please sign in to comment.