The current OS compositor implementation on macOS creates a separate depth buffer for each allocated IOSurface. This wastes a lot of memory: The depth buffer is only used during rendering within a tile. Once rendering is done, it has no useful output. At a minimum, we should share depth buffers between the IOSurfaces of the same tile (i.e. across the swap chain). But since we're also drawing to one tile at a time, we could even share depth buffers between all tiles of the same size. We just need to add a comment to the `Compositor` trait that says that depth buffer contents are not preserved between draws, and that the depth buffer contents of a freshly-bound surface needs to be considered garbage and should be cleared before it is used.
Bug 1592038 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
The current OS compositor implementation on macOS creates a separate depth buffer for each allocated IOSurface. This wastes a lot of memory: The depth buffer is only used during rendering within a tile. Once rendering is done, it has no useful output. At a minimum, we should share depth buffers between the IOSurfaces of the same tile (i.e. across the tile's swap chain). But since we're also drawing to one tile at a time, we could even share depth buffers between all tiles of the same size. We just need to add a comment to the `Compositor` trait that says that depth buffer contents are not preserved between draws, and that the depth buffer contents of a freshly-bound surface needs to be considered garbage and should be cleared before it is used.
The current OS compositor implementation on macOS creates a separate depth buffer for each allocated IOSurface. This wastes a lot of memory: The depth buffer is only used during rendering within a tile. Once rendering is done, it has no useful output. At a minimum, we should share depth buffers between the IOSurfaces of the same tile (i.e. across the tile's swap chain). But since we're also drawing to one tile at a time, we could even share depth buffers between all tiles of the same size. We just need to add a comment to the `Compositor` trait that says that depth buffer contents are not preserved between draws, and that the depth buffer contents of a freshly-bound surface needs to be considered garbage and should be cleared before use.