658700ddffae2c4e576cd519e2bc4878106a8dcd
For Metal we can change the texture usage flags to get more optimal behaviour - one example is adding the attachment flag so we can utilise renders to do texture clears. However these usage flags are used as the part of the match-criteria when trying to reuse released textures in the texture pool. The modifications means a request for the same type of texture will fail causing a cache miss. When we render to an image-view the texture pool is not released until the final sample has been rendered as we consider the entire render to be a single frame (as opposed to normal viewport rendering when we are presenting the intermediate results). This causes the texture pool to grow and grow and grow hence the large memory usage. This fix splits the usage flags into two sets, the internal ones we use to create the MTLTexture (which we may modify) and the originally requested ones. The originally requested ones are used for the texture pool matching. This fix also improves memory efficiency for normal viewport rendering. Mr Elephant Scene Before -> After Load scene in viewport: 13.04Gb -> 9.15 Gb Viewport Render Image: 78.69Gb -> 16.61Gb Authored by Apple: James McCarthy Pull Request: https://projects.blender.org/blender/blender/pulls/129951
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
