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

Method bindTextures

gpu-pipeline/webgl/gl-class.js:129–142  ·  view source on GitHub ↗
(textures)

Source from the content-addressed store, hash-verified

127 }
128 }
129 bindTextures(textures) {
130 const gl = this.gl;
131 let textureId = 0;
132 for (const [name, tex] of textures) {
133 const loc = this.program.getUniformLocation(name);
134 // Make the textureId unit active.
135 gl.activeTexture(gl.TEXTURE0 + textureId);
136 // Binds the texture to a TEXTURE_2D target.
137 tex.bindTexture();
138 // Binds the texture at given location to texture unit textureId.
139 gl.uniform1i(loc, textureId);
140 textureId++;
141 }
142 }
143 finalizeProcessFrame() {
144 this.frame.bindFramebuffer();
145 this.quad.draw();

Callers 1

processMethod · 0.80

Calls 2

getUniformLocationMethod · 0.80
bindTextureMethod · 0.80

Tested by

no test coverage detected