gfx 各个类的源码解读(5) WebGL2CommandAllocator

gfx 各个类的源码解读(5) WebGL2CommandAllocator
WebGL2CommandAllocator 在 webgl2-command-allocator.ts
  WebGL2CommandPool(见下文) 缓存(回收的)各种WebGL2CmdObject对象

成员变量:
//以下分别对应WebGL2Cmd子类的pool

    public beginRenderPassCmdPool: WebGL2CommandPool<WebGL2CmdBeginRenderPass>;
    public bindStatesCmdPool: WebGL2CommandPool<WebGL2CmdBindStates>;
    public drawCmdPool: WebGL2CommandPool<WebGL2CmdDraw>;
    public updateBufferCmdPool: WebGL2CommandPool<WebGL2CmdUpdateBuffer>;
    public copyBufferToTextureCmdPool: WebGL2CommandPool<WebGL2CmdCopyBufferToTexture>;

成员函数:

clearCmds (cmdPackage: WebGL2CmdPackage)
  pool回收WebGL2CmdPackage的各种WebGL2CmdObject对象

releaseCmds
  释放Pool里的缓存对象

WebGL2CommandPool类

  分配和回收缓存一种WebGL2CmdObject子类对象

成员函数:
alloc
  创建WebGL2CmdObject子类对象
free (cmd: T)
freeCmds (cmds: CachedArray)
  回收一个或多个WebGL2CmdObject子类
release()
  释放pool,释放WebGL2CmdObject子类对象