is it ok for sprite1 ?Yes.
does the texture::operator= really duplicate textures in GPU memory ?Yes.
And what about the return of RenderTexture::GetTexture(), if I use it once the render texture is destroyed ?If you copy it then it's safe, if you keep a reference on it then you have UB, like with any other destroyed variable that you'd try to access through a pointer or reference.
If you copy it then it's safe, if you keep a reference on it then you have UB, like with any other destroyed variable that you'd try to access through a pointer or reference.