Skip to main content

GPURecordBatch

From: v10Status: Work-In-Progress

GPURecordBatch represents one immutable preserved GPU batch. It owns one batch-local GPUData chunk per selected column, GPUSchema metadata, and buffer-layout metadata.

Usage

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

const batch = new GPURecordBatch({
gpuData: {
positions: positions.data[0],
colors: colors.data[0]
}
});

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

Constructor

new GPURecordBatch(props)

PropTypeDefaultMeaning
gpuDataRecord<string, GPUData>RequiredOne batch-local GPU data chunk keyed by selected column name.
bufferLayoutBufferLayout[]DerivedPrecomputed batch buffer layouts.
fieldsGPUField[]DerivedSelected schema fields.
numRowsnumberDerivedExplicit row count for intentionally data-less batches.
metadataMap<string, string>undefinedBatch-level schema metadata.
nullCountnumber0Number of null rows retained in batch metadata.

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.
gpuDataRecord<string, GPUData>Batch-local data chunks keyed by shader/table column name.

Reserved Draw Columns

gpuData.indices is reserved for batch-local indexed rendering. It is a vertex-list<uint32> chunk whose flattened valueLength is the index count for this batch. The chunk remains part of gpuData and schema, but it is not emitted as an attribute buffer layout; its single GPUData buffer must be created with Buffer.INDEX usage so GPUTableModel can bind it as the model index buffer.

Methods

destroy(): void

Destroys every retained GPUData chunk. Each chunk destroys its buffer only when it owns that buffer.

Notes

GPURecordBatch mirrors Arrow RecordBatch: each selected column contributes one batch-local data chunk. Multi-chunk logical columns are table-level GPUVector views built by GPUTable.