From 2bcf0587acec12769164b06942a3803d1c2b657b Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 28 Sep 2023 15:39:06 -0700 Subject: [PATCH] [Impeller] revert stencil config changes. (flutter/engine#46386) This was an experiment that didn't really pan out. Revert the changes to simplify rendering logic. --- engine/src/flutter/impeller/aiks/picture.cc | 20 +++++++------------ .../entity/contents/content_context.cc | 10 ++-------- .../impeller/renderer/render_target.cc | 10 ---------- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/engine/src/flutter/impeller/aiks/picture.cc b/engine/src/flutter/impeller/aiks/picture.cc index d7a6d40858..faa5c34e37 100644 --- a/engine/src/flutter/impeller/aiks/picture.cc +++ b/engine/src/flutter/impeller/aiks/picture.cc @@ -66,23 +66,17 @@ std::shared_ptr Picture::RenderToTexture( size, // size "Picture Snapshot MSAA", // label RenderTarget:: - kDefaultColorAttachmentConfigMSAA // color_attachment_config -#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan. - , - std::nullopt // stencil_attachment_config -#endif // FML_OS_ANDROID + kDefaultColorAttachmentConfigMSAA, // color_attachment_config + std::nullopt // stencil_attachment_config ); } else { target = RenderTarget::CreateOffscreen( - *impeller_context, // context - render_target_allocator, // allocator - size, // size - "Picture Snapshot", // label - RenderTarget::kDefaultColorAttachmentConfig // color_attachment_config -#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan. - , + *impeller_context, // context + render_target_allocator, // allocator + size, // size + "Picture Snapshot", // label + RenderTarget::kDefaultColorAttachmentConfig, // color_attachment_config std::nullopt // stencil_attachment_config -#endif // FML_OS_ANDROID ); } if (!target.IsValid()) { diff --git a/engine/src/flutter/impeller/entity/contents/content_context.cc b/engine/src/flutter/impeller/entity/contents/content_context.cc index 1461e1b9cd..a5c1e4d26d 100644 --- a/engine/src/flutter/impeller/entity/contents/content_context.cc +++ b/engine/src/flutter/impeller/entity/contents/content_context.cc @@ -382,21 +382,15 @@ std::shared_ptr ContentContext::MakeSubpass( subpass_target = RenderTarget::CreateOffscreenMSAA( *context, *GetRenderTargetCache(), texture_size, SPrintF("%s Offscreen", label.c_str()), - RenderTarget::kDefaultColorAttachmentConfigMSAA // -#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan. - , + RenderTarget::kDefaultColorAttachmentConfigMSAA, std::nullopt // stencil_attachment_config -#endif // FML_OS_ANDROID ); } else { subpass_target = RenderTarget::CreateOffscreen( *context, *GetRenderTargetCache(), texture_size, SPrintF("%s Offscreen", label.c_str()), - RenderTarget::kDefaultColorAttachmentConfig // -#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan. - , + RenderTarget::kDefaultColorAttachmentConfig, // std::nullopt // stencil_attachment_config -#endif // FML_OS_ANDROID ); } auto subpass_texture = subpass_target.GetRenderTargetTexture(); diff --git a/engine/src/flutter/impeller/renderer/render_target.cc b/engine/src/flutter/impeller/renderer/render_target.cc index 636601ddd3..87d158e044 100644 --- a/engine/src/flutter/impeller/renderer/render_target.cc +++ b/engine/src/flutter/impeller/renderer/render_target.cc @@ -231,11 +231,6 @@ RenderTarget RenderTarget::CreateOffscreen( return {}; } -// Dont force additional PSO variants on Vulkan. -#ifdef FML_OS_ANDROID - FML_DCHECK(stencil_attachment_config.has_value()); -#endif // FML_OS_ANDROID - RenderTarget target; PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat(); TextureDescriptor color_tex0; @@ -278,11 +273,6 @@ RenderTarget RenderTarget::CreateOffscreenMSAA( return {}; } -// Dont force additional PSO variants on Vulkan. -#ifdef FML_OS_ANDROID - FML_DCHECK(stencil_attachment_config.has_value()); -#endif // FML_OS_ANDROID - RenderTarget target; PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();