• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / deck.gl / 16250138754

13 Jul 2025 02:25PM UTC coverage: 91.678% (-0.005%) from 91.683%
16250138754

push

github

web-flow
chore: Bump to luma.gl@9.2.0-alpha (#9241)

6765 of 7433 branches covered (91.01%)

Branch coverage included in aggregate %.

107 of 112 new or added lines in 26 files covered. (95.54%)

16 existing lines in 4 files now uncovered.

55842 of 60857 relevant lines covered (91.76%)

14490.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.23
/modules/extensions/src/data-filter/aggregator.ts
1
// deck.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
import {Device, DeviceFeature, Framebuffer, RenderPipelineParameters} from '@luma.gl/core';
1✔
6
import {Model, ModelProps} from '@luma.gl/engine';
1✔
7

1✔
8
const AGGREGATE_VS = `\
1✔
9
#version 300 es
1✔
10
#define SHADER_NAME data-filter-vertex-shader
1✔
11

1✔
12
#ifdef FLOAT_TARGET
1✔
13
  in float filterIndices;
1✔
14
  in float filterPrevIndices;
1✔
15
#else
1✔
16
  in vec2 filterIndices;
1✔
17
  in vec2 filterPrevIndices;
1✔
18
#endif
1✔
19

1✔
20
out vec4 vColor;
1✔
21
const float component = 1.0 / 255.0;
1✔
22

1✔
23
void main() {
1✔
24
  #ifdef FLOAT_TARGET
1✔
25
    dataFilter_value *= float(filterIndices != filterPrevIndices);
1✔
26
    gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
1✔
27
    vColor = vec4(0.0, 0.0, 0.0, 1.0);
1✔
28
  #else
1✔
29
    // Float texture is not supported: pack result into 4 channels x 256 px x 64px
1✔
30
    dataFilter_value *= float(filterIndices.x != filterPrevIndices.x);
1✔
31
    float col = filterIndices.x;
1✔
32
    float row = filterIndices.y * 4.0;
1✔
33
    float channel = floor(row);
1✔
34
    row = fract(row);
1✔
35
    vColor = component * vec4(bvec4(channel == 0.0, channel == 1.0, channel == 2.0, channel == 3.0));
1✔
36
    gl_Position = vec4(col * 2.0 - 1.0, row * 2.0 - 1.0, 0.0, 1.0);
1✔
37
  #endif
1✔
38
  gl_PointSize = 1.0;
1✔
39
}
1✔
40
`;
1✔
41

1✔
42
const AGGREGATE_FS = `\
1✔
43
#version 300 es
1✔
44
#define SHADER_NAME data-filter-fragment-shader
1✔
45
precision highp float;
1✔
46

1✔
47
in vec4 vColor;
1✔
48

1✔
49
out vec4 fragColor;
1✔
50

1✔
51
void main() {
1✔
52
  if (dataFilter_value < 0.5) {
1✔
53
    discard;
1✔
54
  }
1✔
55
  fragColor = vColor;
1✔
56
}
1✔
57
`;
1✔
58

1✔
59
const FLOAT_TARGET_FEATURES: DeviceFeature[] = [
1✔
60
  'float32-renderable-webgl', // ability to render to float texture
1✔
61
  'texture-blend-float-webgl' // ability to blend when rendering to float texture
1✔
62
];
1✔
63

1✔
64
export function supportsFloatTarget(device: Device): boolean {
1✔
65
  return FLOAT_TARGET_FEATURES.every(feature => device.features.has(feature));
1✔
66
}
1✔
67

1✔
68
// A 1x1 framebuffer object that encodes the total count of filtered items
1✔
69
export function getFramebuffer(device: Device, useFloatTarget: boolean): Framebuffer {
1✔
70
  if (useFloatTarget) {
1✔
71
    return device.createFramebuffer({
1✔
72
      width: 1,
1✔
73
      height: 1,
1✔
74
      colorAttachments: [
1✔
75
        device.createTexture({
1✔
76
          format: 'rgba32float',
1✔
77
          dimension: '2d',
1✔
78
          width: 1,
1✔
79
          height: 1
1✔
80
        })
1✔
81
      ]
1✔
82
    });
1✔
83
  }
1!
84
  return device.createFramebuffer({
×
85
    width: 256,
×
86
    height: 64,
×
NEW
87
    colorAttachments: [
×
NEW
88
      device.createTexture({format: 'rgba8unorm', dimension: '2d', width: 256, height: 64})
×
NEW
89
    ]
×
90
  });
×
91
}
×
92

1✔
93
// Increments the counter based on dataFilter_value
1✔
94
export function getModel(
1✔
95
  device: Device,
1✔
96
  bufferLayout: ModelProps['bufferLayout'],
1✔
97
  shaderOptions: any,
1✔
98
  useFloatTarget: boolean
1✔
99
): Model {
1✔
100
  shaderOptions.defines.NON_INSTANCED_MODEL = 1;
1✔
101
  if (useFloatTarget) {
1✔
102
    shaderOptions.defines.FLOAT_TARGET = 1;
1✔
103
  }
1✔
104

1✔
105
  return new Model(device, {
1✔
106
    id: 'data-filter-aggregation-model',
1✔
107
    vertexCount: 1,
1✔
108
    isInstanced: false,
1✔
109
    topology: 'point-list',
1✔
110
    disableWarnings: true,
1✔
111
    vs: AGGREGATE_VS,
1✔
112
    fs: AGGREGATE_FS,
1✔
113
    bufferLayout,
1✔
114
    ...shaderOptions
1✔
115
  });
1✔
116
}
1✔
117

1✔
118
export const parameters: RenderPipelineParameters = {
1✔
119
  blend: true,
1✔
120
  blendColorSrcFactor: 'one',
1✔
121
  blendColorDstFactor: 'one',
1✔
122
  blendAlphaSrcFactor: 'one',
1✔
123
  blendAlphaDstFactor: 'one',
1✔
124
  blendColorOperation: 'add',
1✔
125
  blendAlphaOperation: 'add',
1✔
126
  depthCompare: 'never'
1✔
127
} as const;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc