MCPcopy Index your code
hub / github.com/tensorflow/tfjs / createProgram

Method createProgram

tfjs-backend-webgl/src/gpgpu_context.ts:331–348  ·  view source on GitHub ↗
(fragmentShader: WebGLShader)

Source from the content-addressed store, hash-verified

329 }
330
331 public createProgram(fragmentShader: WebGLShader): GPGPUContextProgram {
332 this.throwIfDisposed();
333 const gl = this.gl;
334 if (this.vertexShader == null) {
335 this.vertexShader = gpgpu_util.createVertexShader(gl);
336 }
337 const program: WebGLProgram = webgl_util.createProgram(gl);
338 webgl_util.callAndCheck(
339 gl, () => gl.attachShader(program, this.vertexShader));
340 webgl_util.callAndCheck(gl, () => gl.attachShader(program, fragmentShader));
341 webgl_util.linkProgram(gl, program);
342
343 const program2 = Object.assign(program, {vao: this.createVertexArray()});
344 if (this.debug) {
345 webgl_util.validateProgram(gl, program2);
346 }
347 return program2;
348 }
349
350 public buildVao(program: GPGPUContextProgram) {
351 this.setProgram(program);

Callers 5

createProgramObjectsFunction · 0.80
parseAndEvaluateSnippetsFunction · 0.80
createProgramFunction · 0.80
compileProgramFunction · 0.80

Calls 2

throwIfDisposedMethod · 0.95
assignMethod · 0.80

Tested by

no test coverage detected