/*---------------------------------------------------------------------------------------------
* 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
 */
/* eslint-disable no-restricted-syntax */
/** @internal */
export var Pass;
(function (Pass) {
    /** Return the RenderPass corresponding to the specified Pass. */
    function toRenderPass(pass) {
        switch (pass) {
            case "skybox": return 14 /* RenderPass.SkyBox */;
            case "opaque": return 5 /* RenderPass.OpaqueGeneral */;
            case "opaque-linear": return 2 /* RenderPass.OpaqueLinear */;
            case "opaque-planar": return 3 /* RenderPass.OpaquePlanar */;
            case "translucent": return 8 /* RenderPass.Translucent */;
            case "point-clouds": return 4 /* RenderPass.PointClouds */;
            case "view-overlay": return 13 /* RenderPass.ViewOverlay */;
            case "classification": return 6 /* RenderPass.Classification */;
            case "none": return 255 /* RenderPass.None */;
        }
    }
    Pass.toRenderPass = toRenderPass;
    /** Return true if the specified Pass renders during RenderPass.Translucent.
     * @note It is possible for both [[rendersTranslucent]] and [[rendersOpaque]] to return true (or false) for a given Pass.
     */
    function rendersTranslucent(pass) {
        switch (pass) {
            case "translucent":
            case "opaque-translucent":
            case "opaque-planar-translucent":
                return true;
            default:
                return false;
        }
    }
    Pass.rendersTranslucent = rendersTranslucent;
    /** Return true if the specified Pass renders during one of the opaque RenderPasses.
     * @note It is possible for both [[rendersTranslucent]] and [[rendersOpaque]] to return true for a given Pass.
     */
    function rendersOpaque(pass) {
        switch (pass) {
            case "opaque-translucent":
            case "opaque-planar-translucent":
            case "opaque":
            case "opaque-planar":
            case "opaque-linear":
            case "point-clouds":
                return true;
            default:
                return false;
        }
    }
    Pass.rendersOpaque = rendersOpaque;
    /** Return true if the specified Pass renders both during RenderPass.Translucent and one of the opaque RenderPasses. */
    function rendersOpaqueAndTranslucent(pass) {
        return "opaque-translucent" === pass || "opaque-planar-translucent" === pass;
    }
    Pass.rendersOpaqueAndTranslucent = rendersOpaqueAndTranslucent;
    function toOpaquePass(pass) {
        return "opaque-translucent" === pass ? 5 /* RenderPass.OpaqueGeneral */ : 3 /* RenderPass.OpaquePlanar */;
    }
    Pass.toOpaquePass = toOpaquePass;
})(Pass || (Pass = {}));
/** Reserved texture units for specific sampler variables, to avoid conflicts between shader components which each have their own textures.
 * WebGL 2 guarantees a minimum of 16 vertex texture units.
 * @internal
 */
