MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / StreamBuffer

Interface StreamBuffer

src/data/createStreamBuffer.ts:1–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1export interface StreamBuffer {
2 /**
3 * Writes a new vertex payload into the streaming buffer.
4 *
5 * Notes:
6 * - `data` is interpreted as interleaved `vec2<f32>` vertices: `[x0, y0, x1, y1, ...]`.
7 * - Uses double buffering (alternates GPU buffers each write) to avoid writing into the same
8 * buffer the GPU might still be reading from the prior frame.
9 * - Uses a per-buffer CPU mirror (Uint32 bit patterns) to compute partial updates.
10 */
11 write(data: Float32Array): void;
12 /** Returns the GPUBuffer that contains the most recently written data. */
13 getBuffer(): GPUBuffer;
14 /** Returns the vertex count for the most recently written data. */
15 getVertexCount(): number;
16 /** Destroys GPU resources (best-effort). Safe to call multiple times. */
17 dispose(): void;
18}
19
20const align4 = (n: number): number => (n + 3) & ~3;
21

Callers 3

prepareFunction · 0.80
renderFunction · 0.80
prepareFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected