Skip to main content

GPURecordBatch

From: v10Status: Work-In-Progress

GPURecordBatch represents one preserved GPU batch. It owns batch-local GPUVector objects, GPUSchema metadata, model-ready attributes, and WebGPU storage bindings.

Usage

import {GPURecordBatch} from '@luma.gl/tables';

const batch = new GPURecordBatch({
vectors: {
positions,
colors
}
});

When the source is an Arrow RecordBatch, prefer makeGPURecordBatchFromArrowRecordBatch() from @luma.gl/arrow.

Constructor

new GPURecordBatch(props)

PropTypeDefaultMeaning
vectorsRecord<string, GPUVector> | GPUVector[]RequiredBatch-local GPU vectors keyed by name or supplied as named vectors.
bufferLayoutBufferLayout[]DerivedPrecomputed batch buffer layouts.
fieldsGPUField[]DerivedSelected schema fields.
numRowsnumberDerivedExplicit row count for intentionally vector-less batches.
metadataMap<string, string>undefinedBatch-level schema metadata.
nullCountnumber0Number of null rows retained in batch metadata.
bindingsRecord<string, Buffer | DynamicBuffer>{}Model-ready storage bindings keyed by shader binding name.

Properties

PropertyTypeMeaning
schemaGPUSchemaGPU-facing schema for selected columns.
numRowsnumberNumber of logical rows in the batch.
numColsnumberNumber of selected GPU columns.
nullCountnumberNumber of null rows retained in metadata.
bufferLayoutBufferLayout[]Buffer layouts derived by the producing adapter.
gpuVectorsRecord<string, GPUVector>Batch-local vectors keyed by shader/table column name.
attributesRecord<string, Buffer | DynamicBuffer>Model-ready attribute buffers keyed by buffer layout name.
bindingsRecord<string, Buffer | DynamicBuffer>Model-ready storage bindings keyed by shader binding name.

Methods

appendRows(numRows, nullCount?): this

Adds logical row and null counts after an adapter appends into batch-local vectors.

resetRows(): this

Clears logical row and null counts while retaining vectors and allocations.

resetLastBatch(): this

Clears appendable vector payloads plus batch row/null counts while retaining allocations.

destroy(): void

Destroys every owned GPUVector retained by this batch.

Notes

GPURecordBatch is the natural unit for preserved source batches. Rendering and compute helpers can rebind attributes and bindings one batch at a time.