9 #include "flutter/fml/status.h"
22 : renderer_(renderer), pass_target_(pass_target) {}
33 return pass_ !=
nullptr;
47 FML_DCHECK(command_buffer_);
49 if (!pass_->EncodeCommands()) {
50 VALIDATION_LOG <<
"Failed to encode and submit command buffer while ending "
55 const std::shared_ptr<Texture>& target_texture =
57 if (target_texture->GetMipCount() > 1) {
59 command_buffer_, renderer_.
GetContext(), target_texture);
60 if (!mip_status.ok()) {
67 return renderer_.
GetContext()->SubmitOnscreen(std::move(command_buffer_));
69 return renderer_.
GetContext()->EnqueueCommandBuffer(
70 std::move(command_buffer_));
87 command_buffer_ = renderer_.
GetContext()->CreateCommandBuffer();
88 if (!command_buffer_) {
93 command_buffer_->SetLabel(
"EntityPass Command Buffer");
100 if (pass_count_ > 0 && is_msaa) {
101 pass_target_.
Flip(renderer_);
110 if (pass_count_ > 0) {
123 if (!depth.has_value()) {
124 VALIDATION_LOG <<
"Depth attachment unexpectedly missing from the "
125 "EntityPass render target.";
133 if (!depth.has_value() || !stencil.has_value()) {
134 VALIDATION_LOG <<
"Stencil/Depth attachment unexpectedly missing from the "
135 "EntityPass render target.";
146 pass_ = command_buffer_->CreateRenderPass(pass_target_.
GetRenderTarget());
151 pass_->SetLabel(
"EntityPass Render Pass");
std::shared_ptr< Context > GetContext() const
RenderTarget & GetRenderTarget()
std::shared_ptr< Texture > Flip(const ContentContext &renderer)
Flips the backdrop and returns a readable texture that can be bound/sampled to restore the previous p...
bool EndPass(bool is_onscreen=false)
EntityPassTarget & GetPassTarget() const
std::shared_ptr< Texture > GetTexture()
InlinePassContext(const ContentContext &renderer, EntityPassTarget &pass_target)
uint32_t GetPassCount() const
const std::shared_ptr< RenderPass > & GetRenderPass()
ColorAttachment GetColorAttachment(size_t index) const
Get the color attachment at [index].
std::shared_ptr< Texture > GetRenderTargetTexture() const
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
const std::optional< DepthAttachment > & GetDepthAttachment() const
const std::optional< StencilAttachment > & GetStencilAttachment() const
fml::Status AddMipmapGeneration(const std::shared_ptr< CommandBuffer > &command_buffer, const std::shared_ptr< Context > &context, const std::shared_ptr< Texture > &texture)
Adds a blit command to the render pass.
std::shared_ptr< Texture > resolve_texture