_setParent() {
        // prepare texture sampler
        this._sampler.name = this._samplerName || "uSampler" + this.index;

        // we will always declare a texture matrix
        this._textureMatrix.name = this._samplerName ? this._samplerName + "Matrix" : "uTextureMatrix" + this.index;

        // if the parent has a program it means its not a render target texture
        if(this._parent._program) {
            if(!this._parent._program.compiled) {
                if(!this.renderer.production) {
                    throwWarning(this.type + ": Unable to create the texture because the program is not valid");
                }

                return;
            }

            // set uniform
            this._setTextureUniforms();

            if(this._copyOnInit) {
                // wait for original texture to be ready before copying it
                const waitForOriginalTexture = this.renderer.nextRender.add(() => {
                    if(this._copiedFrom._canDraw && this._copiedFrom._uploaded) {
                        this.copy(this._copiedFrom);
                        waitForOriginalTexture.keep = false;
                    }
                }, true);

                // we're done!
                return;
            }

            if(!this.source) {
                // set its size based on parent element size for now
                this._size = {
                    width: this._parent._boundingRect.document.width,
                    height: this._parent._boundingRect.document.height,
                };
            }
            else if(this._parent.loader) {
                // we're adding a parent to a texture that already has a source
                // it means the source should have been loaded before the parent was set
                // add it to the right asset array if needed
                this._parent.loader._addSourceToParent(this.source, this.sourceType);
            }

            this._setSize();
        }
        else if(this._parent.type === "RenderTarget") {
            // its a render target texture, it has no uniform location and no texture matrix
            this._size = {
                width: this._parent._size && this._parent._size.width || this.renderer._boundingRect.width,
                height: this._parent._size && this._parent._size.height || this.renderer._boundingRect.height,
            };

            // updload to gpu
            this._upload();

            // update render texture parameters because it will never be drawn (hence not called)
            this._updateTexParameters();

            this._canDraw = true;
        }
    }
Sets the parent
     Basically sets the uniforms names and locations and sizes
*