5 #ifndef FLUTTER_IMPELLER_ENTITY_RENDER_TARGET_CACHE_H_
6 #define FLUTTER_IMPELLER_ENTITY_RENDER_TARGET_CACHE_H_
20 uint32_t keep_alive_frame_count = 4);
25 void Start()
override;
34 std::string_view label =
"Offscreen",
37 std::optional<RenderTarget::AttachmentConfig> stencil_attachment_config =
39 const std::shared_ptr<Texture>& existing_color_texture =
nullptr,
40 const std::shared_ptr<Texture>& existing_depth_stencil_texture =
47 std::string_view label =
"Offscreen MSAA",
50 std::optional<RenderTarget::AttachmentConfig> stencil_attachment_config =
52 const std::shared_ptr<Texture>& existing_color_msaa_texture =
nullptr,
53 const std::shared_ptr<Texture>& existing_color_resolve_texture =
nullptr,
54 const std::shared_ptr<Texture>& existing_depth_stencil_texture =
61 struct RenderTargetData {
63 uint32_t keep_alive_frame_count;
68 std::vector<RenderTargetData> render_target_data_;
69 uint32_t keep_alive_frame_count_;
79 return render_target_data_.begin();
84 return render_target_data_.end();
To do anything rendering related with Impeller, you need a context.
a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated r...
An implementation of the [RenderTargetAllocator] that caches all allocated texture data for one frame...
RenderTarget CreateOffscreen(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen", RenderTarget::AttachmentConfig color_attachment_config=RenderTarget::kDefaultColorAttachmentConfig, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr) override
size_t CachedTextureCount() const
~RenderTargetCache()=default
RenderTargetCache(std::shared_ptr< Allocator > allocator, uint32_t keep_alive_frame_count=4)
std::vector< RenderTargetData >::const_iterator GetRenderTargetDataBegin() const
Visible for testing.
std::vector< RenderTargetData >::const_iterator GetRenderTargetDataEnd() const
Visible for testing.
void End() override
Mark the end of a frame workload.
void Start() override
Mark the beginning of a frame workload.
RenderTarget CreateOffscreenMSAA(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen MSAA", RenderTarget::AttachmentConfigMSAA color_attachment_config=RenderTarget::kDefaultColorAttachmentConfigMSAA, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_msaa_texture=nullptr, const std::shared_ptr< Texture > &existing_color_resolve_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr) override
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig