docs: function _commitBlendStates(gl, cur, next) {
    // enable/disable blend
    if (cur.blend !== next.blend) {
      if (!next.blend) {
        gl.disable(gl.BLEND);
        return;
      }
  
      gl.enable(gl.BLEND);
  
      if (
        next.blendSrc === enums.BLEND_CONSTANT_COLOR ||
        next.blendSrc === enums.BLEND_ONE_MINUS_CONSTANT_COLOR ||
        next.blendDst === enums.BLEND_CONSTANT_COLOR ||
        next.blendDst === enums.BLEND_ONE_MINUS_CONSTANT_COLOR
      ) {
        gl.blendColor(
          (next.blendColor >> 24) / 255,
          (next.blendColor >> 16 & 0xff) / 255,
          (next.blendColor >> 8 & 0xff) / 255,
          (next.blendColor & 0xff) / 255
        );
      }
  
      if (next.blendSep) {
        gl.blendFuncSeparate(next.blendSrc, next.blendDst, next.blendSrcAlpha, next.blendDstAlpha);
        gl.blendEquationSeparate(next.blendEq, next.blendAlphaEq);
      } else {
        gl.blendFunc(next.blendSrc, next.blendDst);
        gl.blendEquation(next.blendEq);
      }
  
      return;
    }
  
    // nothing to update
    if (next.blend === false) {
      return;
    }
  
    // blend-color
    if (cur.blendColor !== next.blendColor) {
      gl.blendColor(
        (next.blendColor >> 24) / 255,
        (next.blendColor >> 16 & 0xff) / 255,
        (next.blendColor >> 8 & 0xff) / 255,
        (next.blendColor & 0xff) / 255
      );
    }
  
    // separate diff, reset all
    if (cur.blendSep !== next.blendSep) {
      if (next.blendSep) {
        gl.blendFuncSeparate(next.blendSrc, next.blendDst, next.blendSrcAlpha, next.blendDstAlpha);
        gl.blendEquationSeparate(next.blendEq, next.blendAlphaEq);
      } else {
        gl.blendFunc(next.blendSrc, next.blendDst);
        gl.blendEquation(next.blendEq);
      }
  
      return;
    }
  
    if (next.blendSep) {
      // blend-func-separate
      if (
        cur.blendSrc !== next.blendSrc ||
        cur.blendDst !== next.blendDst ||
        cur.blendSrcAlpha !== next.blendSrcAlpha ||
        cur.blendDstAlpha !== next.blendDstAlpha
      ) {
        gl.blendFuncSeparate(next.blendSrc, next.blendDst, next.blendSrcAlpha, next.blendDstAlpha);
      }
  
      // blend-equation-separate
      if (
        cur.blendEq !== next.blendEq ||
        cur.blendAlphaEq !== next.blendAlphaEq
      ) {
        gl.blendEquationSeparate(next.blendEq, next.blendAlphaEq);
      }
    } else {
      // blend-func
      if (
        cur.blendSrc !== next.blendSrc ||
        cur.blendDst !== next.blendDst
      ) {
        gl.blendFunc(next.blendSrc, next.blendDst);
      }
  
      // blend-equation
      if (cur.blendEq !== next.blendEq) {
        gl.blendEquation(next.blendEq);
      }
    }
  }