function enqueue(kind, batch) {
  // our stack index is out of position
  // => clean up all more recent batches
  this.refreshStack();
  const cmd = new Command(kind, batch);
  const type = this.getCommandKind(cmd);
  // free the texture from gpu, we dont need it anymore
  if (type === CommandKind.BATCH_OPERATION) {
    batch.destroyTexture();
  }
  const last = this.currentStackOperation();
  this.stack.push(cmd);
  this.redo();
  // delete last operation if it's mergable
  if (last !== null && last.kind === cmd.kind) {
    if (this.isMergeableOperation(cmd.kind)) {
      // delete last 2 commands
      this.stack.splice(this.sindex - 1, this.stack.length);
      this.sindex = this.stack.length - 1;
    }
  }
}
@param {Number} kind
@param {Batch} batch
@return {Void}