9 #include "flutter/fml/status.h"
23 uint32_t entity_count,
24 std::optional<RenderPassResult> collapsed_parent_pass)
25 : renderer_(renderer),
26 pass_target_(pass_target),
27 entity_count_(entity_count),
28 is_collapsed_(collapsed_parent_pass.has_value()) {
29 if (collapsed_parent_pass.has_value()) {
30 pass_ = collapsed_parent_pass.value().pass;
45 return pass_ !=
nullptr;
59 FML_DCHECK(command_buffer_);
61 if (!pass_->EncodeCommands()) {
62 VALIDATION_LOG <<
"Failed to encode and submit command buffer while ending "
67 const std::shared_ptr<Texture>& target_texture =
69 if (target_texture->GetMipCount() > 1) {
71 command_buffer_, renderer_.
GetContext(), target_texture);
72 if (!mip_status.ok()) {
78 ->Submit({std::move(command_buffer_)})
84 command_buffer_ =
nullptr;
94 uint32_t pass_depth) {
96 return {.
pass = pass_};
103 command_buffer_ = renderer_.
GetContext()->CreateCommandBuffer();
104 if (!command_buffer_) {
110 VALIDATION_LOG <<
"Color attachment unexpectedly missing from the "
111 "EntityPass render target.";
115 command_buffer_->SetLabel(
116 "EntityPass Command Buffer: Depth=" + std::to_string(pass_depth) +
117 " Count=" + std::to_string(pass_count_));
125 ->second.resolve_texture !=
nullptr;
126 if (pass_count_ > 0 && is_msaa) {
128 pass_target_.
Flip(*renderer_.
GetContext()->GetResourceAllocator());
139 bool is_msaa = color0.resolve_texture !=
nullptr;
141 if (pass_count_ > 0) {
150 color0.store_action =
154 if (!depth.has_value()) {
155 VALIDATION_LOG <<
"Depth attachment unexpectedly missing from the "
156 "EntityPass render target.";
164 if (!depth.has_value() || !stencil.has_value()) {
165 VALIDATION_LOG <<
"Stencil/Depth attachment unexpectedly missing from the "
166 "EntityPass render target.";
177 pass_ = command_buffer_->CreateRenderPass(pass_target_.
GetRenderTarget());
187 "EntityPass Render Pass: Depth=" + std::to_string(pass_depth) +
188 " Count=" + std::to_string(pass_count_));
193 if (!renderer_.
GetContext()->GetCapabilities()->SupportsReadFromResolve() &&
195 result.
pass->GetRenderTarget().GetRenderTargetTexture()) {
196 VALIDATION_LOG <<
"EntityPass backdrop restore configuration is not valid "
197 "for the current graphics backend.";