export var TextureUnit;
(function (TextureUnit) {
    // For shaders which know exactly which textures will be used
    TextureUnit[TextureUnit["Zero"] = WebGLRenderingContext.TEXTURE0] = "Zero";
    TextureUnit[TextureUnit["One"] = WebGLRenderingContext.TEXTURE1] = "One";
    TextureUnit[TextureUnit["Two"] = WebGLRenderingContext.TEXTURE2] = "Two";
    TextureUnit[TextureUnit["Three"] = WebGLRenderingContext.TEXTURE3] = "Three";
    TextureUnit[TextureUnit["Four"] = WebGLRenderingContext.TEXTURE4] = "Four";
    TextureUnit[TextureUnit["Five"] = WebGLRenderingContext.TEXTURE5] = "Five";
    TextureUnit[TextureUnit["Six"] = WebGLRenderingContext.TEXTURE6] = "Six";
    TextureUnit[TextureUnit["Seven"] = WebGLRenderingContext.TEXTURE7] = "Seven";
    TextureUnit[TextureUnit["ClipVolume"] = TextureUnit.Zero] = "ClipVolume";
    TextureUnit[TextureUnit["FeatureSymbology"] = TextureUnit.One] = "FeatureSymbology";
    TextureUnit[TextureUnit["SurfaceTexture"] = TextureUnit.Two] = "SurfaceTexture";
    TextureUnit[TextureUnit["LineCode"] = TextureUnit.Two] = "LineCode";
    TextureUnit[TextureUnit["PickFeatureId"] = TextureUnit.Three] = "PickFeatureId";
    TextureUnit[TextureUnit["PickDepthAndOrder"] = TextureUnit.Four] = "PickDepthAndOrder";
    TextureUnit[TextureUnit["VertexLUT"] = TextureUnit.Five] = "VertexLUT";
    // Texture unit 6 is overloaded. Therefore classification, hilite classification, and aux channel are all mutually exclusive.
    TextureUnit[TextureUnit["AuxChannelLUT"] = TextureUnit.Six] = "AuxChannelLUT";
    TextureUnit[TextureUnit["PlanarClassification"] = TextureUnit.Six] = "PlanarClassification";
    TextureUnit[TextureUnit["PlanarClassificationHilite"] = TextureUnit.Six] = "PlanarClassificationHilite";
    // Texture unit 7 is overloaded. Therefore receiving shadows and thematic display are mutually exclusive.
    TextureUnit[TextureUnit["ShadowMap"] = TextureUnit.Seven] = "ShadowMap";
    TextureUnit[TextureUnit["ThematicSensors"] = TextureUnit.Seven] = "ThematicSensors";
    // Textures used for up to 6 background or overlay map layers.
    TextureUnit[TextureUnit["RealityMesh0"] = TextureUnit.Two] = "RealityMesh0";
    TextureUnit[TextureUnit["RealityMesh1"] = TextureUnit.VertexLUT] = "RealityMesh1";
    TextureUnit[TextureUnit["RealityMesh2"] = TextureUnit.ShadowMap] = "RealityMesh2";
    TextureUnit[TextureUnit["RealityMesh3"] = WebGLRenderingContext.TEXTURE8] = "RealityMesh3";
    TextureUnit[TextureUnit["RealityMesh4"] = WebGLRenderingContext.TEXTURE9] = "RealityMesh4";
    TextureUnit[TextureUnit["RealityMesh5"] = WebGLRenderingContext.TEXTURE10] = "RealityMesh5";
    TextureUnit[TextureUnit["RealityMeshThematicGradient"] = WebGLRenderingContext.TEXTURE11] = "RealityMeshThematicGradient";
    // Lookup table for indexed edges.
    TextureUnit[TextureUnit["EdgeLUT"] = WebGLRenderingContext.TEXTURE12] = "EdgeLUT";
    // Normal map texture.
    TextureUnit[TextureUnit["NormalMap"] = WebGLRenderingContext.TEXTURE13] = "NormalMap";
    // Contours texture.
    TextureUnit[TextureUnit["Contours"] = WebGLRenderingContext.TEXTURE14] = "Contours";
    // Surface Draping textures.
    TextureUnit[TextureUnit["SurfaceDraping0"] = TextureUnit.RealityMesh3] = "SurfaceDraping0";
    TextureUnit[TextureUnit["SurfaceDraping1"] = TextureUnit.RealityMesh4] = "SurfaceDraping1";
    TextureUnit[TextureUnit["SurfaceDraping2"] = TextureUnit.RealityMesh5] = "SurfaceDraping2";
    TextureUnit[TextureUnit["SurfaceDraping3"] = TextureUnit.RealityMeshThematicGradient] = "SurfaceDraping3";
    TextureUnit[TextureUnit["SurfaceDraping4"] = WebGLRenderingContext.TEXTURE15] = "SurfaceDraping4";
    TextureUnit[TextureUnit["SurfaceDraping5"] = WebGLRenderingContext.TEXTURE16] = "SurfaceDraping5";
})(TextureUnit || (TextureUnit = {}));
/** @internal */
export function isPlanar(order) {
    return order >= 8 /* RenderOrder.PlanarBit */;
}
//# sourceMappingURL=RenderFlags.js.map