import { Buffer, Device, InputLayoutBufferDescriptor, Program, RenderPass, RenderPipeline, InputLayout, Bindings, SwapChain, Texture, StencilOp, CompareFunction } from '@antv/g-device-api'; import { Entity } from '@lastolivegames/becsy'; import { RenderCache, Effect } from '../utils'; import { TexturePool } from '../resources'; import { API } from '../API'; import { RGGraphBuilder } from '../render-graph/interface'; export declare const ZINDEX_FACTOR = 100000; /** Stencil reference value for clipChildren: write (useStencil) and test (parentAsStencil) must use the same value. 0–255 for 8-bit stencil. */ export declare const STENCIL_CLIP_REF = 1; export declare abstract class Drawcall { #private; protected device: Device; protected swapChain: SwapChain; protected renderCache: RenderCache; protected texturePool: TexturePool; protected instanced: boolean; protected index: number; protected api: API; uid: number; shapes: Entity[]; /** * Create a new batch if the number of instances exceeds. */ protected maxInstances: number; geometryDirty: boolean; materialDirty: boolean; destroyed: boolean; protected program: Program; protected pipeline: RenderPipeline; /** When parent ClipMode is 'soft': program/pipeline for drawing outside the mask at reduced alpha. */ protected programSoftClipOutside: Program | null; protected pipelineSoftClipOutside: RenderPipeline | null; protected inputLayoutSoftClipOutside: InputLayout | null; protected bindingsSoftClipOutside: Bindings | null; protected inputLayout: InputLayout; protected bindings: Bindings; protected indexBuffer: Buffer; protected indexBufferData: Uint32Array; protected vertexBuffers: Buffer[]; protected vertexBufferDatas: Float32Array[]; protected vertexBufferOffsets: number[]; protected vertexBufferDescriptors: InputLayoutBufferDescriptor[]; protected barycentricBuffer: Buffer; protected barycentricBufferDescriptor: InputLayoutBufferDescriptor; constructor(device: Device, swapChain: SwapChain, renderCache: RenderCache, texturePool: TexturePool, instanced: boolean, index: number, api: API); abstract createGeometry(): void; abstract createMaterial(define: string, uniformBuffer: Buffer): void; abstract render(renderPass: RenderPass, uniformBuffer: Buffer, uniformLegacyObject: Record): void; destroy(): void; validate(shape: Entity): boolean; submit(renderPass: RenderPass, uniformBuffer: Buffer, uniformLegacyObject: Record, builder: RGGraphBuilder): void; add(shape: Entity): void; remove(shape: Entity): void; count(): number; protected get stencilDescriptor(): { stencilWrite: boolean; stencilFront: { compare: CompareFunction; passOp: StencilOp; failOp?: undefined; depthFailOp?: undefined; } | { compare: CompareFunction; passOp: StencilOp; failOp: StencilOp; depthFailOp: StencilOp; }; stencilBack: { compare: CompareFunction; passOp: StencilOp; failOp?: undefined; depthFailOp?: undefined; } | { compare: CompareFunction; passOp: StencilOp; failOp: StencilOp; depthFailOp: StencilOp; }; }; /** Stencil descriptor for the second pass when parent ClipMode is 'soft' (draw outside at reduced alpha). */ protected get stencilDescriptorForSoftOutside(): { stencilWrite: boolean; stencilFront: { compare: CompareFunction; passOp: StencilOp; }; stencilBack: { compare: CompareFunction; passOp: StencilOp; }; }; protected get useStencil(): boolean; protected get parentClipMode(): import("../components").ClipModeValue; /** When parent ClipMode is 'soft', alpha for content outside the mask (0–1). */ protected get parentOutsideAlpha(): number; protected get useWireframe(): boolean; protected get useFillImage(): boolean; protected createProgram(vert: string, frag: string, defines: string): void; protected generateWireframe(): void; protected createPostProcessing(effects: Effect[], inputTexture: Texture, width: number, height: number): { texture: Texture; }; protected renderPostProcessing(x: number, y: number, width: number, height: number, widthInCanvasCoords: number, heightInCanvasCoords: number, zoomScale: number): { resized: boolean; texture: Texture; }; protected createSampler(): import("@antv/g-device-api").Sampler; }