9 #include "flutter/fml/status.h"
23 uint32_t pass_texture_reads,
24 uint32_t entity_count,
25 std::optional<RenderPassResult> collapsed_parent_pass)
26 : renderer_(renderer),
27 pass_target_(pass_target),
28 entity_count_(entity_count),
29 is_collapsed_(collapsed_parent_pass.has_value()) {
30 if (collapsed_parent_pass.has_value()) {
31 pass_ = collapsed_parent_pass.value().pass;
46 return pass_ !=
nullptr;
60 FML_DCHECK(command_buffer_);
62 if (!pass_->EncodeCommands()) {
63 VALIDATION_LOG <<
"Failed to encode and submit command buffer while ending "
68 const std::shared_ptr<Texture>& target_texture =
70 if (target_texture->GetMipCount() > 1) {
72 command_buffer_, renderer_.
GetContext(), target_texture);
73 if (!mip_status.ok()) {
79 ->Submit({std::move(command_buffer_)})
85 command_buffer_ =
nullptr;
95 uint32_t pass_depth) {
97 return {.
pass = pass_};
104 command_buffer_ = renderer_.
GetContext()->CreateCommandBuffer();
105 if (!command_buffer_) {
111 VALIDATION_LOG <<
"Color attachment unexpectedly missing from the "
112 "EntityPass render target.";
116 command_buffer_->SetLabel(
117 "EntityPass Command Buffer: Depth=" + std::to_string(pass_depth) +
118 " Count=" + std::to_string(pass_count_));
126 ->second.resolve_texture !=
nullptr;
127 if (pass_count_ > 0 && is_msaa) {
129 pass_target_.
Flip(*renderer_.
GetContext()->GetResourceAllocator());
140 bool is_msaa = color0.resolve_texture !=
nullptr;
142 if (pass_count_ > 0) {
151 color0.store_action =
156 if (!depth.has_value()) {
157 VALIDATION_LOG <<
"Depth attachment unexpectedly missing from the "
158 "EntityPass render target.";
168 if (!depth.has_value() || !stencil.has_value()) {
169 VALIDATION_LOG <<
"Stencil/Depth attachment unexpectedly missing from the "
170 "EntityPass render target.";
181 pass_ = command_buffer_->CreateRenderPass(pass_target_.
GetRenderTarget());
191 "EntityPass Render Pass: Depth=" + std::to_string(pass_depth) +
192 " Count=" + std::to_string(pass_count_));
197 if (!renderer_.
GetContext()->GetCapabilities()->SupportsReadFromResolve() &&
199 result.
pass->GetRenderTarget().GetRenderTargetTexture()) {
200 VALIDATION_LOG <<
"EntityPass backdrop restore configuration is not valid "
201 "for the current graphics backend.";