/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","./isWebGL2Context"],(function(t,e){"use strict";function _(t,e){if(e.compressedTextureETC)return null;const _=t.getExtension("WEBGL_compressed_texture_etc");return _?{COMPRESSED_R11_EAC:_.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:_.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:_.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:_.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:_.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:_.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:_.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function E(t,e){if(e.compressedTextureS3TC)return null;const _=t.getExtension("WEBGL_compressed_texture_s3tc");return _?{COMPRESSED_RGB_S3TC_DXT1:_.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:_.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:_.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:_.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function o(t,_){if(e(t))return{MIN:t.MIN,MAX:t.MAX};if(_.blendMinMax)return null;{const e=t.getExtension("EXT_blend_minmax");return e?{MIN:e.MIN_EXT,MAX:e.MAX_EXT}:null}}function n(t,e){if(e.textureFilterAnisotropic)return null;const _=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return _?{MAX_TEXTURE_MAX_ANISOTROPY:_.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:_.TEXTURE_MAX_ANISOTROPY_EXT}:null}function r(t,_){if(e(t))return{textureFloat:!0,textureFloatLinear:!_.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!0,textureHalfFloatLinear:!0,HALF_FLOAT:t.HALF_FLOAT,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F};if(t instanceof WebGLRenderingContext){const e=!_.textureHalfFloat&&t.getExtension("OES_texture_half_float");return{textureFloat:!_.textureFloat&&!!t.getExtension("OES_texture_float"),textureFloatLinear:!_.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!!e,textureHalfFloatLinear:!_.textureHalfFloatLinear&&!!t.getExtension("OES_texture_half_float_linear"),HALF_FLOAT:e?e.HALF_FLOAT_OES:void 0}}return null}function R(t,_){if(e(t)){const e=!_.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float")||!_.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),E=!_.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),o=!_.floatBlend&&!_.colorBufferFloat&&t.getExtension("EXT_float_blend");return e||E||o?{textureFloat:!!E,textureHalfFloat:!!e,floatBlend:!!o,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F}:null}if(t instanceof WebGLRenderingContext){const e=!_.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float"),E=!_.colorBufferFloat&&t.getExtension("WEBGL_color_buffer_float"),o=!_.floatBlend&&!_.colorBufferFloat&&t.getExtension("EXT_float_blend");return e||E||o?{textureFloat:!!E,textureHalfFloat:!!e,floatBlend:!!o,RGBA16F:e?e.RGBA16F_EXT:void 0,RGB16F:e?e.RGB16F_EXT:void 0,RGBA32F:E?E.RGBA32F_EXT:void 0}:null}return null}function l(t,_,E,o,n){if(o&&e(t))return!0;if(_[E])return!1;for(const e of n)if(t.getExtension(e))return!0;return!1}function u(t,_){if(!e(t))return null;if(_.textureNorm16)return null;const E=t.getExtension("EXT_texture_norm16");return E?{R16:E.R16_EXT,RG16:E.RG16_EXT,RGB16:E.RGB16_EXT,RGBA16:E.RGBA16_EXT,R16_SNORM:E.R16_SNORM_EXT,RG16_SNORM:E.RG16_SNORM_EXT,RGB16_SNORM:E.RGB16_SNORM_EXT,RGBA16_SNORM:E.RGBA16_SNORM_EXT}:null}t.loadBooleanExtension=l,t.loadColorBufferFloat=R,t.loadCompressedTextureETC=_,t.loadCompressedTextureS3TC=E,t.loadMinMaxBlending=o,t.loadTextureFilterAnisotropicCapability=n,t.loadTextureFloat=r,t.loadTextureNorm16=u,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
