import type { Device } from '@antv/g-device-api'; import type { IModel, IModelDrawOptions, IModelInitializationOptions, IUniform } from '@antv/l7-core'; import type DeviceRendererService from '.'; export default class DeviceModel implements IModel { private device; private options; private service; private destroyed; private uniforms; private program; private inputLayout; private pipeline; private indexBuffer; private vertexBuffers; private bindings; private pipelineCache; private currentPipelineKey; constructor(device: Device, options: IModelInitializationOptions, service: DeviceRendererService); /** * 生成 Pipeline 缓存键,用于判断是否需要重新创建 Pipeline * 包含所有影响 Pipeline 创建的参数 * 注意:当 blend/stencil 禁用时,使用简化的 key 以避免创建重复 Pipeline */ private getPipelineKey; private createPipeline; updateAttributesAndElements(): void; /** * No need to implement this method, you should update data on `Attribute` like this: * * @example * ```ts * attribute.updateBuffer({ * data: [], * offset: 0, * }); * ``` */ updateAttributes(): void; addUniforms(uniforms: { [key: string]: IUniform; }): void; draw(options: IModelDrawOptions, pick?: boolean): void; destroy(): void; private initDepthDrawParams; private getBlendDrawParams; /** * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#stencil */ private getStencilDrawParams; /** * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#culling */ private initCullDrawParams; /** * 考虑结构体命名, eg: * a: { b: 1 } -> 'a.b' * a: [ { b: 1 } ] -> 'a[0].b' */ private extractUniforms; private extractUniformsRecursively; }