Examples
const program = createProgramFromSrc(gl, vertexSource, fragmentSource, attributes)
validateProgram(gl, program)Function
createProgramFromSrc(gl: WebGL2RenderingContext, vertex: string, fragment: string, attributemap: Readonly<Map<string, MeshAttribute>>): WebGLProgramCompiles vertex and fragment source, then creates a linked WebGL program.
The helper passes gl.VERTEX_SHADER and gl.FRAGMENT_SHADER to
createShader; these are the WebGL values represented by the vertex
and fragment entries of ShaderStage. It then delegates to
createProgram, so attribute locations come from the supplied
MeshAttribute descriptors in attributemap.
Shader compilation and program linking are requested, but their status is
not checked here. Use validateShader and validateProgram when
diagnostics are needed. The helper also does not make the program current or
delete the temporary shader objects.
const program = createProgramFromSrc(gl, vertexSource, fragmentSource, attributes)
validateProgram(gl, program)