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

Commit 41309b8

Browse files
committed
Respect the clear color optimization in the fallback
1 parent 68656ff commit 41309b8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

impeller/entity/entity_pass.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,18 @@ bool EntityPass::OnRender(
951951
return true;
952952
};
953953
} else {
954-
element_iterator = [this](const ElementCallback& callback) {
954+
// If framebuffer fetch isn't supported, just disable the draw order
955+
// optimization. We could technically make it work by flushing each time
956+
// we encounter an advanced blend at recording time, but it's pretty rare
957+
element_iterator = [this, &opaque_clear_entity_count,
958+
&translucent_clear_entity_count](
959+
const ElementCallback& callback) {
960+
size_t skips = opaque_clear_entity_count + translucent_clear_entity_count;
955961
for (const auto& element : elements_) {
962+
if (skips > 0) {
963+
skips--;
964+
continue;
965+
}
956966
if (!callback(element)) {
957967
return false;
958968
}

0 commit comments

Comments
 (0)