import { BufferData , gl , IBuffer , IBufferInitializationOptions , } from '@antv/g-webgpu-core' ; import regl from 'regl' ; import { dataTypeMap , usageMap } from './constants' ; see https export default class ReglBuffer implements IBuffer { private buffer : regl . Buffer ; constructor ( reGl , options ) { const { data , usage , type } = options ; this . buffer = reGl . buffer ( { data , usage : usageMap [ usage || gl . STATIC_DRAW ] , type : dataTypeMap [ type || gl . UNSIGNED_BYTE ] , } ) ; } public get ( ) { return this . buffer ; } public destroy ( ) { } public subData ( { data , offset } ) { this . buffer . subdata ( data , offset ) ; } }