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

visgl / luma.gl / 14683349798

26 Apr 2025 05:08PM UTC coverage: 74.055% (-0.9%) from 74.913%
14683349798

push

github

web-flow
feat(core): TextureFormat generics (#2377)

2019 of 2652 branches covered (76.13%)

Branch coverage included in aggregate %.

62 of 262 new or added lines in 15 files covered. (23.66%)

196 existing lines in 9 files now uncovered.

26575 of 35960 relevant lines covered (73.9%)

47.35 hits per line

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

61.7
/modules/shadertools/src/modules/math/fp64/fp64-utils.ts
1
// luma.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
import type {NumericArray} from '@math.gl/types';
1✔
6

1✔
7
/**
1✔
8
 * Calculate WebGL 64 bit float
1✔
9
 * @param a  - the input float number
1✔
10
 * @param out - the output array. If not supplied, a new array is created.
1✔
11
 * @param startIndex - the index in the output array to fill from. Default 0.
1✔
12
 * @returns - the fp64 representation of the input number
1✔
13
 */
1✔
14
export function fp64ify(a: number, out: NumericArray = [], startIndex: number = 0): NumericArray {
1✔
UNCOV
15
  const hiPart = Math.fround(a);
×
UNCOV
16
  const loPart = a - hiPart;
×
UNCOV
17
  out[startIndex] = hiPart;
×
UNCOV
18
  out[startIndex + 1] = loPart;
×
UNCOV
19
  return out;
×
UNCOV
20
}
×
21

1✔
22
/**
1✔
23
 * Calculate the low part of a WebGL 64 bit float
1✔
24
 * @param a the input float number
1✔
25
 * @returns the lower 32 bit of the number
1✔
26
 */
1✔
27
export function fp64LowPart(a: number): number {
1✔
UNCOV
28
  return a - Math.fround(a);
×
UNCOV
29
}
×
30

1✔
31
/**
1✔
32
 * Calculate WebGL 64 bit matrix (transposed "Float64Array")
1✔
33
 * @param matrix  the input matrix
1✔
34
 * @returns the fp64 representation of the input matrix
1✔
35
 */
1✔
36
export function fp64ifyMatrix4(matrix: NumericArray): Float32Array {
1✔
UNCOV
37
  // Transpose the projection matrix to column major for GLSL.
×
UNCOV
38
  const matrixFP64 = new Float32Array(32);
×
UNCOV
39
  for (let i = 0; i < 4; ++i) {
×
UNCOV
40
    for (let j = 0; j < 4; ++j) {
×
UNCOV
41
      const index = i * 4 + j;
×
UNCOV
42
      fp64ify(matrix[j * 4 + i], matrixFP64, index * 2);
×
UNCOV
43
    }
×
UNCOV
44
  }
×
UNCOV
45
  return matrixFP64;
×
UNCOV
46
}
×
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