[Impeller] Set up the clear color for non-MSAA render targets. (flutter/engine#43452)

This is needed when using the "collapse DrawRects into clear colors"
optimization on GLES.
This commit is contained in:
Jason Simmons
2023-07-06 18:14:30 -07:00
committed by GitHub
parent 48a5b83ded
commit 2c360b26f3
2 changed files with 2 additions and 1 deletions

View File

@@ -226,6 +226,7 @@ static EntityPassTarget CreateRenderTarget(ContentContext& renderer,
.storage_mode = StorageMode::kDevicePrivate,
.load_action = LoadAction::kDontCare,
.store_action = StoreAction::kDontCare,
.clear_color = clear_color,
}, // color_attachment_config
GetDefaultStencilConfig(readable) // stencil_attachment_config
);

View File

@@ -232,7 +232,7 @@ RenderTarget RenderTarget::CreateOffscreen(
static_cast<uint64_t>(TextureUsage::kShaderRead);
ColorAttachment color0;
color0.clear_color = Color::BlackTransparent();
color0.clear_color = color_attachment_config.clear_color;
color0.load_action = color_attachment_config.load_action;
color0.store_action = color_attachment_config.store_action;
color0.texture = context.GetResourceAllocator()->CreateTexture(color_tex0);