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;
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());
129 if (!
result.backdrop_texture) {
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_));
191 result.just_created =
true;
193 if (!renderer_.
GetContext()->GetCapabilities()->SupportsReadFromResolve() &&
194 result.backdrop_texture ==
195 result.pass->GetRenderTarget().GetRenderTargetTexture()) {
196 VALIDATION_LOG <<
"EntityPass backdrop restore configuration is not valid "
197 "for the current graphics backend.";
std::shared_ptr< Context > GetContext() const
EntityPassTarget & GetPassTarget() const
std::shared_ptr< Texture > GetTexture()
RenderPassResult GetRenderPass(uint32_t pass_depth)
uint32_t GetPassCount() const
InlinePassContext(const ContentContext &renderer, EntityPassTarget &pass_target, uint32_t entity_count, std::optional< RenderPassResult > collapsed_parent_pass=std::nullopt)
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< RenderPass > pass