MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / setUniform

Method setUniform

gpu-pipeline/webgl/gl-class.js:116–128  ·  view source on GitHub ↗
(name, vec)

Source from the content-addressed store, hash-verified

114 this.program.useProgram();
115 }
116 setUniform(name, vec) {
117 const gl = this.gl;
118 const loc = this.program.getUniformLocation(name);
119 if (vec.length === 1) {
120 gl.uniform1fv(loc, vec);
121 } else if (vec.length === 2) {
122 gl.uniform2fv(loc, vec);
123 } else if (vec.length === 3) {
124 gl.uniform3fv(loc, vec);
125 } else if (vec.length === 4) {
126 gl.uniform4fv(loc, vec);
127 }
128 }
129 bindTextures(textures) {
130 const gl = this.gl;
131 let textureId = 0;

Callers

nothing calls this directly

Calls 1

getUniformLocationMethod · 0.80

Tested by

no test coverage detected