/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{releaseMaybe as t}from"../../../../../core/maybe.js";import{isPromiseLike as e}from"../../../../../core/promiseUtils.js";class s{constructor(s,r){this._textures=s,this.loadPromise=null,this._disposed=!1;const i=this._textures.acquire(r);e(i)?(i.then(e=>{this._disposed?t(e):this._textureRef=e}),this.loadPromise=i):this._textureRef=i}dispose(){this._textureRef=t(this._textureRef),this._disposed=!0}get texture(){return this._textureRef?.texture}}export{s as RenderTexture};
