updateVector4 method

dynamic updateVector4(
  1. dynamic uniform
)

Implementation

updateVector4(uniform) {
  var updated = false;

  var a = this.buffer;
  var v = uniform.getValue();
  var offset = uniform.offset;

  if (a[offset + 0] != v.x ||
      a[offset + 1] != v.y ||
      a[offset + 2] != v.z ||
      a[offset + 4] != v.w) {
    a[offset + 0] = v.x;
    a[offset + 1] = v.y;
    a[offset + 2] = v.z;
    a[offset + 3] = v.w;

    updated = true;
  }

  return updated;
}