setValueM2 method

void setValueM2(
  1. RenderingContext gl,
  2. dynamic v, [
  3. WebGLTextures? textures
])

Implementation

void setValueM2(RenderingContext gl, v, [WebGLTextures? textures]) {
  final cache = this.cache;
  final elements = v?.storage;

  if (elements == null) {
    if (arraysEqual(cache, v)) return;

    gl.uniformMatrix2fv(addr, false, v);

    copyArray(cache, v);
  } else {
    if (arraysEqual(cache, elements)) return;

    //mat2array.set(List<double>.from(elements.map((e) => e.toDouble())), 0);

    gl.uniformMatrix2fv(addr, false, mat2array);

    copyArray(cache, elements);
  }
}