/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
class e{constructor(e,n,t){this.renderCommandContext=e,this.renderCommandBuffer=n,this.pipelineStateCommands=t}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const n of e)this.appendPipelineStateCommand(n)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(n,t=[]){return new e(n,n.createRenderCommandBuffer(),t)}}function n(e){if(0===e.length)return null;return e.reduce((e,n)=>(e.append(n),e))}export{e as PipelineCommand,n as joinCommands};
