* Computes a stable 32-bit hash of the Float32 contents using their IEEE-754 * bit patterns (not numeric equality), to cheaply detect changes.
(data: Float32Array)
| 84 | * bit patterns (not numeric equality), to cheaply detect changes. |
| 85 | */ |
| 86 | function hashFloat32ArrayBits(data: Float32Array): number { |
| 87 | const u32 = new Uint32Array(data.buffer, data.byteOffset, data.byteLength / 4); |
| 88 | return fnv1aUpdate(0x811c9dc5, u32); // FNV-1a offset basis |
| 89 | } |
| 90 | |
| 91 | export function createDataStore(device: GPUDevice): DataStore { |
| 92 | const series = new Map<number, SeriesEntry>(); |
no test coverage detected