Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GL3+] Fix destruction of RenderTextures destroying regular Textures
destroyInternalResourcesImpl was only being called from within GL3PlusTextureGpu's destructor. However it is a virtual call, and thus GL3PlusTextureGpuRenderTarget::destroyInternalResourcesImpl would never get called. This led GL3PlusTextureGpu::destroyInternalResourcesImpl to believe there is a regular Texture in mFinalTextureName, because derived class never got to zero it out. To trigger this scenario: * The RenderTexture had to be a depth buffer or be created with the NotTexture flag * The TextureGpu must be destroyed without having been transitioned to non-resident * A regular texture and a RenderTarget had both been asigned the same mFinalTextureName handle value (one is a glRenderbuffer, the other a glTexture) Although the conditions are hard to trigger, the fix for shared depth buffers leaking (#103) skyrocketed the likehood of encountering this bug
- Loading branch information