Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3fa8581

Browse files
[Impeller] Set up the clear color for non-MSAA render targets. (#43452)
This is needed when using the "collapse DrawRects into clear colors" optimization on GLES.
1 parent 1fa222f commit 3fa8581

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

impeller/entity/entity_pass.cc

+1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ static EntityPassTarget CreateRenderTarget(ContentContext& renderer,
226226
.storage_mode = StorageMode::kDevicePrivate,
227227
.load_action = LoadAction::kDontCare,
228228
.store_action = StoreAction::kDontCare,
229+
.clear_color = clear_color,
229230
}, // color_attachment_config
230231
GetDefaultStencilConfig(readable) // stencil_attachment_config
231232
);

impeller/renderer/render_target.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ RenderTarget RenderTarget::CreateOffscreen(
232232
static_cast<uint64_t>(TextureUsage::kShaderRead);
233233

234234
ColorAttachment color0;
235-
color0.clear_color = Color::BlackTransparent();
235+
color0.clear_color = color_attachment_config.clear_color;
236236
color0.load_action = color_attachment_config.load_action;
237237
color0.store_action = color_attachment_config.store_action;
238238
color0.texture = context.GetResourceAllocator()->CreateTexture(color_tex0);

0 commit comments

Comments
 (0)