"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module WebGL
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.createClearPickAndColorProgram = void 0;
const ViewportQuad_1 = require("./ViewportQuad");
const computeBaseColor = "return u_bgColor;";
const assignFragData = `
  FragColor0 = baseColor;
  FragColor1 = vec4(0.0);
  FragColor2 = vec4(0.0);
`;
/** @internal */
function createClearPickAndColorProgram(context) {
    const builder = (0, ViewportQuad_1.createViewportQuadBuilder)(false);
    const frag = builder.frag;
    frag.addUniform("u_bgColor", 5 /* VariableType.Vec4 */, (prog) => {
        prog.addProgramUniform("u_bgColor", (uniform, params) => {
            params.target.uniforms.style.bindBackgroundRgba(uniform);
        });
    });
    frag.set(1 /* FragmentShaderComponent.ComputeBaseColor */, computeBaseColor);
    frag.addDrawBuffersExtension(3);
    frag.set(16 /* FragmentShaderComponent.AssignFragData */, assignFragData);
    builder.vert.headerComment = "//!V! ClearPickAndColor";
    builder.frag.headerComment = "//!F! ClearPickAndColor";
    return builder.buildProgram(context);
}
exports.createClearPickAndColorProgram = createClearPickAndColorProgram;
//# sourceMappingURL=ClearPickAndColor.js.map