/** @packageDocumentation
 * @module WebGL
 */
import { WebGLDisposable } from "./Disposable";
import { DrawCommands, DrawParams } from "./DrawCommand";
import { RenderPass } from "./RenderFlags";
import { ProgramBuilder } from "./ShaderBuilder";
import { ShaderProgram } from "./ShaderProgram";
import { Target } from "./Target";
import { FeatureMode, IsClassified, IsInstanced, PositionType, TechniqueFlags } from "./TechniqueFlags";
import { TechniqueId } from "./TechniqueId";
/** Defines a rendering technique implemented using one or more shader programs.
 * @internal
 */
export interface Technique extends WebGLDisposable {
    getShader(flags: TechniqueFlags): ShaderProgram;
    getShaderByIndex(index: number): ShaderProgram;
    getShaderCount(): number;
    compileShaders(): boolean;
}
/** A rendering technique implemented using a single shader program, typically for some specialized purpose.
 * @internal
 */
export declare class SingularTechnique implements Technique {
    readonly program: ShaderProgram;
    constructor(program: ShaderProgram);
    getShader(_flags: TechniqueFlags): ShaderProgram;
    getShaderByIndex(_index: number): ShaderProgram;
    getShaderCount(): number;
    compileShaders(): boolean;
    get isDisposed(): boolean;
    [Symbol.dispose](): void;
    /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */
    dispose(): void;
}
type CreateHiliter = (instanced: IsInstanced, classified: IsClassified, posType: PositionType) => ProgramBuilder;
/** A rendering technique implemented using multiple shader programs, selected based on TechniqueFlags.
 * @internal
 */
export declare abstract class VariedTechnique implements Technique {
    private readonly _basicPrograms;
    private readonly _clippingPrograms;
    /** TechniqueFlags identifying shader programs for which the fragment shader writes depth but does not contain any discards.
     * Buggy Intel HD 620/630 drivers incorrectly apply early-Z optimization in this case; we must insert a never-executed
     * conditional discard to prevent that.
     */
    protected _earlyZFlags: TechniqueFlags[];
    compileShaders(): boolean;
    protected finishConstruction(): void;
    private _isDisposed;
    get isDisposed(): boolean;
    [Symbol.dispose](): void;
    /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */
    dispose(): void;
    protected constructor(numPrograms: number);
    protected abstract computeShaderIndex(flags: TechniqueFlags): number;
    protected abstract get _debugDescription(): string;
    protected addShader(builder: ProgramBuilder, flags: TechniqueFlags, gl: WebGL2RenderingContext): void;
    private addProgram;
    protected addHiliteShader(gl: WebGL2RenderingContext, instanced: IsInstanced, classified: IsClassified, posType: PositionType, create: CreateHiliter): void;
    protected addTranslucentShader(builder: ProgramBuilder, flags: TechniqueFlags, gl: WebGL2RenderingContext): void;
    protected addFeatureId(builder: ProgramBuilder, feat: FeatureMode): void;
    private getShaderIndex;
    getShader(flags: TechniqueFlags): ShaderProgram;
    getShaderByIndex(index: number): ShaderProgram;
    getShaderCount(): number;
    /** For tests. */
    forEachProgram(func: (program: ShaderProgram) => void): void;
}
/** A collection of rendering techniques accessed by ID.
 * @internal
 */
export declare class Techniques implements WebGLDisposable {
    private readonly _list;
    private readonly _dynamicTechniqueIds;
    private _techniqueByPriorityIndex;
    private _shaderIndex;
    static create(gl: WebGL2RenderingContext): Techniques;
    getTechnique(id: TechniqueId): Technique;
    get numTechniques(): number;
    addDynamicTechnique(technique: Technique, name: string): TechniqueId;
    getDynamicTechniqueId(name: string): TechniqueId | undefined;
    /** Execute each command in the list */
    execute(target: Target, commands: DrawCommands, renderPass: RenderPass): void;
    /** Execute the commands for a single given classification primitive (the first 3 commands should be a push, the primitive, then a pop) */
    executeForIndexedClassifier(target: Target, cmdsByIndex: DrawCommands, renderPass: RenderPass): void;
    /** Draw a single primitive. Usually used for special-purpose rendering techniques. */
    draw(params: DrawParams): void;
    get isDisposed(): boolean;
    [Symbol.dispose](): void;
    /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */
    dispose(): void;
    compileShaders(): boolean;
    /** Compile shader of next highest priority. Called when possible during an idle situation before any viewports exist. */
    idleCompileNextShader(): boolean;
    /** For tests. */
    forEachVariedProgram(func: (program: ShaderProgram) => void): void;
    private constructor();
    private initializeBuiltIns;
}
export {};
//# sourceMappingURL=Technique.d.ts.map