diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 4fb4978537f59..70d63679281bd 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -306,9 +306,13 @@ std::shared_ptr ContentContext::MakeSubpass( RenderTarget subpass_target; if (context->GetDeviceCapabilities().SupportsOffscreenMSAA() && msaa_enabled) { - subpass_target = RenderTarget::CreateOffscreenMSAA(*context, texture_size); + subpass_target = RenderTarget::CreateOffscreenMSAA( + *context, texture_size, "Contents Offscreen MSAA", + RenderTarget::kDefaultColorAttachmentConfigMSAA, std::nullopt); } else { - subpass_target = RenderTarget::CreateOffscreen(*context, texture_size); + subpass_target = RenderTarget::CreateOffscreen( + *context, texture_size, "Contents Offscreen", + RenderTarget::kDefaultColorAttachmentConfig, std::nullopt); } auto subpass_texture = subpass_target.GetRenderTargetTexture(); if (!subpass_texture) { diff --git a/impeller/renderer/render_target.h b/impeller/renderer/render_target.h index fef7cf30ae651..3137ee4975b97 100644 --- a/impeller/renderer/render_target.h +++ b/impeller/renderer/render_target.h @@ -32,31 +32,38 @@ class RenderTarget { StoreAction store_action; }; - static constexpr AttachmentConfig kDefaultAttachmentConfig = { + static constexpr AttachmentConfig kDefaultColorAttachmentConfig = { .storage_mode = StorageMode::kDevicePrivate, .load_action = LoadAction::kClear, .store_action = StoreAction::kStore}; - static constexpr AttachmentConfigMSAA kDefaultAttachmentConfigMSAA = { + static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA = { .storage_mode = StorageMode::kDeviceTransient, .resolve_storage_mode = StorageMode::kDevicePrivate, .load_action = LoadAction::kClear, .store_action = StoreAction::kMultisampleResolve}; + static constexpr AttachmentConfig kDefaultStencilAttachmentConfig = { + .storage_mode = StorageMode::kDeviceTransient, + .load_action = LoadAction::kClear, + .store_action = StoreAction::kDontCare}; + static RenderTarget CreateOffscreen( const Context& context, ISize size, const std::string& label = "Offscreen", - AttachmentConfig color_attachment_config = kDefaultAttachmentConfig, - std::optional stencil_attachment_config = std::nullopt); + AttachmentConfig color_attachment_config = kDefaultColorAttachmentConfig, + std::optional stencil_attachment_config = + kDefaultStencilAttachmentConfig); static RenderTarget CreateOffscreenMSAA( const Context& context, ISize size, const std::string& label = "Offscreen MSAA", AttachmentConfigMSAA color_attachment_config = - kDefaultAttachmentConfigMSAA, - std::optional stencil_attachment_config = std::nullopt); + kDefaultColorAttachmentConfigMSAA, + std::optional stencil_attachment_config = + kDefaultStencilAttachmentConfig); RenderTarget();