-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ownership of color texture when creating a frame buffer (#1378)
The changes in BabylonJS/Babylon.js#15052 exposes a problem in native where the output texture of the BRDF post process will be destroyed causing a crash in bgfx. In the previous code, the `NativeEngine::CreateFrameBuffer` took ownership of the color texture passed in as an argument. This is wrong because the texture might still be needed after the frame buffer dies. Specifically, [the BRDF post process that expands the RGBD env texture](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Misc/rgbdTextureTools.ts#L98) is where it fails. The new code will not take ownership of the color texture but will still delete the generated depth/stencil texture in the finalizer if necessary. The calling code will destroy the color texture when appropriate.
- Loading branch information
Showing
4 changed files
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters