function ShaderBuilder() {
  // Some WebGL implementations require attribute 0 to always
  // be active, so the position attribute is tracked separately
  this._positionAttributeLine = undefined;
  this._nextAttributeLocation = 1;
  this._attributeLocations = {};
  this._attributeLines = [];

  // Dynamically-generated structs and functions
  // these are dictionaries of id -> ShaderStruct or ShaderFunction respectively
  this._structs = {};
  this._functions = {};

  this._vertexShaderParts = {
    defineLines: [],
    uniformLines: [],
    shaderLines: [],
    varyingLines: [],
    // identifiers of structs/functions to include, listed in insertion order
    structIds: [],
    functionIds: [],
  };
  this._fragmentShaderParts = {
    defineLines: [],
    uniformLines: [],
    shaderLines: [],
    varyingLines: [],
    // identifiers of structs/functions to include, listed in insertion order
    structIds: [],
    functionIds: [],
  };
}
An object that makes it easier to build the text of a {@link ShaderProgram}. This tracks GLSL code for both the vertex shader and the fragment shader.
<p>
For vertex shaders, the shader builder tracks a list of <code>#defines</code>,
a list of attributes, a list of uniforms, and a list of shader lines. It also
tracks the location of each attribute so the caller can easily build the {@link VertexArray}
</p>
<p>
For fragment shaders, the shader builder tracks a list of <code>#defines</code>,
a list of attributes, a list of uniforms, and a list of shader lines.
</p>

@alias ShaderBuilder
@constructor

@example
const shaderBuilder = new ShaderBuilder();
shaderBuilder.addDefine("SOLID_COLOR", undefined, ShaderDestination.FRAGMENT);
shaderBuilder.addUniform("vec3", "u_color", ShaderDestination.FRAGMENT);
shaderBuilder.addVarying("vec3", v_color");
// These locations can be used when creating the VertexArray
const positionLocation = shaderBuilder.addPositionAttribute("vec3", "a_position");
const colorLocation = shaderBuilder.addAttribute("vec3", "a_color");
shaderBuilder.addVertexLines([
 "void main()",
 "{",
 "    v_color = a_color;",
 "    gl_Position = vec4(a_position, 1.0);",
 "}"
]);
shaderBuilder.addFragmentLines([
 "void main()",
 "{",
 "    #ifdef SOLID_COLOR",
 "    out_FragColor = vec4(u_color, 1.0);",
 "    #else",
 "    out_FragColor = vec4(v_color, 1.0);",
 "    #endif",
 "}"
]);
const shaderProgram = shaderBuilder.build(context);

@private