5#ifndef FLUTTER_IMPELLER_RENDERER_RENDER_TARGET_H_
6#define FLUTTER_IMPELLER_RENDERER_RENDER_TARGET_H_
12#include "flutter/fml/hash_combine.h"
32 constexpr size_t Hash()
const {
85 const std::string& label =
"Offscreen",
88 const std::shared_ptr<Texture>& depth_stencil_texture =
nullptr);
108 std::optional<StencilAttachment> attachment);
128 .
size = color_attachment.texture->GetSize(),
129 .mip_count = color_attachment.texture->GetMipCount(),
130 .has_msaa = color_attachment.resolve_texture !=
nullptr,
131 .has_depth_stencil = depth_.has_value() && stencil_.has_value()};
135 std::map<size_t, ColorAttachment> colors_;
136 std::optional<DepthAttachment> depth_;
137 std::optional<StencilAttachment> stencil_;
152 const std::string& label =
"Offscreen",
155 std::optional<RenderTarget::AttachmentConfig> stencil_attachment_config =
157 const std::shared_ptr<Texture>& existing_color_texture =
nullptr,
158 const std::shared_ptr<Texture>& existing_depth_stencil_texture =
nullptr);
164 const std::string& label =
"Offscreen MSAA",
167 std::optional<RenderTarget::AttachmentConfig> stencil_attachment_config =
169 const std::shared_ptr<Texture>& existing_color_msaa_texture =
nullptr,
170 const std::shared_ptr<Texture>& existing_color_resolve_texture =
nullptr,
171 const std::shared_ptr<Texture>& existing_depth_stencil_texture =
nullptr);
177 virtual void Start();
185 std::shared_ptr<Allocator> allocator_;
An object that allocates device memory.
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...
RenderTargetAllocator(std::shared_ptr< Allocator > allocator)
virtual ~RenderTargetAllocator()=default
virtual RenderTarget CreateOffscreen(const Context &context, ISize size, int mip_count, const std::string &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)
virtual void Start()
Mark the beginning of a frame workload.
virtual RenderTarget CreateOffscreenMSAA(const Context &context, ISize size, int mip_count, const std::string &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)
virtual void End()
Mark the end of a frame workload.
std::shared_ptr< Texture > GetRenderTargetTexture() const
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
const std::map< size_t, ColorAttachment > & GetColorAttachments() const
SampleCount GetSampleCount() const
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
void IterateAllAttachments(const std::function< bool(const Attachment &attachment)> &iterator) const
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
void SetupDepthStencilAttachments(const Context &context, Allocator &allocator, ISize size, bool msaa, const std::string &label="Offscreen", RenderTarget::AttachmentConfig stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &depth_stencil_texture=nullptr)
bool HasColorAttachment(size_t index) const
size_t GetMaxColorAttacmentBindIndex() const
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig
std::string ToString() const
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
PixelFormat GetRenderTargetPixelFormat() const
size_t GetTotalAttachmentCount() const
ISize GetRenderTargetSize() const
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
std::optional< ISize > GetColorAttachmentSize(size_t index) const
const std::optional< DepthAttachment > & GetDepthAttachment() const
const std::optional< StencilAttachment > & GetStencilAttachment() const
RenderTargetConfig ToConfig() const
Dart_NativeFunction function
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
constexpr std::size_t HashCombine()
StorageMode
Specified where the allocation resides and how it is used.
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
static constexpr Color BlackTransparent()
constexpr size_t Hash() const
constexpr bool operator==(const RenderTargetConfig &o) const
StorageMode resolve_storage_mode