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

Class GlProgramImpl

gpu-pipeline/webgl/gl-class.js:46–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45// A wrapper class for WebGL program and its utility functions.
46class GlProgramImpl {
47 constructor(gl, program) {
48 this.gl_ = gl;
49 this.program_ = program;
50 this.cachedUniformLocations_ = new Map();
51 }
52
53 useProgram() {
54 this.gl_.useProgram(this.program_);
55 }
56
57 getUniformLocation(symbol) {
58 if (this.cachedUniformLocations_.has(symbol)) {
59 return this.cachedUniformLocations_.get(symbol);
60 } else {
61 const location = this.gl_.getUniformLocation(this.program_, symbol);
62 this.cachedUniformLocations_.set(symbol, location);
63 return location;
64 }
65 }
66}
67
68// Utility class for drawing.
69class FullscreenQuad {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected