A cache for the onscreen texture attachments used in surface_mtl. More...
#include <swapchain_transients_mtl.h>
Public Member Functions | |
SwapchainTransientsMTL (const std::shared_ptr< Allocator > &allocator) | |
~SwapchainTransientsMTL () | |
void | SetSizeAndFormat (ISize size, PixelFormat format) |
Update the size and pixel format of the onscreens. More... | |
std::shared_ptr< Texture > | GetResolveTexture () |
Retrieve the resolve texture, creating one if needed. More... | |
std::shared_ptr< Texture > | GetMSAATexture () |
Retrieve the MSAA texture, creating one if needed. More... | |
std::shared_ptr< Texture > | GetDepthStencilTexture () |
Retrieve the depth+stencil texture, creating one if needed. More... | |
A cache for the onscreen texture attachments used in surface_mtl.
Typically the onscreen resolve texture is created from a Metal drawable and this cache is only used for the MSAA texture and the depth+stencil attachment. When partial repaint is active, this class also provides a cache for an offscreen resolve texture that is blitted to the real onscreen during present.
Definition at line 25 of file swapchain_transients_mtl.h.
|
explicit |
Definition at line 12 of file swapchain_transients_mtl.mm.
|
default |
std::shared_ptr< Texture > impeller::SwapchainTransientsMTL::GetDepthStencilTexture | ( | ) |
Retrieve the depth+stencil texture, creating one if needed.
Definition at line 71 of file swapchain_transients_mtl.mm.
References impeller::TextureDescriptor::format, impeller::kCount4, impeller::kD32FloatS8UInt, impeller::kDeviceTransient, impeller::kRenderTarget, impeller::kTexture2DMultisample, impeller::TextureDescriptor::sample_count, impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, and VALIDATION_LOG.
std::shared_ptr< Texture > impeller::SwapchainTransientsMTL::GetMSAATexture | ( | ) |
Retrieve the MSAA texture, creating one if needed.
Definition at line 50 of file swapchain_transients_mtl.mm.
References impeller::TextureDescriptor::format, impeller::kCount4, impeller::kDeviceTransient, impeller::kRenderTarget, impeller::kTexture2DMultisample, impeller::TextureDescriptor::sample_count, impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, and VALIDATION_LOG.
std::shared_ptr< Texture > impeller::SwapchainTransientsMTL::GetResolveTexture | ( | ) |
Retrieve the resolve texture, creating one if needed.
Definition at line 28 of file swapchain_transients_mtl.mm.
References impeller::TextureDescriptor::compression_type, impeller::TextureDescriptor::format, impeller::kCount1, impeller::kDevicePrivate, impeller::kLossy, impeller::kRenderTarget, impeller::kShaderRead, impeller::kTexture2D, impeller::TextureDescriptor::sample_count, impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, and VALIDATION_LOG.
void impeller::SwapchainTransientsMTL::SetSizeAndFormat | ( | ISize | size, |
PixelFormat | format | ||
) |
Update the size and pixel format of the onscreens.
Note: this will invalidate any cached textures if either property changes.
Definition at line 18 of file swapchain_transients_mtl.mm.