/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
class r{constructor(r,e,t,a,i){this.minFilter=r,this.magFilter=e,this.wrapS=t,this.wrapT=a,this.maxAnisotropy=i}get key(){return`${this.minFilter}|${this.magFilter}|${this.wrapS}|${this.wrapT}|${this.maxAnisotropy}`}}class e{constructor(r,e){this.gl=r,this.descriptor=e;const t=r.createSampler();if(r.samplerParameteri(t,r.TEXTURE_COMPARE_MODE,r.NONE),r.samplerParameteri(t,r.TEXTURE_MIN_FILTER,e.minFilter),r.samplerParameteri(t,r.TEXTURE_MAG_FILTER,e.magFilter),r.samplerParameteri(t,r.TEXTURE_WRAP_S,e.wrapS),r.samplerParameteri(t,r.TEXTURE_WRAP_T,e.wrapT),r.samplerParameteri(t,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),r.samplerParameterf(t,r.TEXTURE_MAX_LOD,1e3),r.samplerParameterf(t,r.TEXTURE_MIN_LOD,-1e3),void 0!==e.maxAnisotropy){const a=r.getExtension("EXT_texture_filter_anisotropic");a&&r.samplerParameterf(t,a.TEXTURE_MAX_ANISOTROPY_EXT,e.maxAnisotropy)}this.glName=t}dispose(){this.gl.deleteSampler(this.glName),this.glName=null}get key(){return this.descriptor.key}}export{e as Sampler,r as SamplerDescriptor};
